@tmagic/form 1.3.0-alpha.2 → 1.3.0-alpha.21
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/dist/style.css +21 -0
- package/dist/tmagic-form.js +1400 -1187
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +1425 -1210
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +10 -11
- package/src/Form.vue +14 -2
- package/src/FormDialog.vue +20 -6
- package/src/FormDrawer.vue +134 -0
- package/src/containers/Col.vue +5 -1
- package/src/containers/Container.vue +16 -11
- package/src/containers/Fieldset.vue +5 -1
- package/src/containers/GroupList.vue +7 -2
- package/src/containers/GroupListItem.vue +15 -9
- package/src/containers/Panel.vue +5 -1
- package/src/containers/Row.vue +5 -1
- package/src/containers/Step.vue +5 -1
- package/src/containers/Table.vue +153 -151
- package/src/containers/Tabs.vue +14 -8
- package/src/fields/Cascader.vue +7 -13
- package/src/fields/Checkbox.vue +7 -13
- package/src/fields/CheckboxGroup.vue +9 -15
- package/src/fields/ColorPicker.vue +10 -14
- package/src/fields/Date.vue +11 -15
- package/src/fields/DateTime.vue +12 -16
- package/src/fields/Daterange.vue +7 -13
- package/src/fields/Display.vue +7 -11
- package/src/fields/DynamicField.vue +8 -14
- package/src/fields/Hidden.vue +7 -11
- package/src/fields/Link.vue +7 -13
- package/src/fields/Number.vue +12 -15
- package/src/fields/NumberRange.vue +50 -0
- package/src/fields/RadioGroup.vue +7 -13
- package/src/fields/Select.vue +28 -30
- package/src/fields/SelectOptionGroups.vue +7 -3
- package/src/fields/SelectOptions.vue +5 -1
- package/src/fields/Switch.vue +11 -15
- package/src/fields/Text.vue +12 -15
- package/src/fields/Textarea.vue +12 -15
- package/src/fields/Time.vue +10 -14
- package/src/index.ts +43 -37
- package/src/schema.ts +27 -5
- package/src/theme/form-drawer.scss +11 -0
- package/src/theme/index.scss +2 -0
- package/src/theme/number-range.scss +8 -0
- package/src/theme/panel.scss +6 -0
- package/src/utils/config.ts +1 -1
- package/src/utils/form.ts +2 -1
- package/types/Form.vue.d.ts +11 -6
- package/types/FormDialog.vue.d.ts +89 -125
- package/types/FormDrawer.vue.d.ts +338 -0
- package/types/containers/Col.vue.d.ts +1 -1
- package/types/containers/Container.vue.d.ts +6 -3
- package/types/containers/Fieldset.vue.d.ts +6 -3
- package/types/containers/GroupList.vue.d.ts +1 -1
- package/types/containers/GroupListItem.vue.d.ts +1 -1
- package/types/containers/Panel.vue.d.ts +3 -3
- package/types/containers/Row.vue.d.ts +1 -1
- package/types/containers/Step.vue.d.ts +6 -3
- package/types/containers/Table.vue.d.ts +9 -6
- package/types/containers/Tabs.vue.d.ts +6 -3
- package/types/fields/Cascader.vue.d.ts +3 -23
- package/types/fields/Checkbox.vue.d.ts +3 -23
- package/types/fields/CheckboxGroup.vue.d.ts +3 -23
- package/types/fields/ColorPicker.vue.d.ts +2 -24
- package/types/fields/Date.vue.d.ts +2 -24
- package/types/fields/DateTime.vue.d.ts +2 -24
- package/types/fields/Daterange.vue.d.ts +3 -23
- package/types/fields/Display.vue.d.ts +2 -18
- package/types/fields/DynamicField.vue.d.ts +3 -32
- package/types/fields/Hidden.vue.d.ts +2 -18
- package/types/fields/Link.vue.d.ts +3 -23
- package/types/fields/Number.vue.d.ts +2 -25
- package/types/fields/NumberRange.vue.d.ts +12 -0
- package/types/fields/RadioGroup.vue.d.ts +3 -23
- package/types/fields/Select.vue.d.ts +3 -23
- package/types/fields/SelectOptionGroups.vue.d.ts +2 -2
- package/types/fields/SelectOptions.vue.d.ts +2 -2
- package/types/fields/Switch.vue.d.ts +2 -24
- package/types/fields/Text.vue.d.ts +2 -25
- package/types/fields/Textarea.vue.d.ts +2 -25
- package/types/fields/Time.vue.d.ts +2 -24
- package/types/index.d.ts +6 -1
- package/types/schema.d.ts +25 -5
- package/types/utils/config.d.ts +1 -1
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
if (["switch", "checkbox"].includes(type)) {
|
|
91
91
|
return false;
|
|
92
92
|
}
|
|
93
|
-
if (multiple) {
|
|
93
|
+
if (multiple || type === "number-range") {
|
|
94
94
|
return [];
|
|
95
95
|
}
|
|
96
96
|
return "";
|
|
@@ -105,7 +105,8 @@
|
|
|
105
105
|
parent: mForm?.parentValues || {},
|
|
106
106
|
formValue: mForm?.values || props.model,
|
|
107
107
|
prop: props.prop,
|
|
108
|
-
config: props.config
|
|
108
|
+
config: props.config,
|
|
109
|
+
index: props.index
|
|
109
110
|
});
|
|
110
111
|
};
|
|
111
112
|
const display = function(mForm, config, props) {
|
|
@@ -164,36 +165,36 @@
|
|
|
164
165
|
return valuesTmp || {};
|
|
165
166
|
};
|
|
166
167
|
|
|
167
|
-
const _hoisted_1$
|
|
168
|
+
const _hoisted_1$d = ["innerHTML"];
|
|
168
169
|
const _hoisted_2$7 = ["innerHTML"];
|
|
169
|
-
const _hoisted_3$
|
|
170
|
-
const _hoisted_4$
|
|
171
|
-
const _hoisted_5$
|
|
172
|
-
const _hoisted_6$
|
|
173
|
-
const _hoisted_7$
|
|
174
|
-
const _hoisted_8$
|
|
175
|
-
const _hoisted_9
|
|
176
|
-
const _hoisted_10
|
|
170
|
+
const _hoisted_3$4 = ["innerHTML"];
|
|
171
|
+
const _hoisted_4$3 = ["innerHTML"];
|
|
172
|
+
const _hoisted_5$3 = ["innerHTML"];
|
|
173
|
+
const _hoisted_6$1 = ["innerHTML"];
|
|
174
|
+
const _hoisted_7$1 = ["innerHTML"];
|
|
175
|
+
const _hoisted_8$1 = ["innerHTML"];
|
|
176
|
+
const _hoisted_9 = ["innerHTML"];
|
|
177
|
+
const _hoisted_10 = ["innerHTML"];
|
|
177
178
|
const _hoisted_11 = ["innerHTML"];
|
|
178
179
|
const _hoisted_12 = ["innerHTML"];
|
|
179
180
|
const _hoisted_13 = {
|
|
180
181
|
key: 5,
|
|
181
182
|
style: { "text-align": "center" }
|
|
182
183
|
};
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
185
|
+
...{
|
|
186
|
+
name: "MFormContainer"
|
|
187
|
+
},
|
|
188
|
+
__name: "Container",
|
|
188
189
|
props: {
|
|
189
|
-
model:
|
|
190
|
+
model: {},
|
|
190
191
|
lastValues: { default: () => ({}) },
|
|
191
|
-
config:
|
|
192
|
+
config: {},
|
|
192
193
|
prop: { default: "" },
|
|
193
194
|
disabled: { type: Boolean },
|
|
194
|
-
labelWidth:
|
|
195
|
+
labelWidth: {},
|
|
195
196
|
expandMore: { type: Boolean, default: false },
|
|
196
|
-
stepActive:
|
|
197
|
+
stepActive: {},
|
|
197
198
|
size: { default: "small" },
|
|
198
199
|
isCompare: { type: Boolean, default: false }
|
|
199
200
|
},
|
|
@@ -230,6 +231,7 @@
|
|
|
230
231
|
return "m-fields-text";
|
|
231
232
|
});
|
|
232
233
|
const disabled = vue.computed(() => props.disabled || filterFunction(mForm, props.config.disabled, props));
|
|
234
|
+
const text = vue.computed(() => filterFunction(mForm, props.config.text, props));
|
|
233
235
|
const tooltip = vue.computed(() => filterFunction(mForm, props.config.tooltip, props));
|
|
234
236
|
const extra = vue.computed(() => filterFunction(mForm, props.config.extra, props));
|
|
235
237
|
const rule = vue.computed(() => getRules(mForm, props.config.rules, props));
|
|
@@ -260,7 +262,7 @@
|
|
|
260
262
|
(showDiff2) => {
|
|
261
263
|
if (type.value === "hidden")
|
|
262
264
|
return;
|
|
263
|
-
if (items.value && !
|
|
265
|
+
if (items.value && !text.value && type.value && display$1.value)
|
|
264
266
|
return;
|
|
265
267
|
if (display$1.value && showDiff2 && type.value) {
|
|
266
268
|
emit("addDiffCount");
|
|
@@ -325,94 +327,94 @@
|
|
|
325
327
|
return (_ctx, _cache) => {
|
|
326
328
|
const _component_m_fields_hidden = vue.resolveComponent("m-fields-hidden");
|
|
327
329
|
const _component_Container = vue.resolveComponent("Container", true);
|
|
328
|
-
return
|
|
330
|
+
return _ctx.config ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
329
331
|
key: 0,
|
|
330
|
-
style: vue.normalizeStyle(
|
|
331
|
-
class: vue.normalizeClass(
|
|
332
|
+
style: vue.normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
333
|
+
class: vue.normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
|
|
332
334
|
}, [
|
|
333
|
-
|
|
335
|
+
type.value === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, {
|
|
334
336
|
key: 0,
|
|
335
|
-
model:
|
|
336
|
-
config:
|
|
337
|
-
name:
|
|
338
|
-
disabled:
|
|
339
|
-
prop:
|
|
340
|
-
}, null, 8, ["model", "config", "name", "disabled", "prop"])) :
|
|
341
|
-
key: key(
|
|
342
|
-
size:
|
|
343
|
-
model:
|
|
344
|
-
"last-values":
|
|
345
|
-
"is-compare":
|
|
346
|
-
config:
|
|
347
|
-
disabled:
|
|
348
|
-
name:
|
|
349
|
-
prop:
|
|
350
|
-
"step-active":
|
|
337
|
+
model: _ctx.model,
|
|
338
|
+
config: _ctx.config,
|
|
339
|
+
name: _ctx.config.name,
|
|
340
|
+
disabled: disabled.value,
|
|
341
|
+
prop: itemProp.value
|
|
342
|
+
}, null, 8, ["model", "config", "name", "disabled", "prop"])) : items.value && !text.value && type.value && display$1.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
343
|
+
key: key(_ctx.config),
|
|
344
|
+
size: _ctx.size,
|
|
345
|
+
model: _ctx.model,
|
|
346
|
+
"last-values": _ctx.lastValues,
|
|
347
|
+
"is-compare": _ctx.isCompare,
|
|
348
|
+
config: _ctx.config,
|
|
349
|
+
disabled: disabled.value,
|
|
350
|
+
name: name.value,
|
|
351
|
+
prop: itemProp.value,
|
|
352
|
+
"step-active": _ctx.stepActive,
|
|
351
353
|
"expand-more": expand.value,
|
|
352
|
-
"label-width":
|
|
354
|
+
"label-width": itemLabelWidth.value,
|
|
353
355
|
onChange: onChangeHandler,
|
|
354
356
|
onAddDiffCount
|
|
355
|
-
}, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) :
|
|
357
|
+
}, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : type.value && display$1.value && !showDiff.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
356
358
|
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
357
|
-
style: vue.normalizeStyle(
|
|
358
|
-
class: vue.normalizeClass({ hidden: `${
|
|
359
|
-
prop:
|
|
360
|
-
"label-width":
|
|
361
|
-
rules:
|
|
359
|
+
style: vue.normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
|
|
360
|
+
class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
|
|
361
|
+
prop: itemProp.value,
|
|
362
|
+
"label-width": itemLabelWidth.value,
|
|
363
|
+
rules: rule.value
|
|
362
364
|
}, {
|
|
363
365
|
label: vue.withCtx(() => [
|
|
364
366
|
vue.createElementVNode("span", {
|
|
365
|
-
innerHTML:
|
|
366
|
-
}, null, 8, _hoisted_1$
|
|
367
|
+
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
368
|
+
}, null, 8, _hoisted_1$d)
|
|
367
369
|
]),
|
|
368
370
|
default: vue.withCtx(() => [
|
|
369
|
-
|
|
371
|
+
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
|
|
370
372
|
content: vue.withCtx(() => [
|
|
371
|
-
vue.createElementVNode("div", { innerHTML:
|
|
373
|
+
vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_2$7)
|
|
372
374
|
]),
|
|
373
375
|
default: vue.withCtx(() => [
|
|
374
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
|
|
375
|
-
key: key(
|
|
376
|
-
size:
|
|
377
|
-
model:
|
|
378
|
-
"last-values":
|
|
379
|
-
config:
|
|
380
|
-
name:
|
|
381
|
-
disabled:
|
|
382
|
-
prop:
|
|
376
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
377
|
+
key: key(_ctx.config),
|
|
378
|
+
size: _ctx.size,
|
|
379
|
+
model: _ctx.model,
|
|
380
|
+
"last-values": _ctx.lastValues,
|
|
381
|
+
config: _ctx.config,
|
|
382
|
+
name: name.value,
|
|
383
|
+
disabled: disabled.value,
|
|
384
|
+
prop: itemProp.value,
|
|
383
385
|
onChange: onChangeHandler,
|
|
384
386
|
onAddDiffCount
|
|
385
387
|
}, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"]))
|
|
386
388
|
]),
|
|
387
389
|
_: 1
|
|
388
|
-
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
|
|
389
|
-
key: key(
|
|
390
|
-
size:
|
|
391
|
-
model:
|
|
392
|
-
"last-values":
|
|
393
|
-
config:
|
|
394
|
-
name:
|
|
395
|
-
disabled:
|
|
396
|
-
prop:
|
|
390
|
+
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
391
|
+
key: key(_ctx.config),
|
|
392
|
+
size: _ctx.size,
|
|
393
|
+
model: _ctx.model,
|
|
394
|
+
"last-values": _ctx.lastValues,
|
|
395
|
+
config: _ctx.config,
|
|
396
|
+
name: name.value,
|
|
397
|
+
disabled: disabled.value,
|
|
398
|
+
prop: itemProp.value,
|
|
397
399
|
onChange: onChangeHandler,
|
|
398
400
|
onAddDiffCount
|
|
399
401
|
}, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"])),
|
|
400
|
-
|
|
402
|
+
extra.value && type.value !== "table" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
401
403
|
key: 2,
|
|
402
|
-
innerHTML:
|
|
404
|
+
innerHTML: extra.value,
|
|
403
405
|
class: "m-form-tip"
|
|
404
|
-
}, null, 8, _hoisted_3$
|
|
406
|
+
}, null, 8, _hoisted_3$4)) : vue.createCommentVNode("", true)
|
|
405
407
|
]),
|
|
406
408
|
_: 1
|
|
407
409
|
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
408
|
-
|
|
410
|
+
_ctx.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
409
411
|
key: 0,
|
|
410
412
|
placement: "left"
|
|
411
413
|
}, {
|
|
412
414
|
content: vue.withCtx(() => [
|
|
413
415
|
vue.createElementVNode("div", {
|
|
414
|
-
innerHTML:
|
|
415
|
-
}, null, 8, _hoisted_4$
|
|
416
|
+
innerHTML: _ctx.config.tip
|
|
417
|
+
}, null, 8, _hoisted_4$3)
|
|
416
418
|
]),
|
|
417
419
|
default: vue.withCtx(() => [
|
|
418
420
|
vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -424,63 +426,63 @@
|
|
|
424
426
|
]),
|
|
425
427
|
_: 1
|
|
426
428
|
})) : vue.createCommentVNode("", true)
|
|
427
|
-
], 64)) :
|
|
429
|
+
], 64)) : type.value && display$1.value && showDiff.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
|
|
428
430
|
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
429
|
-
style: vue.normalizeStyle([
|
|
430
|
-
class: vue.normalizeClass({ hidden: `${
|
|
431
|
-
prop:
|
|
432
|
-
"label-width":
|
|
433
|
-
rules:
|
|
431
|
+
style: vue.normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
|
|
432
|
+
class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
|
|
433
|
+
prop: itemProp.value,
|
|
434
|
+
"label-width": itemLabelWidth.value,
|
|
435
|
+
rules: rule.value
|
|
434
436
|
}, {
|
|
435
437
|
label: vue.withCtx(() => [
|
|
436
438
|
vue.createElementVNode("span", {
|
|
437
|
-
innerHTML:
|
|
438
|
-
}, null, 8, _hoisted_5$
|
|
439
|
+
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
440
|
+
}, null, 8, _hoisted_5$3)
|
|
439
441
|
]),
|
|
440
442
|
default: vue.withCtx(() => [
|
|
441
|
-
|
|
443
|
+
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
|
|
442
444
|
content: vue.withCtx(() => [
|
|
443
|
-
vue.createElementVNode("div", { innerHTML:
|
|
445
|
+
vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_6$1)
|
|
444
446
|
]),
|
|
445
447
|
default: vue.withCtx(() => [
|
|
446
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
|
|
447
|
-
key: key(
|
|
448
|
-
size:
|
|
449
|
-
model:
|
|
450
|
-
config:
|
|
451
|
-
name:
|
|
452
|
-
disabled:
|
|
453
|
-
prop:
|
|
448
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
449
|
+
key: key(_ctx.config),
|
|
450
|
+
size: _ctx.size,
|
|
451
|
+
model: _ctx.lastValues,
|
|
452
|
+
config: _ctx.config,
|
|
453
|
+
name: name.value,
|
|
454
|
+
disabled: disabled.value,
|
|
455
|
+
prop: itemProp.value,
|
|
454
456
|
onChange: onChangeHandler
|
|
455
457
|
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
|
|
456
458
|
]),
|
|
457
459
|
_: 1
|
|
458
|
-
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
|
|
459
|
-
key: key(
|
|
460
|
-
size:
|
|
461
|
-
model:
|
|
462
|
-
config:
|
|
463
|
-
name:
|
|
464
|
-
disabled:
|
|
465
|
-
prop:
|
|
460
|
+
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
461
|
+
key: key(_ctx.config),
|
|
462
|
+
size: _ctx.size,
|
|
463
|
+
model: _ctx.lastValues,
|
|
464
|
+
config: _ctx.config,
|
|
465
|
+
name: name.value,
|
|
466
|
+
disabled: disabled.value,
|
|
467
|
+
prop: itemProp.value,
|
|
466
468
|
onChange: onChangeHandler
|
|
467
469
|
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
|
|
468
|
-
|
|
470
|
+
extra.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
469
471
|
key: 2,
|
|
470
|
-
innerHTML:
|
|
472
|
+
innerHTML: extra.value,
|
|
471
473
|
class: "m-form-tip"
|
|
472
|
-
}, null, 8, _hoisted_7$
|
|
474
|
+
}, null, 8, _hoisted_7$1)) : vue.createCommentVNode("", true)
|
|
473
475
|
]),
|
|
474
476
|
_: 1
|
|
475
477
|
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
476
|
-
|
|
478
|
+
_ctx.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
477
479
|
key: 0,
|
|
478
480
|
placement: "left"
|
|
479
481
|
}, {
|
|
480
482
|
content: vue.withCtx(() => [
|
|
481
483
|
vue.createElementVNode("div", {
|
|
482
|
-
innerHTML:
|
|
483
|
-
}, null, 8, _hoisted_8$
|
|
484
|
+
innerHTML: _ctx.config.tip
|
|
485
|
+
}, null, 8, _hoisted_8$1)
|
|
484
486
|
]),
|
|
485
487
|
default: vue.withCtx(() => [
|
|
486
488
|
vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -493,60 +495,60 @@
|
|
|
493
495
|
_: 1
|
|
494
496
|
})) : vue.createCommentVNode("", true),
|
|
495
497
|
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
496
|
-
style: vue.normalizeStyle([
|
|
497
|
-
class: vue.normalizeClass({ hidden: `${
|
|
498
|
-
prop:
|
|
499
|
-
"label-width":
|
|
500
|
-
rules:
|
|
498
|
+
style: vue.normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
|
|
499
|
+
class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
|
|
500
|
+
prop: itemProp.value,
|
|
501
|
+
"label-width": itemLabelWidth.value,
|
|
502
|
+
rules: rule.value
|
|
501
503
|
}, {
|
|
502
504
|
label: vue.withCtx(() => [
|
|
503
505
|
vue.createElementVNode("span", {
|
|
504
|
-
innerHTML:
|
|
505
|
-
}, null, 8, _hoisted_9
|
|
506
|
+
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
507
|
+
}, null, 8, _hoisted_9)
|
|
506
508
|
]),
|
|
507
509
|
default: vue.withCtx(() => [
|
|
508
|
-
|
|
510
|
+
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
|
|
509
511
|
content: vue.withCtx(() => [
|
|
510
|
-
vue.createElementVNode("div", { innerHTML:
|
|
512
|
+
vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_10)
|
|
511
513
|
]),
|
|
512
514
|
default: vue.withCtx(() => [
|
|
513
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
|
|
514
|
-
key: key(
|
|
515
|
-
size:
|
|
516
|
-
model:
|
|
517
|
-
config:
|
|
518
|
-
name:
|
|
519
|
-
disabled:
|
|
520
|
-
prop:
|
|
515
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
516
|
+
key: key(_ctx.config),
|
|
517
|
+
size: _ctx.size,
|
|
518
|
+
model: _ctx.model,
|
|
519
|
+
config: _ctx.config,
|
|
520
|
+
name: name.value,
|
|
521
|
+
disabled: disabled.value,
|
|
522
|
+
prop: itemProp.value,
|
|
521
523
|
onChange: onChangeHandler
|
|
522
524
|
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
|
|
523
525
|
]),
|
|
524
526
|
_: 1
|
|
525
|
-
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
|
|
526
|
-
key: key(
|
|
527
|
-
size:
|
|
528
|
-
model:
|
|
529
|
-
config:
|
|
530
|
-
name:
|
|
531
|
-
disabled:
|
|
532
|
-
prop:
|
|
527
|
+
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
528
|
+
key: key(_ctx.config),
|
|
529
|
+
size: _ctx.size,
|
|
530
|
+
model: _ctx.model,
|
|
531
|
+
config: _ctx.config,
|
|
532
|
+
name: name.value,
|
|
533
|
+
disabled: disabled.value,
|
|
534
|
+
prop: itemProp.value,
|
|
533
535
|
onChange: onChangeHandler
|
|
534
536
|
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
|
|
535
|
-
|
|
537
|
+
extra.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
536
538
|
key: 2,
|
|
537
|
-
innerHTML:
|
|
539
|
+
innerHTML: extra.value,
|
|
538
540
|
class: "m-form-tip"
|
|
539
541
|
}, null, 8, _hoisted_11)) : vue.createCommentVNode("", true)
|
|
540
542
|
]),
|
|
541
543
|
_: 1
|
|
542
544
|
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
543
|
-
|
|
545
|
+
_ctx.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
544
546
|
key: 1,
|
|
545
547
|
placement: "left"
|
|
546
548
|
}, {
|
|
547
549
|
content: vue.withCtx(() => [
|
|
548
550
|
vue.createElementVNode("div", {
|
|
549
|
-
innerHTML:
|
|
551
|
+
innerHTML: _ctx.config.tip
|
|
550
552
|
}, null, 8, _hoisted_12)
|
|
551
553
|
]),
|
|
552
554
|
default: vue.withCtx(() => [
|
|
@@ -559,26 +561,26 @@
|
|
|
559
561
|
]),
|
|
560
562
|
_: 1
|
|
561
563
|
})) : vue.createCommentVNode("", true)
|
|
562
|
-
], 64)) :
|
|
563
|
-
(
|
|
564
|
+
], 64)) : items.value && display$1.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [
|
|
565
|
+
(name.value || name.value === 0 ? _ctx.model[name.value] : _ctx.model) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(items.value, (item) => {
|
|
564
566
|
return vue.openBlock(), vue.createBlock(_component_Container, {
|
|
565
567
|
key: key(item),
|
|
566
|
-
model:
|
|
567
|
-
"last-values":
|
|
568
|
-
"is-compare":
|
|
568
|
+
model: name.value || name.value === 0 ? _ctx.model[name.value] : _ctx.model,
|
|
569
|
+
"last-values": name.value || name.value === 0 ? _ctx.lastValues[name.value] || {} : _ctx.lastValues,
|
|
570
|
+
"is-compare": _ctx.isCompare,
|
|
569
571
|
config: item,
|
|
570
|
-
size:
|
|
571
|
-
disabled:
|
|
572
|
-
"step-active":
|
|
572
|
+
size: _ctx.size,
|
|
573
|
+
disabled: disabled.value,
|
|
574
|
+
"step-active": _ctx.stepActive,
|
|
573
575
|
"expand-more": expand.value,
|
|
574
|
-
"label-width":
|
|
575
|
-
prop:
|
|
576
|
+
"label-width": itemLabelWidth.value,
|
|
577
|
+
prop: itemProp.value,
|
|
576
578
|
onChange: onChangeHandler,
|
|
577
579
|
onAddDiffCount
|
|
578
580
|
}, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
|
|
579
581
|
}), 128)) : vue.createCommentVNode("", true)
|
|
580
582
|
], 64)) : vue.createCommentVNode("", true),
|
|
581
|
-
|
|
583
|
+
_ctx.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
|
|
582
584
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
583
585
|
type: "primary",
|
|
584
586
|
size: "small",
|
|
@@ -597,30 +599,30 @@
|
|
|
597
599
|
}
|
|
598
600
|
});
|
|
599
601
|
|
|
600
|
-
const _hoisted_1$
|
|
602
|
+
const _hoisted_1$c = ["innerHTML"];
|
|
601
603
|
const _hoisted_2$6 = ["innerHTML"];
|
|
602
|
-
const _hoisted_3$
|
|
603
|
-
const _hoisted_4$
|
|
604
|
-
const _hoisted_5$
|
|
605
|
-
const _hoisted_6
|
|
604
|
+
const _hoisted_3$3 = { key: 1 };
|
|
605
|
+
const _hoisted_4$2 = ["innerHTML"];
|
|
606
|
+
const _hoisted_5$2 = ["innerHTML"];
|
|
607
|
+
const _hoisted_6 = {
|
|
606
608
|
key: 2,
|
|
607
609
|
style: { "display": "flex" }
|
|
608
610
|
};
|
|
609
|
-
const _hoisted_7
|
|
610
|
-
const _hoisted_8
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
611
|
+
const _hoisted_7 = { style: { "flex": "1" } };
|
|
612
|
+
const _hoisted_8 = ["src"];
|
|
613
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
614
|
+
...{
|
|
615
|
+
name: "MFormFieldset"
|
|
616
|
+
},
|
|
617
|
+
__name: "Fieldset",
|
|
616
618
|
props: {
|
|
617
|
-
labelWidth:
|
|
619
|
+
labelWidth: {},
|
|
618
620
|
prop: { default: "" },
|
|
619
|
-
size:
|
|
620
|
-
model:
|
|
621
|
+
size: {},
|
|
622
|
+
model: {},
|
|
621
623
|
lastValues: { default: () => ({}) },
|
|
622
624
|
isCompare: { type: Boolean, default: false },
|
|
623
|
-
config:
|
|
625
|
+
config: {},
|
|
624
626
|
rules: { default: {} },
|
|
625
627
|
disabled: { type: Boolean }
|
|
626
628
|
},
|
|
@@ -647,30 +649,30 @@
|
|
|
647
649
|
const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
|
|
648
650
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
649
651
|
return (_ctx, _cache) => {
|
|
650
|
-
return (
|
|
652
|
+
return (name.value ? _ctx.model[name.value] : _ctx.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
651
653
|
key: 0,
|
|
652
654
|
class: "m-fieldset",
|
|
653
|
-
style: vue.normalizeStyle(
|
|
655
|
+
style: vue.normalizeStyle(show.value ? "padding: 15px 15px 0 5px;" : "border: 0")
|
|
654
656
|
}, [
|
|
655
|
-
|
|
657
|
+
name.value && _ctx.config.checkbox ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!show.value ? "div" : "legend"), { key: 0 }, {
|
|
656
658
|
default: vue.withCtx(() => [
|
|
657
659
|
vue.createVNode(vue.unref(design.TMagicCheckbox), {
|
|
658
|
-
modelValue:
|
|
660
|
+
modelValue: _ctx.model[name.value].value,
|
|
659
661
|
"onUpdate:modelValue": [
|
|
660
|
-
_cache[0] || (_cache[0] = ($event) =>
|
|
662
|
+
_cache[0] || (_cache[0] = ($event) => _ctx.model[name.value].value = $event),
|
|
661
663
|
change
|
|
662
664
|
],
|
|
663
|
-
prop: `${
|
|
665
|
+
prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.config.name}.value`,
|
|
664
666
|
"true-label": 1,
|
|
665
667
|
"false-label": 0
|
|
666
668
|
}, {
|
|
667
669
|
default: vue.withCtx(() => [
|
|
668
670
|
vue.createElementVNode("span", {
|
|
669
|
-
innerHTML:
|
|
670
|
-
}, null, 8, _hoisted_1$
|
|
671
|
-
|
|
671
|
+
innerHTML: _ctx.config.legend
|
|
672
|
+
}, null, 8, _hoisted_1$c),
|
|
673
|
+
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
672
674
|
key: 0,
|
|
673
|
-
innerHTML:
|
|
675
|
+
innerHTML: _ctx.config.extra,
|
|
674
676
|
class: "m-form-tip"
|
|
675
677
|
}, null, 8, _hoisted_2$6)) : vue.createCommentVNode("", true)
|
|
676
678
|
]),
|
|
@@ -678,30 +680,30 @@
|
|
|
678
680
|
}, 8, ["modelValue", "prop"])
|
|
679
681
|
]),
|
|
680
682
|
_: 1
|
|
681
|
-
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$
|
|
683
|
+
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$3, [
|
|
682
684
|
vue.createElementVNode("span", {
|
|
683
|
-
innerHTML:
|
|
684
|
-
}, null, 8, _hoisted_4$
|
|
685
|
-
|
|
685
|
+
innerHTML: _ctx.config.legend
|
|
686
|
+
}, null, 8, _hoisted_4$2),
|
|
687
|
+
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
686
688
|
key: 0,
|
|
687
|
-
innerHTML:
|
|
689
|
+
innerHTML: _ctx.config.extra,
|
|
688
690
|
class: "m-form-tip"
|
|
689
|
-
}, null, 8, _hoisted_5$
|
|
691
|
+
}, null, 8, _hoisted_5$2)) : vue.createCommentVNode("", true)
|
|
690
692
|
])),
|
|
691
|
-
|
|
692
|
-
vue.createElementVNode("div", _hoisted_7
|
|
693
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
694
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
693
|
+
_ctx.config.schematic && show.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
694
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
695
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (item, index) => {
|
|
696
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
695
697
|
key: key(item, index),
|
|
696
|
-
model:
|
|
697
|
-
lastValues:
|
|
698
|
-
"is-compare":
|
|
699
|
-
rules:
|
|
698
|
+
model: name.value ? _ctx.model[name.value] : _ctx.model,
|
|
699
|
+
lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
|
|
700
|
+
"is-compare": _ctx.isCompare,
|
|
701
|
+
rules: name.value ? _ctx.rules[name.value] : [],
|
|
700
702
|
config: item,
|
|
701
|
-
prop:
|
|
702
|
-
disabled:
|
|
703
|
-
labelWidth:
|
|
704
|
-
size:
|
|
703
|
+
prop: _ctx.prop,
|
|
704
|
+
disabled: _ctx.disabled,
|
|
705
|
+
labelWidth: lWidth.value,
|
|
706
|
+
size: _ctx.size,
|
|
705
707
|
onChange: change,
|
|
706
708
|
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
707
709
|
}, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
|
|
@@ -709,20 +711,20 @@
|
|
|
709
711
|
]),
|
|
710
712
|
vue.createElementVNode("img", {
|
|
711
713
|
class: "m-form-schematic",
|
|
712
|
-
src:
|
|
713
|
-
}, null, 8, _hoisted_8
|
|
714
|
-
])) :
|
|
715
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
714
|
+
src: _ctx.config.schematic
|
|
715
|
+
}, null, 8, _hoisted_8)
|
|
716
|
+
])) : show.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(_ctx.config.items, (item, index) => {
|
|
717
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
716
718
|
key: key(item, index),
|
|
717
|
-
model:
|
|
718
|
-
lastValues:
|
|
719
|
-
"is-compare":
|
|
720
|
-
rules:
|
|
719
|
+
model: name.value ? _ctx.model[name.value] : _ctx.model,
|
|
720
|
+
lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
|
|
721
|
+
"is-compare": _ctx.isCompare,
|
|
722
|
+
rules: name.value ? _ctx.rules[name.value] : [],
|
|
721
723
|
config: item,
|
|
722
|
-
prop:
|
|
723
|
-
labelWidth:
|
|
724
|
-
size:
|
|
725
|
-
disabled:
|
|
724
|
+
prop: _ctx.prop,
|
|
725
|
+
labelWidth: lWidth.value,
|
|
726
|
+
size: _ctx.size,
|
|
727
|
+
disabled: _ctx.disabled,
|
|
726
728
|
onChange: change,
|
|
727
729
|
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
728
730
|
}, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
|
|
@@ -732,35 +734,30 @@
|
|
|
732
734
|
}
|
|
733
735
|
});
|
|
734
736
|
|
|
735
|
-
const _hoisted_1$
|
|
736
|
-
const _hoisted_2$5 =
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
743
|
-
...__default__$t,
|
|
737
|
+
const _hoisted_1$b = { class: "m-fields-group-list-item" };
|
|
738
|
+
const _hoisted_2$5 = ["innerHTML"];
|
|
739
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
740
|
+
...{
|
|
741
|
+
name: "MFormGroupListItem"
|
|
742
|
+
},
|
|
743
|
+
__name: "GroupListItem",
|
|
744
744
|
props: {
|
|
745
|
-
model:
|
|
746
|
-
lastValues:
|
|
745
|
+
model: {},
|
|
746
|
+
lastValues: {},
|
|
747
747
|
isCompare: { type: Boolean },
|
|
748
|
-
groupModel:
|
|
749
|
-
config:
|
|
750
|
-
labelWidth:
|
|
751
|
-
prop:
|
|
752
|
-
size:
|
|
753
|
-
index:
|
|
748
|
+
groupModel: {},
|
|
749
|
+
config: {},
|
|
750
|
+
labelWidth: {},
|
|
751
|
+
prop: {},
|
|
752
|
+
size: {},
|
|
753
|
+
index: {},
|
|
754
754
|
disabled: { type: Boolean }
|
|
755
755
|
},
|
|
756
756
|
emits: ["swap-item", "remove-item", "change", "addDiffCount"],
|
|
757
757
|
setup(__props, { emit }) {
|
|
758
758
|
const props = __props;
|
|
759
759
|
const mForm = vue.inject("mForm");
|
|
760
|
-
const expand = vue.ref(
|
|
761
|
-
vue.watchEffect(() => {
|
|
762
|
-
expand.value = !props.index;
|
|
763
|
-
});
|
|
760
|
+
const expand = vue.ref(props.config.expandAll || !props.index);
|
|
764
761
|
const rowConfig = vue.computed(() => ({
|
|
765
762
|
type: "row",
|
|
766
763
|
span: props.config.span || 24,
|
|
@@ -772,7 +769,11 @@
|
|
|
772
769
|
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
773
770
|
return props.model[props.config.titleKey];
|
|
774
771
|
}
|
|
775
|
-
|
|
772
|
+
if (props.config.title) {
|
|
773
|
+
return filterFunction(mForm, props.config.title, props);
|
|
774
|
+
}
|
|
775
|
+
const titlePrefix = props.config.titlePrefix || "组";
|
|
776
|
+
return `${titlePrefix} ${String(props.index + 1)}`;
|
|
776
777
|
});
|
|
777
778
|
const length = vue.computed(() => props.groupModel?.length || 0);
|
|
778
779
|
const itemExtra = vue.computed(() => filterFunction(mForm, props.config.itemExtra, props));
|
|
@@ -788,7 +789,7 @@
|
|
|
788
789
|
}
|
|
789
790
|
return true;
|
|
790
791
|
};
|
|
791
|
-
const changeOrder = (offset = 0) => emit("swap-item", props.index,
|
|
792
|
+
const changeOrder = (offset = 0) => emit("swap-item", props.index, props.index + offset);
|
|
792
793
|
const movable = () => {
|
|
793
794
|
const { movable: movable2 } = props.config;
|
|
794
795
|
if (movable2 === void 0)
|
|
@@ -800,16 +801,16 @@
|
|
|
800
801
|
};
|
|
801
802
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
802
803
|
return (_ctx, _cache) => {
|
|
803
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
804
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
804
805
|
vue.createElementVNode("div", null, [
|
|
805
806
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
806
807
|
text: "",
|
|
807
|
-
disabled:
|
|
808
|
+
disabled: _ctx.disabled,
|
|
808
809
|
icon: expand.value ? vue.unref(iconsVue.CaretBottom) : vue.unref(iconsVue.CaretRight),
|
|
809
810
|
onClick: expandHandler
|
|
810
811
|
}, {
|
|
811
812
|
default: vue.withCtx(() => [
|
|
812
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
813
|
+
vue.createTextVNode(vue.toDisplayString(title.value), 1)
|
|
813
814
|
]),
|
|
814
815
|
_: 1
|
|
815
816
|
}, 8, ["disabled", "icon"]),
|
|
@@ -817,20 +818,20 @@
|
|
|
817
818
|
style: { "color": "#f56c6c" },
|
|
818
819
|
text: "",
|
|
819
820
|
icon: vue.unref(iconsVue.Delete),
|
|
820
|
-
disabled:
|
|
821
|
+
disabled: _ctx.disabled,
|
|
821
822
|
onClick: removeHandler
|
|
822
823
|
}, null, 8, ["icon", "disabled"]), [
|
|
823
|
-
[vue.vShow, showDelete(parseInt(String(
|
|
824
|
+
[vue.vShow, showDelete(parseInt(String(_ctx.index)))]
|
|
824
825
|
]),
|
|
825
826
|
movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
826
827
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
827
828
|
text: "",
|
|
828
|
-
disabled:
|
|
829
|
+
disabled: _ctx.disabled,
|
|
829
830
|
size: "small",
|
|
830
831
|
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
831
832
|
}, {
|
|
832
833
|
default: vue.withCtx(() => [
|
|
833
|
-
|
|
834
|
+
vue.createTextVNode("上移"),
|
|
834
835
|
vue.createVNode(vue.unref(design.TMagicIcon), null, {
|
|
835
836
|
default: vue.withCtx(() => [
|
|
836
837
|
vue.createVNode(vue.unref(iconsVue.CaretTop))
|
|
@@ -840,16 +841,16 @@
|
|
|
840
841
|
]),
|
|
841
842
|
_: 1
|
|
842
843
|
}, 8, ["disabled"]), [
|
|
843
|
-
[vue.vShow,
|
|
844
|
+
[vue.vShow, _ctx.index !== 0]
|
|
844
845
|
]),
|
|
845
846
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
846
|
-
disabled:
|
|
847
|
+
disabled: _ctx.disabled,
|
|
847
848
|
text: "",
|
|
848
849
|
size: "small",
|
|
849
850
|
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
850
851
|
}, {
|
|
851
852
|
default: vue.withCtx(() => [
|
|
852
|
-
|
|
853
|
+
vue.createTextVNode("下移"),
|
|
853
854
|
vue.createVNode(vue.unref(design.TMagicIcon), null, {
|
|
854
855
|
default: vue.withCtx(() => [
|
|
855
856
|
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
@@ -859,25 +860,25 @@
|
|
|
859
860
|
]),
|
|
860
861
|
_: 1
|
|
861
862
|
}, 8, ["disabled"]), [
|
|
862
|
-
[vue.vShow,
|
|
863
|
+
[vue.vShow, _ctx.index !== length.value - 1]
|
|
863
864
|
])
|
|
864
865
|
], 64)) : vue.createCommentVNode("", true),
|
|
865
|
-
|
|
866
|
+
itemExtra.value ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
866
867
|
key: 1,
|
|
867
|
-
innerHTML:
|
|
868
|
+
innerHTML: itemExtra.value,
|
|
868
869
|
class: "m-form-tip"
|
|
869
|
-
}, null, 8,
|
|
870
|
+
}, null, 8, _hoisted_2$5)) : vue.createCommentVNode("", true)
|
|
870
871
|
]),
|
|
871
|
-
expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
872
|
+
expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
872
873
|
key: 0,
|
|
873
|
-
config:
|
|
874
|
-
model:
|
|
875
|
-
lastValues:
|
|
876
|
-
"is-compare":
|
|
877
|
-
labelWidth:
|
|
878
|
-
prop: `${
|
|
879
|
-
size:
|
|
880
|
-
disabled:
|
|
874
|
+
config: rowConfig.value,
|
|
875
|
+
model: _ctx.model,
|
|
876
|
+
lastValues: _ctx.lastValues,
|
|
877
|
+
"is-compare": _ctx.isCompare,
|
|
878
|
+
labelWidth: _ctx.labelWidth,
|
|
879
|
+
prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${String(_ctx.index)}`,
|
|
880
|
+
size: _ctx.size,
|
|
881
|
+
disabled: _ctx.disabled,
|
|
881
882
|
onChange: changeHandler,
|
|
882
883
|
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
883
884
|
}, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : vue.createCommentVNode("", true)
|
|
@@ -886,32 +887,30 @@
|
|
|
886
887
|
}
|
|
887
888
|
});
|
|
888
889
|
|
|
889
|
-
const _hoisted_1$
|
|
890
|
+
const _hoisted_1$a = { class: "m-fields-group-list" };
|
|
890
891
|
const _hoisted_2$4 = ["innerHTML"];
|
|
891
|
-
const _hoisted_3$
|
|
892
|
+
const _hoisted_3$2 = {
|
|
892
893
|
key: 1,
|
|
893
894
|
class: "el-table__empty-block"
|
|
894
895
|
};
|
|
895
|
-
const _hoisted_4$
|
|
896
|
-
const _hoisted_5$
|
|
897
|
-
_hoisted_4$
|
|
896
|
+
const _hoisted_4$1 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
|
|
897
|
+
const _hoisted_5$1 = [
|
|
898
|
+
_hoisted_4$1
|
|
898
899
|
];
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
905
|
-
...__default__$s,
|
|
900
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
901
|
+
...{
|
|
902
|
+
name: "MFormGroupList"
|
|
903
|
+
},
|
|
904
|
+
__name: "GroupList",
|
|
906
905
|
props: {
|
|
907
|
-
model:
|
|
908
|
-
lastValues:
|
|
906
|
+
model: {},
|
|
907
|
+
lastValues: {},
|
|
909
908
|
isCompare: { type: Boolean },
|
|
910
|
-
config:
|
|
911
|
-
name:
|
|
912
|
-
labelWidth:
|
|
913
|
-
prop:
|
|
914
|
-
size:
|
|
909
|
+
config: {},
|
|
910
|
+
name: {},
|
|
911
|
+
labelWidth: {},
|
|
912
|
+
prop: {},
|
|
913
|
+
size: {},
|
|
915
914
|
disabled: { type: Boolean }
|
|
916
915
|
},
|
|
917
916
|
emits: ["change", "addDiffCount"],
|
|
@@ -981,50 +980,50 @@
|
|
|
981
980
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
982
981
|
const getLastValues = (item, index) => item?.[index] || {};
|
|
983
982
|
return (_ctx, _cache) => {
|
|
984
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
985
|
-
|
|
983
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
984
|
+
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
986
985
|
key: 0,
|
|
987
|
-
innerHTML:
|
|
986
|
+
innerHTML: _ctx.config.extra,
|
|
988
987
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
989
988
|
}, null, 8, _hoisted_2$4)) : vue.createCommentVNode("", true),
|
|
990
|
-
!
|
|
991
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
989
|
+
!_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, _hoisted_5$1)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.model[_ctx.name], (item, index) => {
|
|
990
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
992
991
|
key: index,
|
|
993
992
|
model: item,
|
|
994
|
-
lastValues: getLastValues(
|
|
995
|
-
"is-compare":
|
|
996
|
-
config:
|
|
997
|
-
prop:
|
|
993
|
+
lastValues: getLastValues(_ctx.lastValues[_ctx.name], index),
|
|
994
|
+
"is-compare": _ctx.isCompare,
|
|
995
|
+
config: _ctx.config,
|
|
996
|
+
prop: _ctx.prop,
|
|
998
997
|
index,
|
|
999
|
-
"label-width":
|
|
1000
|
-
size:
|
|
1001
|
-
disabled:
|
|
1002
|
-
"group-model":
|
|
998
|
+
"label-width": _ctx.labelWidth,
|
|
999
|
+
size: _ctx.size,
|
|
1000
|
+
disabled: _ctx.disabled,
|
|
1001
|
+
"group-model": _ctx.model[_ctx.name],
|
|
1003
1002
|
onRemoveItem: removeHandler,
|
|
1004
1003
|
onSwapItem: swapHandler,
|
|
1005
1004
|
onChange: changeHandler,
|
|
1006
1005
|
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
1007
1006
|
}, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
|
|
1008
1007
|
}), 128)),
|
|
1009
|
-
|
|
1008
|
+
addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1010
1009
|
key: 3,
|
|
1011
1010
|
onClick: addHandler,
|
|
1012
1011
|
size: "small",
|
|
1013
|
-
disabled:
|
|
1012
|
+
disabled: _ctx.disabled
|
|
1014
1013
|
}, {
|
|
1015
1014
|
default: vue.withCtx(() => [
|
|
1016
|
-
|
|
1015
|
+
vue.createTextVNode("新增")
|
|
1017
1016
|
]),
|
|
1018
1017
|
_: 1
|
|
1019
1018
|
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1020
|
-
|
|
1019
|
+
_ctx.config.enableToggleMode ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1021
1020
|
key: 4,
|
|
1022
1021
|
icon: vue.unref(iconsVue.Grid),
|
|
1023
1022
|
size: "small",
|
|
1024
1023
|
onClick: toggleMode
|
|
1025
1024
|
}, {
|
|
1026
1025
|
default: vue.withCtx(() => [
|
|
1027
|
-
|
|
1026
|
+
vue.createTextVNode("切换为表格")
|
|
1028
1027
|
]),
|
|
1029
1028
|
_: 1
|
|
1030
1029
|
}, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
@@ -1033,28 +1032,28 @@
|
|
|
1033
1032
|
}
|
|
1034
1033
|
});
|
|
1035
1034
|
|
|
1036
|
-
const _hoisted_1$
|
|
1035
|
+
const _hoisted_1$9 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
|
|
1037
1036
|
const _hoisted_2$3 = ["innerHTML"];
|
|
1038
|
-
const _hoisted_3$
|
|
1037
|
+
const _hoisted_3$1 = {
|
|
1039
1038
|
key: 0,
|
|
1040
1039
|
style: { "display": "flex" }
|
|
1041
1040
|
};
|
|
1042
|
-
const _hoisted_4
|
|
1043
|
-
const _hoisted_5
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1041
|
+
const _hoisted_4 = { style: { "flex": "1" } };
|
|
1042
|
+
const _hoisted_5 = ["src"];
|
|
1043
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
1044
|
+
...{
|
|
1045
|
+
name: "MFormPanel"
|
|
1046
|
+
},
|
|
1047
|
+
__name: "Panel",
|
|
1049
1048
|
props: {
|
|
1050
|
-
model:
|
|
1051
|
-
lastValues:
|
|
1049
|
+
model: {},
|
|
1050
|
+
lastValues: {},
|
|
1052
1051
|
isCompare: { type: Boolean },
|
|
1053
|
-
config:
|
|
1054
|
-
name:
|
|
1055
|
-
labelWidth:
|
|
1056
|
-
prop:
|
|
1057
|
-
size:
|
|
1052
|
+
config: {},
|
|
1053
|
+
name: {},
|
|
1054
|
+
labelWidth: {},
|
|
1055
|
+
prop: {},
|
|
1056
|
+
size: {},
|
|
1058
1057
|
disabled: { type: Boolean }
|
|
1059
1058
|
},
|
|
1060
1059
|
emits: ["change", "addDiffCount"],
|
|
@@ -1067,45 +1066,45 @@
|
|
|
1067
1066
|
const changeHandler = () => emit("change", props.model);
|
|
1068
1067
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
1069
1068
|
return (_ctx, _cache) => {
|
|
1070
|
-
return
|
|
1069
|
+
return items.value && items.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), {
|
|
1071
1070
|
key: 0,
|
|
1072
1071
|
class: "box-card m-form-panel",
|
|
1073
1072
|
"body-style": { display: expand.value ? "block" : "none" }
|
|
1074
1073
|
}, {
|
|
1075
1074
|
header: vue.withCtx(() => [
|
|
1076
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
1075
|
+
vue.createElementVNode("div", _hoisted_1$9, [
|
|
1077
1076
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1078
1077
|
style: { "padding": "0" },
|
|
1079
1078
|
text: "",
|
|
1080
1079
|
icon: expand.value ? vue.unref(iconsVue.CaretBottom) : vue.unref(iconsVue.CaretRight),
|
|
1081
1080
|
onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
|
|
1082
1081
|
}, null, 8, ["icon"]),
|
|
1083
|
-
|
|
1082
|
+
_ctx.config && _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1084
1083
|
key: 0,
|
|
1085
|
-
innerHTML:
|
|
1084
|
+
innerHTML: _ctx.config.extra,
|
|
1086
1085
|
class: "m-form-tip"
|
|
1087
1086
|
}, null, 8, _hoisted_2$3)) : vue.createCommentVNode("", true),
|
|
1088
1087
|
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1089
|
-
vue.createTextVNode(vue.toDisplayString(filter(
|
|
1088
|
+
vue.createTextVNode(vue.toDisplayString(filter(_ctx.config.title)), 1)
|
|
1090
1089
|
])
|
|
1091
1090
|
])
|
|
1092
1091
|
]),
|
|
1093
1092
|
default: vue.withCtx(() => [
|
|
1094
1093
|
vue.createElementVNode("div", null, [
|
|
1095
1094
|
vue.renderSlot(_ctx.$slots, "default"),
|
|
1096
|
-
|
|
1097
|
-
vue.createElementVNode("div", _hoisted_4
|
|
1098
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
1099
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
1095
|
+
_ctx.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
|
|
1096
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
1097
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items.value, (item, index) => {
|
|
1098
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
1100
1099
|
key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
1101
1100
|
config: item,
|
|
1102
|
-
model:
|
|
1103
|
-
lastValues:
|
|
1104
|
-
"is-compare":
|
|
1105
|
-
prop:
|
|
1106
|
-
size:
|
|
1107
|
-
disabled:
|
|
1108
|
-
"label-width":
|
|
1101
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1102
|
+
lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
|
|
1103
|
+
"is-compare": _ctx.isCompare,
|
|
1104
|
+
prop: _ctx.prop,
|
|
1105
|
+
size: _ctx.size,
|
|
1106
|
+
disabled: _ctx.disabled,
|
|
1107
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1109
1108
|
onChange: changeHandler,
|
|
1110
1109
|
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
1111
1110
|
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
|
|
@@ -1113,19 +1112,19 @@
|
|
|
1113
1112
|
]),
|
|
1114
1113
|
vue.createElementVNode("img", {
|
|
1115
1114
|
class: "m-form-schematic",
|
|
1116
|
-
src:
|
|
1117
|
-
}, null, 8, _hoisted_5
|
|
1118
|
-
])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(
|
|
1119
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
1115
|
+
src: _ctx.config.schematic
|
|
1116
|
+
}, null, 8, _hoisted_5)
|
|
1117
|
+
])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(items.value, (item, index) => {
|
|
1118
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
1120
1119
|
key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
1121
1120
|
config: item,
|
|
1122
|
-
model:
|
|
1123
|
-
lastValues:
|
|
1124
|
-
"is-compare":
|
|
1125
|
-
prop:
|
|
1126
|
-
size:
|
|
1127
|
-
disabled:
|
|
1128
|
-
"label-width":
|
|
1121
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1122
|
+
lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
|
|
1123
|
+
"is-compare": _ctx.isCompare,
|
|
1124
|
+
prop: _ctx.prop,
|
|
1125
|
+
size: _ctx.size,
|
|
1126
|
+
disabled: _ctx.disabled,
|
|
1127
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1129
1128
|
onChange: changeHandler,
|
|
1130
1129
|
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
1131
1130
|
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
|
|
@@ -1138,21 +1137,21 @@
|
|
|
1138
1137
|
}
|
|
1139
1138
|
});
|
|
1140
1139
|
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1140
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
1141
|
+
...{
|
|
1142
|
+
name: "MFormCol"
|
|
1143
|
+
},
|
|
1144
|
+
__name: "Col",
|
|
1146
1145
|
props: {
|
|
1147
|
-
model:
|
|
1148
|
-
lastValues:
|
|
1146
|
+
model: {},
|
|
1147
|
+
lastValues: {},
|
|
1149
1148
|
isCompare: { type: Boolean },
|
|
1150
|
-
config:
|
|
1151
|
-
labelWidth:
|
|
1149
|
+
config: {},
|
|
1150
|
+
labelWidth: {},
|
|
1152
1151
|
expandMore: { type: Boolean },
|
|
1153
|
-
span:
|
|
1154
|
-
size:
|
|
1155
|
-
prop:
|
|
1152
|
+
span: {},
|
|
1153
|
+
size: {},
|
|
1154
|
+
prop: {},
|
|
1156
1155
|
disabled: { type: Boolean }
|
|
1157
1156
|
},
|
|
1158
1157
|
emits: ["change", "addDiffCount"],
|
|
@@ -1163,44 +1162,44 @@
|
|
|
1163
1162
|
const changeHandler = () => emit("change", props.model);
|
|
1164
1163
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
1165
1164
|
return (_ctx, _cache) => {
|
|
1166
|
-
return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCol), { span:
|
|
1165
|
+
return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCol), { span: _ctx.span }, {
|
|
1167
1166
|
default: vue.withCtx(() => [
|
|
1168
|
-
vue.createVNode(_sfc_main$
|
|
1169
|
-
model:
|
|
1170
|
-
lastValues:
|
|
1171
|
-
"is-compare":
|
|
1172
|
-
config:
|
|
1173
|
-
prop:
|
|
1174
|
-
"label-width":
|
|
1175
|
-
"expand-more":
|
|
1176
|
-
size:
|
|
1177
|
-
disabled:
|
|
1167
|
+
vue.createVNode(_sfc_main$x, {
|
|
1168
|
+
model: _ctx.model,
|
|
1169
|
+
lastValues: _ctx.lastValues,
|
|
1170
|
+
"is-compare": _ctx.isCompare,
|
|
1171
|
+
config: _ctx.config,
|
|
1172
|
+
prop: _ctx.prop,
|
|
1173
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1174
|
+
"expand-more": _ctx.expandMore,
|
|
1175
|
+
size: _ctx.size,
|
|
1176
|
+
disabled: _ctx.disabled,
|
|
1178
1177
|
onChange: changeHandler,
|
|
1179
1178
|
onAddDiffCount
|
|
1180
1179
|
}, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "label-width", "expand-more", "size", "disabled"])
|
|
1181
1180
|
]),
|
|
1182
1181
|
_: 1
|
|
1183
1182
|
}, 8, ["span"])), [
|
|
1184
|
-
[vue.vShow,
|
|
1183
|
+
[vue.vShow, display$1.value && _ctx.config.type !== "hidden"]
|
|
1185
1184
|
]);
|
|
1186
1185
|
};
|
|
1187
1186
|
}
|
|
1188
1187
|
});
|
|
1189
1188
|
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1189
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
1190
|
+
...{
|
|
1191
|
+
name: "MFormRow"
|
|
1192
|
+
},
|
|
1193
|
+
__name: "Row",
|
|
1195
1194
|
props: {
|
|
1196
|
-
model:
|
|
1197
|
-
lastValues:
|
|
1195
|
+
model: {},
|
|
1196
|
+
lastValues: {},
|
|
1198
1197
|
isCompare: { type: Boolean },
|
|
1199
|
-
config:
|
|
1200
|
-
name:
|
|
1201
|
-
labelWidth:
|
|
1202
|
-
prop:
|
|
1203
|
-
size:
|
|
1198
|
+
config: {},
|
|
1199
|
+
name: {},
|
|
1200
|
+
labelWidth: {},
|
|
1201
|
+
prop: {},
|
|
1202
|
+
size: {},
|
|
1204
1203
|
expandMore: { type: Boolean },
|
|
1205
1204
|
disabled: { type: Boolean }
|
|
1206
1205
|
},
|
|
@@ -1213,19 +1212,19 @@
|
|
|
1213
1212
|
return (_ctx, _cache) => {
|
|
1214
1213
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRow), { gutter: 10 }, {
|
|
1215
1214
|
default: vue.withCtx(() => [
|
|
1216
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
1217
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
1215
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (col, index) => {
|
|
1216
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$s, {
|
|
1218
1217
|
key: col[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
1219
|
-
span: col.span ||
|
|
1218
|
+
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1220
1219
|
config: col,
|
|
1221
|
-
labelWidth:
|
|
1222
|
-
expandMore:
|
|
1223
|
-
model:
|
|
1224
|
-
lastValues:
|
|
1225
|
-
"is-compare":
|
|
1226
|
-
prop:
|
|
1227
|
-
size:
|
|
1228
|
-
disabled:
|
|
1220
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1221
|
+
expandMore: _ctx.expandMore,
|
|
1222
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1223
|
+
lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
|
|
1224
|
+
"is-compare": _ctx.isCompare,
|
|
1225
|
+
prop: _ctx.prop,
|
|
1226
|
+
size: _ctx.size,
|
|
1227
|
+
disabled: _ctx.disabled,
|
|
1229
1228
|
onChange: changeHandler,
|
|
1230
1229
|
onAddDiffCount
|
|
1231
1230
|
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "lastValues", "is-compare", "prop", "size", "disabled"]);
|
|
@@ -1237,19 +1236,19 @@
|
|
|
1237
1236
|
}
|
|
1238
1237
|
});
|
|
1239
1238
|
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1239
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
1240
|
+
...{
|
|
1241
|
+
name: "MFormStep"
|
|
1242
|
+
},
|
|
1243
|
+
__name: "Step",
|
|
1245
1244
|
props: {
|
|
1246
|
-
model:
|
|
1247
|
-
lastValues:
|
|
1245
|
+
model: {},
|
|
1246
|
+
lastValues: {},
|
|
1248
1247
|
isCompare: { type: Boolean },
|
|
1249
|
-
config:
|
|
1248
|
+
config: {},
|
|
1250
1249
|
stepActive: { default: 1 },
|
|
1251
|
-
labelWidth:
|
|
1252
|
-
size:
|
|
1250
|
+
labelWidth: {},
|
|
1251
|
+
size: {},
|
|
1253
1252
|
disabled: { type: Boolean }
|
|
1254
1253
|
},
|
|
1255
1254
|
emits: ["change", "addDiffCount"],
|
|
@@ -1273,10 +1272,10 @@
|
|
|
1273
1272
|
vue.createVNode(vue.unref(design.TMagicSteps), {
|
|
1274
1273
|
active: active.value,
|
|
1275
1274
|
"align-center": "",
|
|
1276
|
-
space:
|
|
1275
|
+
space: _ctx.config.space
|
|
1277
1276
|
}, {
|
|
1278
1277
|
default: vue.withCtx(() => [
|
|
1279
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
1278
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (item, index) => {
|
|
1280
1279
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicStep), {
|
|
1281
1280
|
key: item.__key,
|
|
1282
1281
|
title: item.title,
|
|
@@ -1287,20 +1286,20 @@
|
|
|
1287
1286
|
]),
|
|
1288
1287
|
_: 1
|
|
1289
1288
|
}, 8, ["active", "space"]),
|
|
1290
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
1289
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (step, index) => {
|
|
1291
1290
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1292
1291
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(step.items, (item) => {
|
|
1293
1292
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1294
|
-
item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$
|
|
1293
|
+
item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
1295
1294
|
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
1296
1295
|
config: item,
|
|
1297
|
-
model: step.name ?
|
|
1298
|
-
lastValues: step.name ?
|
|
1299
|
-
"is-compare":
|
|
1296
|
+
model: step.name ? _ctx.model[step.name] : _ctx.model,
|
|
1297
|
+
lastValues: step.name ? _ctx.lastValues[step.name] : _ctx.lastValues,
|
|
1298
|
+
"is-compare": _ctx.isCompare,
|
|
1300
1299
|
prop: `${step.name}`,
|
|
1301
|
-
size:
|
|
1302
|
-
disabled:
|
|
1303
|
-
"label-width":
|
|
1300
|
+
size: _ctx.size,
|
|
1301
|
+
disabled: _ctx.disabled,
|
|
1302
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1304
1303
|
onChange: changeHandler,
|
|
1305
1304
|
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
1306
1305
|
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"])), [
|
|
@@ -1315,43 +1314,36 @@
|
|
|
1315
1314
|
}
|
|
1316
1315
|
});
|
|
1317
1316
|
|
|
1318
|
-
const _hoisted_1$
|
|
1319
|
-
const _hoisted_2$2 =
|
|
1320
|
-
const _hoisted_3
|
|
1321
|
-
|
|
1322
|
-
const _hoisted_5 = /* @__PURE__ */ vue.createTextVNode(" ");
|
|
1323
|
-
const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode("展开配置");
|
|
1324
|
-
const _hoisted_7 = /* @__PURE__ */ vue.createTextVNode("导入EXCEL");
|
|
1325
|
-
const _hoisted_8 = /* @__PURE__ */ vue.createTextVNode(" ");
|
|
1326
|
-
const _hoisted_9 = /* @__PURE__ */ vue.createTextVNode("清空");
|
|
1327
|
-
const _hoisted_10 = {
|
|
1328
|
-
key: 1,
|
|
1317
|
+
const _hoisted_1$8 = ["innerHTML"];
|
|
1318
|
+
const _hoisted_2$2 = ["innerHTML"];
|
|
1319
|
+
const _hoisted_3 = {
|
|
1320
|
+
key: 6,
|
|
1329
1321
|
class: "bottom",
|
|
1330
1322
|
style: { "text-align": "right" }
|
|
1331
1323
|
};
|
|
1332
|
-
const
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1324
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
1325
|
+
...{
|
|
1326
|
+
name: "MFormTable"
|
|
1327
|
+
},
|
|
1328
|
+
__name: "Table",
|
|
1337
1329
|
props: {
|
|
1338
|
-
model:
|
|
1330
|
+
model: {},
|
|
1339
1331
|
lastValues: { default: () => ({}) },
|
|
1340
1332
|
isCompare: { type: Boolean, default: false },
|
|
1341
|
-
config:
|
|
1342
|
-
name:
|
|
1333
|
+
config: {},
|
|
1334
|
+
name: {},
|
|
1343
1335
|
prop: { default: "" },
|
|
1344
|
-
labelWidth:
|
|
1336
|
+
labelWidth: {},
|
|
1345
1337
|
sort: { type: Boolean },
|
|
1346
1338
|
disabled: { type: Boolean },
|
|
1347
1339
|
sortKey: { default: "" },
|
|
1348
|
-
text:
|
|
1349
|
-
size:
|
|
1340
|
+
text: {},
|
|
1341
|
+
size: {},
|
|
1350
1342
|
enableToggleMode: { type: Boolean, default: true },
|
|
1351
1343
|
showIndex: { type: Boolean, default: true }
|
|
1352
1344
|
},
|
|
1353
1345
|
emits: ["change", "select", "addDiffCount"],
|
|
1354
|
-
setup(__props, { expose, emit }) {
|
|
1346
|
+
setup(__props, { expose: __expose, emit }) {
|
|
1355
1347
|
const props = __props;
|
|
1356
1348
|
let timer = null;
|
|
1357
1349
|
const mForm = vue.inject("mForm");
|
|
@@ -1671,266 +1663,264 @@
|
|
|
1671
1663
|
return `${prop.value}${prop.value ? "." : ""}${index + 1 + pagecontext.value * pagesize.value - 1}`;
|
|
1672
1664
|
};
|
|
1673
1665
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
1674
|
-
|
|
1666
|
+
__expose({
|
|
1675
1667
|
toggleRowSelection
|
|
1676
1668
|
});
|
|
1677
1669
|
return (_ctx, _cache) => {
|
|
1678
1670
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1679
1671
|
ref_key: "mTable",
|
|
1680
1672
|
ref: mTable,
|
|
1681
|
-
class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra":
|
|
1673
|
+
class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
|
|
1682
1674
|
}, [
|
|
1683
|
-
|
|
1675
|
+
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1684
1676
|
key: 0,
|
|
1685
1677
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1686
|
-
innerHTML:
|
|
1687
|
-
}, null, 8, _hoisted_1$
|
|
1688
|
-
vue.
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
]),
|
|
1926
|
-
__props.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
|
|
1678
|
+
innerHTML: _ctx.config.extra
|
|
1679
|
+
}, null, 8, _hoisted_1$8)) : vue.createCommentVNode("", true),
|
|
1680
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
1681
|
+
content: "拖拽可排序",
|
|
1682
|
+
placement: "left-start",
|
|
1683
|
+
disabled: _ctx.config.dropSort !== true
|
|
1684
|
+
}, {
|
|
1685
|
+
default: vue.withCtx(() => [
|
|
1686
|
+
_ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
|
|
1687
|
+
ref_key: "tMagicTable",
|
|
1688
|
+
ref: tMagicTable,
|
|
1689
|
+
style: { "width": "100%" },
|
|
1690
|
+
"row-key": _ctx.config.rowKey || "id",
|
|
1691
|
+
data: data.value,
|
|
1692
|
+
lastData: lastData.value,
|
|
1693
|
+
border: _ctx.config.border,
|
|
1694
|
+
"max-height": _ctx.config.maxHeight,
|
|
1695
|
+
"default-expand-all": true,
|
|
1696
|
+
key: updateKey.value,
|
|
1697
|
+
onSelect: selectHandle,
|
|
1698
|
+
onSortChange: sortChange
|
|
1699
|
+
}, {
|
|
1700
|
+
default: vue.withCtx(() => [
|
|
1701
|
+
_ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1702
|
+
key: 0,
|
|
1703
|
+
fixed: "left",
|
|
1704
|
+
width: "30",
|
|
1705
|
+
type: "expand"
|
|
1706
|
+
}, {
|
|
1707
|
+
default: vue.withCtx((scope) => [
|
|
1708
|
+
vue.createElementVNode("span", {
|
|
1709
|
+
innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
|
|
1710
|
+
class: "m-form-tip"
|
|
1711
|
+
}, null, 8, _hoisted_2$2)
|
|
1712
|
+
]),
|
|
1713
|
+
_: 1
|
|
1714
|
+
})) : vue.createCommentVNode("", true),
|
|
1715
|
+
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
1716
|
+
label: "操作",
|
|
1717
|
+
width: _ctx.config.operateColWidth || 55,
|
|
1718
|
+
align: "center",
|
|
1719
|
+
fixed: _ctx.config.fixed === false ? void 0 : "left"
|
|
1720
|
+
}, {
|
|
1721
|
+
default: vue.withCtx((scope) => [
|
|
1722
|
+
vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
|
|
1723
|
+
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
|
|
1724
|
+
class: "m-table-delete-icon",
|
|
1725
|
+
onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1726
|
+
}, {
|
|
1727
|
+
default: vue.withCtx(() => [
|
|
1728
|
+
vue.createVNode(vue.unref(iconsVue.Delete))
|
|
1729
|
+
]),
|
|
1730
|
+
_: 2
|
|
1731
|
+
}, 1032, ["onClick"]), [
|
|
1732
|
+
[vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
|
|
1733
|
+
])
|
|
1734
|
+
]),
|
|
1735
|
+
_: 3
|
|
1736
|
+
}, 8, ["width", "fixed"]),
|
|
1737
|
+
_ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1738
|
+
key: 1,
|
|
1739
|
+
label: "排序",
|
|
1740
|
+
width: "60"
|
|
1741
|
+
}, {
|
|
1742
|
+
default: vue.withCtx((scope) => [
|
|
1743
|
+
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1744
|
+
key: 0,
|
|
1745
|
+
content: "点击上移,双击置顶",
|
|
1746
|
+
placement: "top"
|
|
1747
|
+
}, {
|
|
1748
|
+
default: vue.withCtx(() => [
|
|
1749
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1750
|
+
plain: "",
|
|
1751
|
+
size: "small",
|
|
1752
|
+
type: "primary",
|
|
1753
|
+
icon: vue.unref(iconsVue.ArrowUp),
|
|
1754
|
+
disabled: _ctx.disabled,
|
|
1755
|
+
text: "",
|
|
1756
|
+
onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1757
|
+
onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1758
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1759
|
+
]),
|
|
1760
|
+
_: 2
|
|
1761
|
+
}, 1024)) : vue.createCommentVNode("", true),
|
|
1762
|
+
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1763
|
+
key: 1,
|
|
1764
|
+
content: "点击下移,双击置底",
|
|
1765
|
+
placement: "top"
|
|
1766
|
+
}, {
|
|
1767
|
+
default: vue.withCtx(() => [
|
|
1768
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1769
|
+
plain: "",
|
|
1770
|
+
size: "small",
|
|
1771
|
+
type: "primary",
|
|
1772
|
+
icon: vue.unref(iconsVue.ArrowDown),
|
|
1773
|
+
disabled: _ctx.disabled,
|
|
1774
|
+
text: "",
|
|
1775
|
+
onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1776
|
+
onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1777
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1778
|
+
]),
|
|
1779
|
+
_: 2
|
|
1780
|
+
}, 1024)) : vue.createCommentVNode("", true)
|
|
1781
|
+
]),
|
|
1782
|
+
_: 1
|
|
1783
|
+
})) : vue.createCommentVNode("", true),
|
|
1784
|
+
selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1785
|
+
key: 2,
|
|
1786
|
+
align: "center",
|
|
1787
|
+
"header-align": "center",
|
|
1788
|
+
type: "selection",
|
|
1789
|
+
width: "45"
|
|
1790
|
+
})) : vue.createCommentVNode("", true),
|
|
1791
|
+
_ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1792
|
+
key: 3,
|
|
1793
|
+
width: "60",
|
|
1794
|
+
label: "序号"
|
|
1795
|
+
}, {
|
|
1796
|
+
default: vue.withCtx((scope) => [
|
|
1797
|
+
vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
|
|
1798
|
+
]),
|
|
1799
|
+
_: 1
|
|
1800
|
+
})) : vue.createCommentVNode("", true),
|
|
1801
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
|
|
1802
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1803
|
+
column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1804
|
+
prop: column.name,
|
|
1805
|
+
width: column.width,
|
|
1806
|
+
label: column.label,
|
|
1807
|
+
sortable: column.sortable,
|
|
1808
|
+
"sort-orders": ["ascending", "descending"],
|
|
1809
|
+
key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
1810
|
+
"class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
|
|
1811
|
+
}, {
|
|
1812
|
+
default: vue.withCtx((scope) => [
|
|
1813
|
+
scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
1814
|
+
key: 0,
|
|
1815
|
+
labelWidth: "0",
|
|
1816
|
+
disabled: _ctx.disabled,
|
|
1817
|
+
prop: getProp(scope.$index),
|
|
1818
|
+
rules: column.rules,
|
|
1819
|
+
config: makeConfig(column, scope.row),
|
|
1820
|
+
model: scope.row,
|
|
1821
|
+
lastValues: lastData.value[scope.$index],
|
|
1822
|
+
"is-compare": _ctx.isCompare,
|
|
1823
|
+
size: _ctx.size,
|
|
1824
|
+
onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
|
|
1825
|
+
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
1826
|
+
}, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
|
|
1827
|
+
]),
|
|
1828
|
+
_: 2
|
|
1829
|
+
}, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
|
|
1830
|
+
], 64);
|
|
1831
|
+
}), 256))
|
|
1832
|
+
]),
|
|
1833
|
+
_: 3
|
|
1834
|
+
}, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
|
|
1835
|
+
]),
|
|
1836
|
+
_: 3
|
|
1837
|
+
}, 8, ["disabled"]),
|
|
1838
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
1839
|
+
addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1840
|
+
key: 1,
|
|
1841
|
+
size: "small",
|
|
1842
|
+
type: "primary",
|
|
1843
|
+
disabled: _ctx.disabled,
|
|
1844
|
+
plain: "",
|
|
1845
|
+
onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
|
|
1846
|
+
}, {
|
|
1847
|
+
default: vue.withCtx(() => [
|
|
1848
|
+
vue.createTextVNode("新增一行")
|
|
1849
|
+
]),
|
|
1850
|
+
_: 1
|
|
1851
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1852
|
+
vue.createTextVNode(" "),
|
|
1853
|
+
_ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1854
|
+
key: 2,
|
|
1855
|
+
icon: vue.unref(iconsVue.Grid),
|
|
1856
|
+
size: "small",
|
|
1857
|
+
type: "primary",
|
|
1858
|
+
onClick: toggleMode
|
|
1859
|
+
}, {
|
|
1860
|
+
default: vue.withCtx(() => [
|
|
1861
|
+
vue.createTextVNode("展开配置")
|
|
1862
|
+
]),
|
|
1863
|
+
_: 1
|
|
1864
|
+
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1865
|
+
_ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1866
|
+
key: 3,
|
|
1867
|
+
icon: vue.unref(iconsVue.FullScreen),
|
|
1868
|
+
size: "small",
|
|
1869
|
+
type: "primary",
|
|
1870
|
+
onClick: toggleFullscreen
|
|
1871
|
+
}, {
|
|
1872
|
+
default: vue.withCtx(() => [
|
|
1873
|
+
vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
|
|
1874
|
+
]),
|
|
1875
|
+
_: 1
|
|
1876
|
+
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1877
|
+
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
|
|
1878
|
+
key: 4,
|
|
1879
|
+
style: { "display": "inline-block" },
|
|
1880
|
+
ref_key: "excelBtn",
|
|
1881
|
+
ref: excelBtn,
|
|
1882
|
+
action: "/noop",
|
|
1883
|
+
disabled: _ctx.disabled,
|
|
1884
|
+
"on-change": excelHandler,
|
|
1885
|
+
"auto-upload": false
|
|
1886
|
+
}, {
|
|
1887
|
+
default: vue.withCtx(() => [
|
|
1888
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1889
|
+
size: "small",
|
|
1890
|
+
type: "success",
|
|
1891
|
+
disabled: _ctx.disabled,
|
|
1892
|
+
plain: ""
|
|
1893
|
+
}, {
|
|
1894
|
+
default: vue.withCtx(() => [
|
|
1895
|
+
vue.createTextVNode("导入EXCEL")
|
|
1896
|
+
]),
|
|
1897
|
+
_: 1
|
|
1898
|
+
}, 8, ["disabled"])
|
|
1899
|
+
]),
|
|
1900
|
+
_: 1
|
|
1901
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1902
|
+
vue.createTextVNode(" "),
|
|
1903
|
+
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1904
|
+
key: 5,
|
|
1905
|
+
size: "small",
|
|
1906
|
+
type: "warning",
|
|
1907
|
+
disabled: _ctx.disabled,
|
|
1908
|
+
plain: "",
|
|
1909
|
+
onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
|
|
1910
|
+
}, {
|
|
1911
|
+
default: vue.withCtx(() => [
|
|
1912
|
+
vue.createTextVNode("清空")
|
|
1913
|
+
]),
|
|
1914
|
+
_: 1
|
|
1915
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1916
|
+
_ctx.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
1927
1917
|
vue.createVNode(vue.unref(design.TMagicPagination), {
|
|
1928
1918
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
1929
|
-
"hide-on-single-page":
|
|
1919
|
+
"hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
|
|
1930
1920
|
"current-page": pagecontext.value + 1,
|
|
1931
1921
|
"page-sizes": [pagesize.value, 60, 120, 300],
|
|
1932
1922
|
"page-size": pagesize.value,
|
|
1933
|
-
total:
|
|
1923
|
+
total: _ctx.model[modelName.value].length,
|
|
1934
1924
|
onSizeChange: handleSizeChange,
|
|
1935
1925
|
onCurrentChange: handleCurrentChange
|
|
1936
1926
|
}, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
|
|
@@ -1940,28 +1930,28 @@
|
|
|
1940
1930
|
}
|
|
1941
1931
|
});
|
|
1942
1932
|
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1933
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
1934
|
+
...{
|
|
1935
|
+
name: "MFormTabs"
|
|
1936
|
+
},
|
|
1937
|
+
__name: "Tabs",
|
|
1948
1938
|
props: {
|
|
1949
|
-
model:
|
|
1939
|
+
model: {},
|
|
1950
1940
|
lastValues: { default: () => ({}) },
|
|
1951
1941
|
isCompare: { type: Boolean, default: false },
|
|
1952
|
-
config:
|
|
1953
|
-
name:
|
|
1954
|
-
size:
|
|
1955
|
-
labelWidth:
|
|
1956
|
-
prop:
|
|
1942
|
+
config: {},
|
|
1943
|
+
name: {},
|
|
1944
|
+
size: {},
|
|
1945
|
+
labelWidth: {},
|
|
1946
|
+
prop: {},
|
|
1957
1947
|
expandMore: { type: Boolean },
|
|
1958
1948
|
disabled: { type: Boolean }
|
|
1959
1949
|
},
|
|
1960
1950
|
emits: ["change", "addDiffCount"],
|
|
1961
1951
|
setup(__props, { emit }) {
|
|
1962
1952
|
const props = __props;
|
|
1963
|
-
const tabPaneComponent = design.getConfig("components")
|
|
1964
|
-
const tabsComponent = design.getConfig("components")
|
|
1953
|
+
const tabPaneComponent = design.getConfig("components")?.tabPane;
|
|
1954
|
+
const tabsComponent = design.getConfig("components")?.tabs;
|
|
1965
1955
|
const getActive = (mForm2, props2, activeTabName2) => {
|
|
1966
1956
|
const { config, model, prop } = props2;
|
|
1967
1957
|
const { active } = config;
|
|
@@ -2057,28 +2047,31 @@
|
|
|
2057
2047
|
emit("addDiffCount");
|
|
2058
2048
|
};
|
|
2059
2049
|
return (_ctx, _cache) => {
|
|
2060
|
-
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent)
|
|
2050
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent)?.component || "el-tabs"), vue.mergeProps(
|
|
2061
2051
|
{
|
|
2062
2052
|
modelValue: activeTabName.value,
|
|
2063
2053
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event)
|
|
2064
2054
|
},
|
|
2065
|
-
vue.unref(tabsComponent)
|
|
2066
|
-
type:
|
|
2067
|
-
editable:
|
|
2068
|
-
tabPosition:
|
|
2069
|
-
}),
|
|
2055
|
+
vue.unref(tabsComponent)?.props({
|
|
2056
|
+
type: _ctx.config.tabType,
|
|
2057
|
+
editable: _ctx.config.editable || false,
|
|
2058
|
+
tabPosition: _ctx.config.tabPosition || "top"
|
|
2059
|
+
}) || {},
|
|
2070
2060
|
{
|
|
2071
|
-
class: `tmagic-design-tabs ${
|
|
2061
|
+
class: `tmagic-design-tabs ${_ctx.config.dynamic ? "magic-form-dynamic-tab" : "magic-form-tab"}`,
|
|
2072
2062
|
onTabClick: tabClickHandler,
|
|
2073
2063
|
onTabAdd,
|
|
2074
2064
|
onTabRemove
|
|
2075
2065
|
}
|
|
2076
2066
|
), {
|
|
2077
2067
|
default: vue.withCtx(() => [
|
|
2078
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
2079
|
-
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent)
|
|
2080
|
-
|
|
2081
|
-
|
|
2068
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabs.value, (tab, tabIndex) => {
|
|
2069
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent)?.component || "el-tab-pane"), vue.mergeProps(
|
|
2070
|
+
{
|
|
2071
|
+
key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex
|
|
2072
|
+
},
|
|
2073
|
+
vue.unref(tabPaneComponent)?.props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false }) || {}
|
|
2074
|
+
), {
|
|
2082
2075
|
label: vue.withCtx(() => [
|
|
2083
2076
|
vue.createElementVNode("span", null, [
|
|
2084
2077
|
vue.createTextVNode(vue.toDisplayString(filter(tab.title)), 1),
|
|
@@ -2091,17 +2084,17 @@
|
|
|
2091
2084
|
]),
|
|
2092
2085
|
default: vue.withCtx(() => [
|
|
2093
2086
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabItems(tab), (item) => {
|
|
2094
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2087
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
2095
2088
|
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
2096
2089
|
config: item,
|
|
2097
|
-
disabled:
|
|
2098
|
-
model:
|
|
2099
|
-
"last-values": vue.unref(lodashEs.isEmpty)(
|
|
2100
|
-
"is-compare":
|
|
2101
|
-
prop:
|
|
2102
|
-
size:
|
|
2103
|
-
"label-width": tab.labelWidth ||
|
|
2104
|
-
"expand-more":
|
|
2090
|
+
disabled: _ctx.disabled,
|
|
2091
|
+
model: _ctx.config.dynamic ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tabIndex] : tab.name ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tab.name] : _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
2092
|
+
"last-values": vue.unref(lodashEs.isEmpty)(_ctx.lastValues) ? {} : _ctx.config.dynamic ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tabIndex] : tab.name ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tab.name] : _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
|
|
2093
|
+
"is-compare": _ctx.isCompare,
|
|
2094
|
+
prop: _ctx.config.dynamic ? `${_ctx.prop}${_ctx.prop ? "." : ""}${String(tabIndex)}` : _ctx.prop,
|
|
2095
|
+
size: _ctx.size,
|
|
2096
|
+
"label-width": tab.labelWidth || _ctx.labelWidth,
|
|
2097
|
+
"expand-more": _ctx.expandMore,
|
|
2105
2098
|
onChange: changeHandler,
|
|
2106
2099
|
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
2107
2100
|
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
@@ -2143,21 +2136,21 @@
|
|
|
2143
2136
|
);
|
|
2144
2137
|
};
|
|
2145
2138
|
|
|
2146
|
-
const
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2139
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
2140
|
+
...{
|
|
2141
|
+
name: "MFormCascader"
|
|
2142
|
+
},
|
|
2143
|
+
__name: "Cascader",
|
|
2151
2144
|
props: {
|
|
2152
|
-
config:
|
|
2153
|
-
model:
|
|
2154
|
-
initValues:
|
|
2155
|
-
values:
|
|
2156
|
-
name:
|
|
2157
|
-
prop:
|
|
2145
|
+
config: {},
|
|
2146
|
+
model: {},
|
|
2147
|
+
initValues: {},
|
|
2148
|
+
values: {},
|
|
2149
|
+
name: {},
|
|
2150
|
+
prop: {},
|
|
2158
2151
|
disabled: { type: Boolean },
|
|
2159
|
-
size:
|
|
2160
|
-
lastValues:
|
|
2152
|
+
size: {},
|
|
2153
|
+
lastValues: {}
|
|
2161
2154
|
},
|
|
2162
2155
|
emits: ["change"],
|
|
2163
2156
|
setup(__props, { emit }) {
|
|
@@ -2213,39 +2206,39 @@
|
|
|
2213
2206
|
};
|
|
2214
2207
|
return (_ctx, _cache) => {
|
|
2215
2208
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCascader), {
|
|
2216
|
-
modelValue:
|
|
2217
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2209
|
+
modelValue: _ctx.model[_ctx.name],
|
|
2210
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2218
2211
|
ref_key: "tMagicCascader",
|
|
2219
2212
|
ref: tMagicCascader,
|
|
2220
2213
|
style: { "width": "100%" },
|
|
2221
2214
|
clearable: "",
|
|
2222
2215
|
filterable: "",
|
|
2223
|
-
size:
|
|
2224
|
-
placeholder:
|
|
2225
|
-
disabled:
|
|
2216
|
+
size: _ctx.size,
|
|
2217
|
+
placeholder: _ctx.config.placeholder,
|
|
2218
|
+
disabled: _ctx.disabled,
|
|
2226
2219
|
options: vue.unref(options),
|
|
2227
|
-
props: { multiple:
|
|
2220
|
+
props: { multiple: _ctx.config.multiple },
|
|
2228
2221
|
onChange: changeHandler
|
|
2229
2222
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "props"]);
|
|
2230
2223
|
};
|
|
2231
2224
|
}
|
|
2232
2225
|
});
|
|
2233
2226
|
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2227
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
2228
|
+
...{
|
|
2229
|
+
name: "MFormCheckbox"
|
|
2230
|
+
},
|
|
2231
|
+
__name: "Checkbox",
|
|
2239
2232
|
props: {
|
|
2240
|
-
config:
|
|
2241
|
-
model:
|
|
2242
|
-
initValues:
|
|
2243
|
-
values:
|
|
2244
|
-
name:
|
|
2245
|
-
prop:
|
|
2233
|
+
config: {},
|
|
2234
|
+
model: {},
|
|
2235
|
+
initValues: {},
|
|
2236
|
+
values: {},
|
|
2237
|
+
name: {},
|
|
2238
|
+
prop: {},
|
|
2246
2239
|
disabled: { type: Boolean },
|
|
2247
|
-
size:
|
|
2248
|
-
lastValues:
|
|
2240
|
+
size: {},
|
|
2241
|
+
lastValues: {}
|
|
2249
2242
|
},
|
|
2250
2243
|
emits: ["change"],
|
|
2251
2244
|
setup(__props, { emit }) {
|
|
@@ -2276,16 +2269,16 @@
|
|
|
2276
2269
|
};
|
|
2277
2270
|
return (_ctx, _cache) => {
|
|
2278
2271
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
|
|
2279
|
-
modelValue:
|
|
2280
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2281
|
-
size:
|
|
2282
|
-
trueLabel:
|
|
2283
|
-
falseLabel:
|
|
2284
|
-
disabled:
|
|
2272
|
+
modelValue: _ctx.model[_ctx.name],
|
|
2273
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2274
|
+
size: _ctx.size,
|
|
2275
|
+
trueLabel: activeValue.value,
|
|
2276
|
+
falseLabel: inactiveValue.value,
|
|
2277
|
+
disabled: _ctx.disabled,
|
|
2285
2278
|
onChange: changeHandler
|
|
2286
2279
|
}, {
|
|
2287
2280
|
default: vue.withCtx(() => [
|
|
2288
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
2281
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.config.text), 1)
|
|
2289
2282
|
]),
|
|
2290
2283
|
_: 1
|
|
2291
2284
|
}, 8, ["modelValue", "size", "trueLabel", "falseLabel", "disabled"]);
|
|
@@ -2293,21 +2286,21 @@
|
|
|
2293
2286
|
}
|
|
2294
2287
|
});
|
|
2295
2288
|
|
|
2296
|
-
const
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2289
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
2290
|
+
...{
|
|
2291
|
+
name: "MFormCheckGroup"
|
|
2292
|
+
},
|
|
2293
|
+
__name: "CheckboxGroup",
|
|
2301
2294
|
props: {
|
|
2302
|
-
config:
|
|
2303
|
-
model:
|
|
2304
|
-
initValues:
|
|
2305
|
-
values:
|
|
2306
|
-
name:
|
|
2307
|
-
prop:
|
|
2295
|
+
config: {},
|
|
2296
|
+
model: {},
|
|
2297
|
+
initValues: {},
|
|
2298
|
+
values: {},
|
|
2299
|
+
name: {},
|
|
2300
|
+
prop: {},
|
|
2308
2301
|
disabled: { type: Boolean },
|
|
2309
|
-
size:
|
|
2310
|
-
lastValues:
|
|
2302
|
+
size: {},
|
|
2303
|
+
lastValues: {}
|
|
2311
2304
|
},
|
|
2312
2305
|
emits: ["change"],
|
|
2313
2306
|
setup(__props, { emit }) {
|
|
@@ -2329,14 +2322,14 @@
|
|
|
2329
2322
|
});
|
|
2330
2323
|
return (_ctx, _cache) => {
|
|
2331
2324
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckboxGroup), {
|
|
2332
|
-
modelValue:
|
|
2333
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2334
|
-
size:
|
|
2335
|
-
disabled:
|
|
2325
|
+
modelValue: _ctx.model[_ctx.name],
|
|
2326
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2327
|
+
size: _ctx.size,
|
|
2328
|
+
disabled: _ctx.disabled,
|
|
2336
2329
|
onChange: changeHandler
|
|
2337
2330
|
}, {
|
|
2338
2331
|
default: vue.withCtx(() => [
|
|
2339
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
2332
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(options.value, (option) => {
|
|
2340
2333
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
|
|
2341
2334
|
label: option.value,
|
|
2342
2335
|
value: option.value,
|
|
@@ -2356,21 +2349,21 @@
|
|
|
2356
2349
|
}
|
|
2357
2350
|
});
|
|
2358
2351
|
|
|
2359
|
-
const
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2352
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
2353
|
+
...{
|
|
2354
|
+
name: "MFormColorPicker"
|
|
2355
|
+
},
|
|
2356
|
+
__name: "ColorPicker",
|
|
2364
2357
|
props: {
|
|
2365
|
-
config:
|
|
2366
|
-
model:
|
|
2367
|
-
initValues:
|
|
2368
|
-
values:
|
|
2369
|
-
name:
|
|
2370
|
-
prop:
|
|
2358
|
+
config: {},
|
|
2359
|
+
model: {},
|
|
2360
|
+
initValues: {},
|
|
2361
|
+
values: {},
|
|
2362
|
+
name: {},
|
|
2363
|
+
prop: {},
|
|
2371
2364
|
disabled: { type: Boolean },
|
|
2372
|
-
size:
|
|
2373
|
-
lastValues:
|
|
2365
|
+
size: {},
|
|
2366
|
+
lastValues: {}
|
|
2374
2367
|
},
|
|
2375
2368
|
emits: ["change"],
|
|
2376
2369
|
setup(__props, { emit }) {
|
|
@@ -2379,10 +2372,10 @@
|
|
|
2379
2372
|
const changeHandler = (value) => emit("change", value);
|
|
2380
2373
|
return (_ctx, _cache) => {
|
|
2381
2374
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicColorPicker), {
|
|
2382
|
-
modelValue:
|
|
2383
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2384
|
-
size:
|
|
2385
|
-
disabled:
|
|
2375
|
+
modelValue: _ctx.model[_ctx.name],
|
|
2376
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2377
|
+
size: _ctx.size,
|
|
2378
|
+
disabled: _ctx.disabled,
|
|
2386
2379
|
showAlpha: true,
|
|
2387
2380
|
onChange: changeHandler
|
|
2388
2381
|
}, null, 8, ["modelValue", "size", "disabled"]);
|
|
@@ -2390,21 +2383,21 @@
|
|
|
2390
2383
|
}
|
|
2391
2384
|
});
|
|
2392
2385
|
|
|
2393
|
-
const
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2386
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
2387
|
+
...{
|
|
2388
|
+
name: "MFormDate"
|
|
2389
|
+
},
|
|
2390
|
+
__name: "Date",
|
|
2398
2391
|
props: {
|
|
2399
|
-
config:
|
|
2400
|
-
model:
|
|
2401
|
-
initValues:
|
|
2402
|
-
values:
|
|
2403
|
-
name:
|
|
2404
|
-
prop:
|
|
2392
|
+
config: {},
|
|
2393
|
+
model: {},
|
|
2394
|
+
initValues: {},
|
|
2395
|
+
values: {},
|
|
2396
|
+
name: {},
|
|
2397
|
+
prop: {},
|
|
2405
2398
|
disabled: { type: Boolean },
|
|
2406
|
-
size:
|
|
2407
|
-
lastValues:
|
|
2399
|
+
size: {},
|
|
2400
|
+
lastValues: {}
|
|
2408
2401
|
},
|
|
2409
2402
|
emits: ["change"],
|
|
2410
2403
|
setup(__props, { emit }) {
|
|
@@ -2416,35 +2409,35 @@
|
|
|
2416
2409
|
};
|
|
2417
2410
|
return (_ctx, _cache) => {
|
|
2418
2411
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDatePicker), {
|
|
2419
|
-
modelValue:
|
|
2420
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2412
|
+
modelValue: _ctx.model[_ctx.name],
|
|
2413
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2421
2414
|
type: "date",
|
|
2422
|
-
size:
|
|
2423
|
-
placeholder:
|
|
2424
|
-
disabled:
|
|
2425
|
-
format:
|
|
2426
|
-
"value-format":
|
|
2415
|
+
size: _ctx.size,
|
|
2416
|
+
placeholder: _ctx.config.placeholder,
|
|
2417
|
+
disabled: _ctx.disabled,
|
|
2418
|
+
format: _ctx.config.format,
|
|
2419
|
+
"value-format": _ctx.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
|
|
2427
2420
|
onChange: changeHandler
|
|
2428
2421
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format"]);
|
|
2429
2422
|
};
|
|
2430
2423
|
}
|
|
2431
2424
|
});
|
|
2432
2425
|
|
|
2433
|
-
const
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2426
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
2427
|
+
...{
|
|
2428
|
+
name: "MFormDateRange"
|
|
2429
|
+
},
|
|
2430
|
+
__name: "Daterange",
|
|
2438
2431
|
props: {
|
|
2439
|
-
config:
|
|
2440
|
-
model:
|
|
2441
|
-
initValues:
|
|
2442
|
-
values:
|
|
2443
|
-
name:
|
|
2444
|
-
prop:
|
|
2432
|
+
config: {},
|
|
2433
|
+
model: {},
|
|
2434
|
+
initValues: {},
|
|
2435
|
+
values: {},
|
|
2436
|
+
name: {},
|
|
2437
|
+
prop: {},
|
|
2445
2438
|
disabled: { type: Boolean },
|
|
2446
|
-
size:
|
|
2447
|
-
lastValues:
|
|
2439
|
+
size: {},
|
|
2440
|
+
lastValues: {}
|
|
2448
2441
|
},
|
|
2449
2442
|
emits: ["change"],
|
|
2450
2443
|
setup(__props, { emit }) {
|
|
@@ -2522,31 +2515,31 @@
|
|
|
2522
2515
|
"range-separator": "-",
|
|
2523
2516
|
"start-placeholder": "开始日期",
|
|
2524
2517
|
"end-placeholder": "结束日期",
|
|
2525
|
-
size:
|
|
2518
|
+
size: _ctx.size,
|
|
2526
2519
|
"unlink-panels": true,
|
|
2527
|
-
disabled:
|
|
2528
|
-
"default-time":
|
|
2520
|
+
disabled: _ctx.disabled,
|
|
2521
|
+
"default-time": _ctx.config.defaultTime,
|
|
2529
2522
|
onChange: changeHandler
|
|
2530
2523
|
}, null, 8, ["modelValue", "size", "disabled", "default-time"]);
|
|
2531
2524
|
};
|
|
2532
2525
|
}
|
|
2533
2526
|
});
|
|
2534
2527
|
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2528
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
2529
|
+
...{
|
|
2530
|
+
name: "MFormDateTime"
|
|
2531
|
+
},
|
|
2532
|
+
__name: "DateTime",
|
|
2540
2533
|
props: {
|
|
2541
|
-
config:
|
|
2542
|
-
model:
|
|
2543
|
-
initValues:
|
|
2544
|
-
values:
|
|
2545
|
-
name:
|
|
2546
|
-
prop:
|
|
2534
|
+
config: {},
|
|
2535
|
+
model: {},
|
|
2536
|
+
initValues: {},
|
|
2537
|
+
values: {},
|
|
2538
|
+
name: {},
|
|
2539
|
+
prop: {},
|
|
2547
2540
|
disabled: { type: Boolean },
|
|
2548
|
-
size:
|
|
2549
|
-
lastValues:
|
|
2541
|
+
size: {},
|
|
2542
|
+
lastValues: {}
|
|
2550
2543
|
},
|
|
2551
2544
|
emits: ["change"],
|
|
2552
2545
|
setup(__props, { emit }) {
|
|
@@ -2565,36 +2558,38 @@
|
|
|
2565
2558
|
};
|
|
2566
2559
|
return (_ctx, _cache) => {
|
|
2567
2560
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDatePicker), {
|
|
2568
|
-
modelValue:
|
|
2569
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2561
|
+
modelValue: _ctx.model[_ctx.name],
|
|
2562
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2570
2563
|
"popper-class": "magic-datetime-picker-popper",
|
|
2571
2564
|
type: "datetime",
|
|
2572
|
-
size:
|
|
2573
|
-
placeholder:
|
|
2574
|
-
disabled:
|
|
2575
|
-
format:
|
|
2576
|
-
"value-format":
|
|
2577
|
-
"default-time":
|
|
2565
|
+
size: _ctx.size,
|
|
2566
|
+
placeholder: _ctx.config.placeholder,
|
|
2567
|
+
disabled: _ctx.disabled,
|
|
2568
|
+
format: _ctx.config.format || "YYYY/MM/DD HH:mm:ss",
|
|
2569
|
+
"value-format": _ctx.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
|
|
2570
|
+
"default-time": _ctx.config.defaultTime,
|
|
2578
2571
|
onChange: changeHandler
|
|
2579
2572
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "default-time"]);
|
|
2580
2573
|
};
|
|
2581
2574
|
}
|
|
2582
2575
|
});
|
|
2583
2576
|
|
|
2584
|
-
const _hoisted_1$
|
|
2585
|
-
const
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2577
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2578
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
2579
|
+
...{
|
|
2580
|
+
name: "MFormDisplay"
|
|
2581
|
+
},
|
|
2582
|
+
__name: "Display",
|
|
2590
2583
|
props: {
|
|
2591
|
-
config:
|
|
2592
|
-
model:
|
|
2593
|
-
initValues:
|
|
2594
|
-
values:
|
|
2595
|
-
name:
|
|
2596
|
-
prop:
|
|
2597
|
-
|
|
2584
|
+
config: {},
|
|
2585
|
+
model: {},
|
|
2586
|
+
initValues: {},
|
|
2587
|
+
values: {},
|
|
2588
|
+
name: {},
|
|
2589
|
+
prop: {},
|
|
2590
|
+
disabled: { type: Boolean },
|
|
2591
|
+
size: {},
|
|
2592
|
+
lastValues: {}
|
|
2598
2593
|
},
|
|
2599
2594
|
setup(__props) {
|
|
2600
2595
|
const props = __props;
|
|
@@ -2603,27 +2598,27 @@
|
|
|
2603
2598
|
}
|
|
2604
2599
|
useAddField(props.prop);
|
|
2605
2600
|
return (_ctx, _cache) => {
|
|
2606
|
-
return
|
|
2601
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$7, vue.toDisplayString(_ctx.model[_ctx.name]), 1)) : vue.createCommentVNode("", true);
|
|
2607
2602
|
};
|
|
2608
2603
|
}
|
|
2609
2604
|
});
|
|
2610
2605
|
|
|
2611
|
-
const _hoisted_1$
|
|
2612
|
-
const
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2606
|
+
const _hoisted_1$6 = { class: "m-fields-dynamic-field" };
|
|
2607
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
2608
|
+
...{
|
|
2609
|
+
name: "MFormDynamicField"
|
|
2610
|
+
},
|
|
2611
|
+
__name: "DynamicField",
|
|
2617
2612
|
props: {
|
|
2618
|
-
config:
|
|
2619
|
-
model:
|
|
2620
|
-
initValues:
|
|
2621
|
-
values:
|
|
2622
|
-
name:
|
|
2623
|
-
prop:
|
|
2613
|
+
config: {},
|
|
2614
|
+
model: {},
|
|
2615
|
+
initValues: {},
|
|
2616
|
+
values: {},
|
|
2617
|
+
name: {},
|
|
2618
|
+
prop: {},
|
|
2624
2619
|
disabled: { type: Boolean },
|
|
2625
|
-
size:
|
|
2626
|
-
lastValues:
|
|
2620
|
+
size: {},
|
|
2621
|
+
lastValues: {}
|
|
2627
2622
|
},
|
|
2628
2623
|
emits: ["change"],
|
|
2629
2624
|
setup(__props, { emit }) {
|
|
@@ -2674,7 +2669,7 @@
|
|
|
2674
2669
|
emit("change", fieldMap.value[key], key);
|
|
2675
2670
|
};
|
|
2676
2671
|
return (_ctx, _cache) => {
|
|
2677
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2672
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
2678
2673
|
vue.createVNode(vue.unref(design.TMagicForm), { size: "small" }, {
|
|
2679
2674
|
default: vue.withCtx(() => [
|
|
2680
2675
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(fieldMap.value), (key) => {
|
|
@@ -2701,40 +2696,42 @@
|
|
|
2701
2696
|
}
|
|
2702
2697
|
});
|
|
2703
2698
|
|
|
2704
|
-
const
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2699
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
2700
|
+
...{
|
|
2701
|
+
name: "MFormHidden"
|
|
2702
|
+
},
|
|
2703
|
+
__name: "Hidden",
|
|
2709
2704
|
props: {
|
|
2710
|
-
config:
|
|
2711
|
-
model:
|
|
2712
|
-
initValues:
|
|
2713
|
-
values:
|
|
2714
|
-
name:
|
|
2715
|
-
prop:
|
|
2716
|
-
|
|
2705
|
+
config: {},
|
|
2706
|
+
model: {},
|
|
2707
|
+
initValues: {},
|
|
2708
|
+
values: {},
|
|
2709
|
+
name: {},
|
|
2710
|
+
prop: {},
|
|
2711
|
+
disabled: { type: Boolean },
|
|
2712
|
+
size: {},
|
|
2713
|
+
lastValues: {}
|
|
2717
2714
|
},
|
|
2718
2715
|
setup(__props) {
|
|
2719
2716
|
const props = __props;
|
|
2720
2717
|
useAddField(props.prop);
|
|
2721
2718
|
return (_ctx, _cache) => {
|
|
2722
|
-
return
|
|
2719
|
+
return _ctx.model ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
2723
2720
|
key: 0,
|
|
2724
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2721
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2725
2722
|
type: "hidden"
|
|
2726
2723
|
}, null, 512)), [
|
|
2727
|
-
[vue.vModelText,
|
|
2724
|
+
[vue.vModelText, _ctx.model[_ctx.name]]
|
|
2728
2725
|
]) : vue.createCommentVNode("", true);
|
|
2729
2726
|
};
|
|
2730
2727
|
}
|
|
2731
2728
|
});
|
|
2732
2729
|
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2730
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
2731
|
+
...{
|
|
2732
|
+
name: "MForm"
|
|
2733
|
+
},
|
|
2734
|
+
__name: "Form",
|
|
2738
2735
|
props: {
|
|
2739
2736
|
config: { default: () => [] },
|
|
2740
2737
|
initValues: { default: () => ({}) },
|
|
@@ -2745,14 +2742,15 @@
|
|
|
2745
2742
|
disabled: { type: Boolean, default: false },
|
|
2746
2743
|
height: { default: "auto" },
|
|
2747
2744
|
stepActive: { default: 1 },
|
|
2748
|
-
size:
|
|
2745
|
+
size: {},
|
|
2749
2746
|
inline: { type: Boolean, default: false },
|
|
2750
2747
|
labelPosition: { default: "right" },
|
|
2751
2748
|
keyProp: { default: "__key" },
|
|
2752
|
-
popperClass:
|
|
2749
|
+
popperClass: {},
|
|
2750
|
+
extendState: {}
|
|
2753
2751
|
},
|
|
2754
2752
|
emits: ["change", "field-input", "field-change"],
|
|
2755
|
-
setup(__props, { expose, emit }) {
|
|
2753
|
+
setup(__props, { expose: __expose, emit }) {
|
|
2756
2754
|
const props = __props;
|
|
2757
2755
|
const tMagicForm = vue.ref();
|
|
2758
2756
|
const initialized = vue.ref(false);
|
|
@@ -2784,7 +2782,7 @@
|
|
|
2784
2782
|
}
|
|
2785
2783
|
}
|
|
2786
2784
|
});
|
|
2787
|
-
vue.watchEffect(() => {
|
|
2785
|
+
vue.watchEffect(async () => {
|
|
2788
2786
|
formState.initValues = props.initValues;
|
|
2789
2787
|
formState.lastValues = props.lastValues;
|
|
2790
2788
|
formState.isCompare = props.isCompare;
|
|
@@ -2792,6 +2790,12 @@
|
|
|
2792
2790
|
formState.keyProp = props.keyProp;
|
|
2793
2791
|
formState.popperClass = props.popperClass;
|
|
2794
2792
|
formState.parentValues = props.parentValues;
|
|
2793
|
+
if (typeof props.extendState === "function") {
|
|
2794
|
+
const state = await props.extendState(formState) || {};
|
|
2795
|
+
Object.entries(state).forEach(([key, value]) => {
|
|
2796
|
+
formState[key] = value;
|
|
2797
|
+
});
|
|
2798
|
+
}
|
|
2795
2799
|
});
|
|
2796
2800
|
vue.provide("mForm", formState);
|
|
2797
2801
|
vue.watch(
|
|
@@ -2822,7 +2826,7 @@
|
|
|
2822
2826
|
const changeHandler = () => {
|
|
2823
2827
|
emit("change", values.value);
|
|
2824
2828
|
};
|
|
2825
|
-
|
|
2829
|
+
__expose({
|
|
2826
2830
|
values,
|
|
2827
2831
|
lastValuesProcessed,
|
|
2828
2832
|
formState,
|
|
@@ -2855,23 +2859,23 @@
|
|
|
2855
2859
|
ref_key: "tMagicForm",
|
|
2856
2860
|
ref: tMagicForm,
|
|
2857
2861
|
model: values.value,
|
|
2858
|
-
"label-width":
|
|
2859
|
-
style: vue.normalizeStyle(`height: ${
|
|
2860
|
-
inline:
|
|
2861
|
-
"label-position":
|
|
2862
|
+
"label-width": _ctx.labelWidth,
|
|
2863
|
+
style: vue.normalizeStyle(`height: ${_ctx.height}`),
|
|
2864
|
+
inline: _ctx.inline,
|
|
2865
|
+
"label-position": _ctx.labelPosition
|
|
2862
2866
|
}, {
|
|
2863
2867
|
default: vue.withCtx(() => [
|
|
2864
|
-
initialized.value && Array.isArray(
|
|
2865
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2866
|
-
disabled:
|
|
2867
|
-
key: item[
|
|
2868
|
+
initialized.value && Array.isArray(_ctx.config) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.config, (item, index) => {
|
|
2869
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
2870
|
+
disabled: _ctx.disabled,
|
|
2871
|
+
key: item[_ctx.keyProp] ?? index,
|
|
2868
2872
|
config: item,
|
|
2869
2873
|
model: values.value,
|
|
2870
2874
|
"last-values": lastValuesProcessed.value,
|
|
2871
|
-
"is-compare":
|
|
2872
|
-
"label-width": item.labelWidth ||
|
|
2873
|
-
"step-active":
|
|
2874
|
-
size:
|
|
2875
|
+
"is-compare": _ctx.isCompare,
|
|
2876
|
+
"label-width": item.labelWidth || _ctx.labelWidth,
|
|
2877
|
+
"step-active": _ctx.stepActive,
|
|
2878
|
+
size: _ctx.size,
|
|
2875
2879
|
onChange: changeHandler
|
|
2876
2880
|
}, null, 8, ["disabled", "config", "model", "last-values", "is-compare", "label-width", "step-active", "size"]);
|
|
2877
2881
|
}), 128)) : vue.createCommentVNode("", true)
|
|
@@ -2882,30 +2886,27 @@
|
|
|
2882
2886
|
}
|
|
2883
2887
|
});
|
|
2884
2888
|
|
|
2885
|
-
const _hoisted_1$
|
|
2886
|
-
const
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
});
|
|
2892
|
-
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
2893
|
-
...__default__$a,
|
|
2889
|
+
const _hoisted_1$5 = { style: { "min-height": "1px" } };
|
|
2890
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
2891
|
+
...{
|
|
2892
|
+
name: "MFormDialog"
|
|
2893
|
+
},
|
|
2894
|
+
__name: "FormDialog",
|
|
2894
2895
|
props: {
|
|
2895
2896
|
config: { default: () => [] },
|
|
2896
2897
|
values: { default: () => ({}) },
|
|
2897
|
-
parentValues:
|
|
2898
|
-
width:
|
|
2899
|
-
labelWidth:
|
|
2898
|
+
parentValues: {},
|
|
2899
|
+
width: {},
|
|
2900
|
+
labelWidth: {},
|
|
2900
2901
|
fullscreen: { type: Boolean },
|
|
2901
2902
|
disabled: { type: Boolean },
|
|
2902
|
-
title:
|
|
2903
|
-
zIndex:
|
|
2904
|
-
size:
|
|
2903
|
+
title: {},
|
|
2904
|
+
zIndex: {},
|
|
2905
|
+
size: {},
|
|
2905
2906
|
confirmText: { default: "确定" }
|
|
2906
2907
|
},
|
|
2907
2908
|
emits: ["close", "submit", "error", "change"],
|
|
2908
|
-
setup(__props, { expose, emit }) {
|
|
2909
|
+
setup(__props, { expose: __expose, emit }) {
|
|
2909
2910
|
const props = __props;
|
|
2910
2911
|
const form = vue.ref();
|
|
2911
2912
|
const dialogVisible = vue.ref(false);
|
|
@@ -2930,9 +2931,6 @@
|
|
|
2930
2931
|
}
|
|
2931
2932
|
return false;
|
|
2932
2933
|
});
|
|
2933
|
-
const cancel = () => {
|
|
2934
|
-
dialogVisible.value = false;
|
|
2935
|
-
};
|
|
2936
2934
|
const closeHandler = () => {
|
|
2937
2935
|
stepActive.value = 1;
|
|
2938
2936
|
emit("close");
|
|
@@ -2954,12 +2952,23 @@
|
|
|
2954
2952
|
const changeHandler = (value) => {
|
|
2955
2953
|
emit("change", value);
|
|
2956
2954
|
};
|
|
2957
|
-
|
|
2955
|
+
const show = () => {
|
|
2956
|
+
dialogVisible.value = true;
|
|
2957
|
+
};
|
|
2958
|
+
const hide = () => {
|
|
2959
|
+
dialogVisible.value = false;
|
|
2960
|
+
};
|
|
2961
|
+
const cancel = () => {
|
|
2962
|
+
hide();
|
|
2963
|
+
};
|
|
2964
|
+
__expose({
|
|
2958
2965
|
form,
|
|
2959
2966
|
saveFetch,
|
|
2960
2967
|
dialogVisible,
|
|
2961
2968
|
cancel,
|
|
2962
|
-
save
|
|
2969
|
+
save,
|
|
2970
|
+
show,
|
|
2971
|
+
hide
|
|
2963
2972
|
});
|
|
2964
2973
|
return (_ctx, _cache) => {
|
|
2965
2974
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDialog), {
|
|
@@ -2968,10 +2977,10 @@
|
|
|
2968
2977
|
class: "m-form-dialog",
|
|
2969
2978
|
top: "20px",
|
|
2970
2979
|
"append-to-body": "",
|
|
2971
|
-
title:
|
|
2972
|
-
width:
|
|
2973
|
-
zIndex:
|
|
2974
|
-
fullscreen:
|
|
2980
|
+
title: _ctx.title,
|
|
2981
|
+
width: _ctx.width,
|
|
2982
|
+
zIndex: _ctx.zIndex,
|
|
2983
|
+
fullscreen: _ctx.fullscreen,
|
|
2975
2984
|
"close-on-click-modal": false,
|
|
2976
2985
|
onClose: closeHandler
|
|
2977
2986
|
}, {
|
|
@@ -2983,7 +2992,7 @@
|
|
|
2983
2992
|
style: { "text-align": "left" }
|
|
2984
2993
|
}, {
|
|
2985
2994
|
default: vue.withCtx(() => [
|
|
2986
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
2995
|
+
vue.createElementVNode("div", _hoisted_1$5, [
|
|
2987
2996
|
vue.renderSlot(_ctx.$slots, "left")
|
|
2988
2997
|
])
|
|
2989
2998
|
]),
|
|
@@ -2997,43 +3006,44 @@
|
|
|
2997
3006
|
size: "small"
|
|
2998
3007
|
}, {
|
|
2999
3008
|
default: vue.withCtx(() => [
|
|
3000
|
-
|
|
3009
|
+
vue.createTextVNode("取 消")
|
|
3001
3010
|
]),
|
|
3002
3011
|
_: 1
|
|
3003
3012
|
}),
|
|
3004
|
-
|
|
3013
|
+
hasStep.value && stepActive.value > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3005
3014
|
key: 0,
|
|
3006
3015
|
type: "info",
|
|
3007
3016
|
size: "small",
|
|
3008
3017
|
onClick: preStep
|
|
3009
3018
|
}, {
|
|
3010
3019
|
default: vue.withCtx(() => [
|
|
3011
|
-
|
|
3020
|
+
vue.createTextVNode("上一步")
|
|
3012
3021
|
]),
|
|
3013
3022
|
_: 1
|
|
3014
3023
|
})) : vue.createCommentVNode("", true),
|
|
3015
|
-
|
|
3024
|
+
hasStep.value && stepCount.value > stepActive.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3016
3025
|
key: 1,
|
|
3017
3026
|
type: "info",
|
|
3018
3027
|
size: "small",
|
|
3019
3028
|
onClick: nextStep
|
|
3020
3029
|
}, {
|
|
3021
3030
|
default: vue.withCtx(() => [
|
|
3022
|
-
|
|
3031
|
+
vue.createTextVNode("下一步")
|
|
3023
3032
|
]),
|
|
3024
3033
|
_: 1
|
|
3025
3034
|
})) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3026
3035
|
key: 2,
|
|
3027
3036
|
type: "primary",
|
|
3028
3037
|
size: "small",
|
|
3038
|
+
disabled: _ctx.disabled,
|
|
3029
3039
|
loading: saveFetch.value,
|
|
3030
3040
|
onClick: save
|
|
3031
3041
|
}, {
|
|
3032
3042
|
default: vue.withCtx(() => [
|
|
3033
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
3043
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
|
|
3034
3044
|
]),
|
|
3035
3045
|
_: 1
|
|
3036
|
-
}, 8, ["loading"]))
|
|
3046
|
+
}, 8, ["disabled", "loading"]))
|
|
3037
3047
|
])
|
|
3038
3048
|
]),
|
|
3039
3049
|
_: 3
|
|
@@ -3048,17 +3058,17 @@
|
|
|
3048
3058
|
class: "m-dialog-body",
|
|
3049
3059
|
style: vue.normalizeStyle(`max-height: ${bodyHeight.value}; overflow-y: auto; overflow-x: hidden;`)
|
|
3050
3060
|
}, [
|
|
3051
|
-
vue.createVNode(_sfc_main$
|
|
3061
|
+
vue.createVNode(_sfc_main$d, {
|
|
3052
3062
|
modelValue: stepActive.value,
|
|
3053
3063
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => stepActive.value = $event),
|
|
3054
3064
|
ref_key: "form",
|
|
3055
3065
|
ref: form,
|
|
3056
|
-
size:
|
|
3057
|
-
disabled:
|
|
3058
|
-
config:
|
|
3059
|
-
"init-values":
|
|
3060
|
-
"parent-values":
|
|
3061
|
-
"label-width":
|
|
3066
|
+
size: _ctx.size,
|
|
3067
|
+
disabled: _ctx.disabled,
|
|
3068
|
+
config: _ctx.config,
|
|
3069
|
+
"init-values": _ctx.values,
|
|
3070
|
+
"parent-values": _ctx.parentValues,
|
|
3071
|
+
"label-width": _ctx.labelWidth,
|
|
3062
3072
|
onChange: changeHandler
|
|
3063
3073
|
}, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width"]),
|
|
3064
3074
|
vue.renderSlot(_ctx.$slots, "default")
|
|
@@ -3070,27 +3080,26 @@
|
|
|
3070
3080
|
}
|
|
3071
3081
|
});
|
|
3072
3082
|
|
|
3073
|
-
const _hoisted_1$
|
|
3074
|
-
const _hoisted_2 = {
|
|
3083
|
+
const _hoisted_1$4 = ["href"];
|
|
3084
|
+
const _hoisted_2$1 = {
|
|
3075
3085
|
key: 2,
|
|
3076
3086
|
class: "m-fields-link"
|
|
3077
3087
|
};
|
|
3078
|
-
const
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
...__default__$9,
|
|
3088
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
3089
|
+
...{
|
|
3090
|
+
name: "MFormLink"
|
|
3091
|
+
},
|
|
3092
|
+
__name: "Link",
|
|
3084
3093
|
props: {
|
|
3085
|
-
config:
|
|
3086
|
-
model:
|
|
3087
|
-
initValues:
|
|
3088
|
-
values:
|
|
3089
|
-
name:
|
|
3090
|
-
prop:
|
|
3094
|
+
config: {},
|
|
3095
|
+
model: {},
|
|
3096
|
+
initValues: {},
|
|
3097
|
+
values: {},
|
|
3098
|
+
name: {},
|
|
3099
|
+
prop: {},
|
|
3091
3100
|
disabled: { type: Boolean },
|
|
3092
|
-
size:
|
|
3093
|
-
lastValues:
|
|
3101
|
+
size: {},
|
|
3102
|
+
lastValues: {}
|
|
3094
3103
|
},
|
|
3095
3104
|
emits: ["change"],
|
|
3096
3105
|
setup(__props, { emit }) {
|
|
@@ -3139,34 +3148,34 @@
|
|
|
3139
3148
|
editor.value && (editor.value.dialogVisible = false);
|
|
3140
3149
|
};
|
|
3141
3150
|
return (_ctx, _cache) => {
|
|
3142
|
-
return
|
|
3151
|
+
return _ctx.config.href && !_ctx.disabled ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
3143
3152
|
key: 0,
|
|
3144
3153
|
target: "_blank",
|
|
3145
|
-
href:
|
|
3146
|
-
style: vue.normalizeStyle(
|
|
3147
|
-
}, vue.toDisplayString(
|
|
3154
|
+
href: href.value,
|
|
3155
|
+
style: vue.normalizeStyle(_ctx.config.css || {})
|
|
3156
|
+
}, vue.toDisplayString(displayText.value), 13, _hoisted_1$4)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3148
3157
|
key: 1,
|
|
3149
|
-
style: vue.normalizeStyle(
|
|
3150
|
-
}, vue.toDisplayString(
|
|
3158
|
+
style: vue.normalizeStyle(_ctx.config.disabledCss || {})
|
|
3159
|
+
}, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
|
|
3151
3160
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3152
3161
|
text: true,
|
|
3153
3162
|
type: "primary",
|
|
3154
3163
|
onClick: editHandler
|
|
3155
3164
|
}, {
|
|
3156
3165
|
default: vue.withCtx(() => [
|
|
3157
|
-
|
|
3166
|
+
vue.createTextVNode("点击编辑")
|
|
3158
3167
|
]),
|
|
3159
3168
|
_: 1
|
|
3160
3169
|
}),
|
|
3161
|
-
vue.createVNode(_sfc_main$
|
|
3170
|
+
vue.createVNode(_sfc_main$c, {
|
|
3162
3171
|
ref_key: "editor",
|
|
3163
3172
|
ref: editor,
|
|
3164
|
-
title:
|
|
3165
|
-
width:
|
|
3173
|
+
title: _ctx.config.formTitle || "编辑扩展配置",
|
|
3174
|
+
width: _ctx.config.formWidth,
|
|
3166
3175
|
values: formValue.value,
|
|
3167
|
-
config:
|
|
3168
|
-
parentValues:
|
|
3169
|
-
fullscreen:
|
|
3176
|
+
config: formConfig.value,
|
|
3177
|
+
parentValues: _ctx.values,
|
|
3178
|
+
fullscreen: _ctx.config.fullscreen,
|
|
3170
3179
|
onSubmit: action
|
|
3171
3180
|
}, null, 8, ["title", "width", "values", "config", "parentValues", "fullscreen"])
|
|
3172
3181
|
]));
|
|
@@ -3174,21 +3183,21 @@
|
|
|
3174
3183
|
}
|
|
3175
3184
|
});
|
|
3176
3185
|
|
|
3177
|
-
const
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3186
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
3187
|
+
...{
|
|
3188
|
+
name: "MFormNumber"
|
|
3189
|
+
},
|
|
3190
|
+
__name: "Number",
|
|
3182
3191
|
props: {
|
|
3183
|
-
config:
|
|
3184
|
-
model:
|
|
3185
|
-
initValues:
|
|
3186
|
-
values:
|
|
3187
|
-
name:
|
|
3188
|
-
prop:
|
|
3192
|
+
config: {},
|
|
3193
|
+
model: {},
|
|
3194
|
+
initValues: {},
|
|
3195
|
+
values: {},
|
|
3196
|
+
name: {},
|
|
3197
|
+
prop: {},
|
|
3189
3198
|
disabled: { type: Boolean },
|
|
3190
|
-
size:
|
|
3191
|
-
lastValues:
|
|
3199
|
+
size: {},
|
|
3200
|
+
lastValues: {}
|
|
3192
3201
|
},
|
|
3193
3202
|
emits: ["change", "input"],
|
|
3194
3203
|
setup(__props, { emit }) {
|
|
@@ -3203,18 +3212,18 @@
|
|
|
3203
3212
|
mForm?.$emit("field-input", props.prop, v);
|
|
3204
3213
|
};
|
|
3205
3214
|
return (_ctx, _cache) => {
|
|
3206
|
-
return
|
|
3215
|
+
return _ctx.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInputNumber), {
|
|
3207
3216
|
key: 0,
|
|
3208
|
-
modelValue:
|
|
3209
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
3217
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3218
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3210
3219
|
clearable: "",
|
|
3211
3220
|
"controls-position": "right",
|
|
3212
|
-
size:
|
|
3213
|
-
max:
|
|
3214
|
-
min:
|
|
3215
|
-
step:
|
|
3216
|
-
placeholder:
|
|
3217
|
-
disabled:
|
|
3221
|
+
size: _ctx.size,
|
|
3222
|
+
max: _ctx.config.max,
|
|
3223
|
+
min: _ctx.config.min,
|
|
3224
|
+
step: _ctx.config.step,
|
|
3225
|
+
placeholder: _ctx.config.placeholder,
|
|
3226
|
+
disabled: _ctx.disabled,
|
|
3218
3227
|
onChange: changeHandler,
|
|
3219
3228
|
onInput: inputHandler
|
|
3220
3229
|
}, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled"])) : vue.createCommentVNode("", true);
|
|
@@ -3222,21 +3231,76 @@
|
|
|
3222
3231
|
}
|
|
3223
3232
|
});
|
|
3224
3233
|
|
|
3225
|
-
const
|
|
3226
|
-
|
|
3234
|
+
const _hoisted_1$3 = { class: "m-fields-number-range" };
|
|
3235
|
+
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("span", { class: "split-tag" }, "-", -1);
|
|
3236
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
3237
|
+
...{
|
|
3238
|
+
name: "MFormNumberRange"
|
|
3239
|
+
},
|
|
3240
|
+
__name: "NumberRange",
|
|
3241
|
+
props: {
|
|
3242
|
+
config: {},
|
|
3243
|
+
model: {},
|
|
3244
|
+
initValues: {},
|
|
3245
|
+
values: {},
|
|
3246
|
+
name: {},
|
|
3247
|
+
prop: {},
|
|
3248
|
+
disabled: { type: Boolean },
|
|
3249
|
+
size: {},
|
|
3250
|
+
lastValues: {}
|
|
3251
|
+
},
|
|
3252
|
+
emits: ["change"],
|
|
3253
|
+
setup(__props, { emit }) {
|
|
3254
|
+
const props = __props;
|
|
3255
|
+
useAddField(props.prop);
|
|
3256
|
+
if (!Array.isArray(props.model[props.name])) {
|
|
3257
|
+
props.model[props.name] = [];
|
|
3258
|
+
}
|
|
3259
|
+
const minChangeHandler = (v) => {
|
|
3260
|
+
emit("change", [Number(v), props.model[props.name][1]]);
|
|
3261
|
+
};
|
|
3262
|
+
const maxChangeHandler = (v) => {
|
|
3263
|
+
emit("change", [props.model[props.name][0], Number(v)]);
|
|
3264
|
+
};
|
|
3265
|
+
return (_ctx, _cache) => {
|
|
3266
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
3267
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3268
|
+
modelValue: _ctx.model[_ctx.name][0],
|
|
3269
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name][0] = $event),
|
|
3270
|
+
clearable: "",
|
|
3271
|
+
size: _ctx.size,
|
|
3272
|
+
disabled: _ctx.disabled,
|
|
3273
|
+
onChange: minChangeHandler
|
|
3274
|
+
}, null, 8, ["modelValue", "size", "disabled"]),
|
|
3275
|
+
_hoisted_2,
|
|
3276
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3277
|
+
modelValue: _ctx.model[_ctx.name][1],
|
|
3278
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
|
|
3279
|
+
clearable: "",
|
|
3280
|
+
size: _ctx.size,
|
|
3281
|
+
disabled: _ctx.disabled,
|
|
3282
|
+
onChange: maxChangeHandler
|
|
3283
|
+
}, null, 8, ["modelValue", "size", "disabled"])
|
|
3284
|
+
]);
|
|
3285
|
+
};
|
|
3286
|
+
}
|
|
3227
3287
|
});
|
|
3228
|
-
|
|
3229
|
-
|
|
3288
|
+
|
|
3289
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
3290
|
+
...{
|
|
3291
|
+
name: "MFormRadioGroup"
|
|
3292
|
+
},
|
|
3293
|
+
__name: "RadioGroup",
|
|
3230
3294
|
props: {
|
|
3231
|
-
config:
|
|
3232
|
-
model:
|
|
3233
|
-
initValues:
|
|
3234
|
-
values:
|
|
3235
|
-
name:
|
|
3236
|
-
prop:
|
|
3295
|
+
config: {},
|
|
3296
|
+
model: {},
|
|
3297
|
+
initValues: {},
|
|
3298
|
+
values: {},
|
|
3299
|
+
name: {},
|
|
3300
|
+
prop: {},
|
|
3237
3301
|
disabled: { type: Boolean },
|
|
3238
|
-
size:
|
|
3239
|
-
lastValues:
|
|
3302
|
+
size: {},
|
|
3303
|
+
lastValues: {}
|
|
3240
3304
|
},
|
|
3241
3305
|
emits: ["change"],
|
|
3242
3306
|
setup(__props, { emit }) {
|
|
@@ -3246,16 +3310,16 @@
|
|
|
3246
3310
|
};
|
|
3247
3311
|
useAddField(props.prop);
|
|
3248
3312
|
return (_ctx, _cache) => {
|
|
3249
|
-
return
|
|
3313
|
+
return _ctx.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadioGroup), {
|
|
3250
3314
|
key: 0,
|
|
3251
|
-
modelValue:
|
|
3252
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
3253
|
-
size:
|
|
3254
|
-
disabled:
|
|
3315
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3316
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3317
|
+
size: _ctx.size,
|
|
3318
|
+
disabled: _ctx.disabled,
|
|
3255
3319
|
onChange: changeHandler
|
|
3256
3320
|
}, {
|
|
3257
3321
|
default: vue.withCtx(() => [
|
|
3258
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
3322
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.options, (option) => {
|
|
3259
3323
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadio), {
|
|
3260
3324
|
label: option.value,
|
|
3261
3325
|
value: option.value,
|
|
@@ -3274,18 +3338,18 @@
|
|
|
3274
3338
|
}
|
|
3275
3339
|
});
|
|
3276
3340
|
|
|
3277
|
-
const
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3341
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
3342
|
+
...{
|
|
3343
|
+
name: "MFormSelectOptionGroups"
|
|
3344
|
+
},
|
|
3345
|
+
__name: "SelectOptionGroups",
|
|
3282
3346
|
props: {
|
|
3283
|
-
options:
|
|
3347
|
+
options: {}
|
|
3284
3348
|
},
|
|
3285
3349
|
setup(__props) {
|
|
3286
|
-
const uiComponent = design.getConfig("components").option;
|
|
3350
|
+
const uiComponent = design.getConfig("components")?.option.component || "el-option";
|
|
3287
3351
|
return (_ctx, _cache) => {
|
|
3288
|
-
return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
3352
|
+
return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (group, index) => {
|
|
3289
3353
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicOptionGroup), {
|
|
3290
3354
|
key: index,
|
|
3291
3355
|
label: group.label,
|
|
@@ -3293,7 +3357,7 @@
|
|
|
3293
3357
|
}, {
|
|
3294
3358
|
default: vue.withCtx(() => [
|
|
3295
3359
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group.options, (item, index2) => {
|
|
3296
|
-
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent)
|
|
3360
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent)), {
|
|
3297
3361
|
key: index2,
|
|
3298
3362
|
label: item.label || item.text,
|
|
3299
3363
|
value: item.value,
|
|
@@ -3308,22 +3372,22 @@
|
|
|
3308
3372
|
}
|
|
3309
3373
|
});
|
|
3310
3374
|
|
|
3311
|
-
const
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3375
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
3376
|
+
...{
|
|
3377
|
+
name: "MFormSelectOptions"
|
|
3378
|
+
},
|
|
3379
|
+
__name: "SelectOptions",
|
|
3316
3380
|
props: {
|
|
3317
|
-
options:
|
|
3318
|
-
valueKey:
|
|
3381
|
+
options: {},
|
|
3382
|
+
valueKey: {}
|
|
3319
3383
|
},
|
|
3320
3384
|
setup(__props) {
|
|
3321
3385
|
return (_ctx, _cache) => {
|
|
3322
|
-
return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
3386
|
+
return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (option) => {
|
|
3323
3387
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicOption), {
|
|
3324
3388
|
label: option.text,
|
|
3325
3389
|
value: option.value,
|
|
3326
|
-
key:
|
|
3390
|
+
key: _ctx.valueKey ? option.value[_ctx.valueKey] : option.value,
|
|
3327
3391
|
disabled: option.disabled
|
|
3328
3392
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3329
3393
|
}), 128);
|
|
@@ -3331,22 +3395,22 @@
|
|
|
3331
3395
|
}
|
|
3332
3396
|
});
|
|
3333
3397
|
|
|
3334
|
-
const _hoisted_1$
|
|
3335
|
-
const
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3398
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3399
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
3400
|
+
...{
|
|
3401
|
+
name: "MFormSelect"
|
|
3402
|
+
},
|
|
3403
|
+
__name: "Select",
|
|
3340
3404
|
props: {
|
|
3341
|
-
config:
|
|
3342
|
-
model:
|
|
3343
|
-
initValues:
|
|
3344
|
-
values:
|
|
3345
|
-
name:
|
|
3346
|
-
prop:
|
|
3405
|
+
config: {},
|
|
3406
|
+
model: {},
|
|
3407
|
+
initValues: {},
|
|
3408
|
+
values: {},
|
|
3409
|
+
name: {},
|
|
3410
|
+
prop: {},
|
|
3347
3411
|
disabled: { type: Boolean },
|
|
3348
|
-
size:
|
|
3349
|
-
lastValues:
|
|
3412
|
+
size: {},
|
|
3413
|
+
lastValues: {}
|
|
3350
3414
|
},
|
|
3351
3415
|
emits: ["change"],
|
|
3352
3416
|
setup(__props, { emit }) {
|
|
@@ -3374,12 +3438,16 @@
|
|
|
3374
3438
|
return value === v;
|
|
3375
3439
|
};
|
|
3376
3440
|
const mapOptions = (data) => {
|
|
3377
|
-
const {
|
|
3378
|
-
|
|
3379
|
-
|
|
3441
|
+
const {
|
|
3442
|
+
option = {
|
|
3443
|
+
text: "text",
|
|
3444
|
+
value: "value"
|
|
3445
|
+
}
|
|
3446
|
+
} = props.config;
|
|
3447
|
+
const { text = "text", value = "value" } = option;
|
|
3380
3448
|
return data.map((item) => ({
|
|
3381
|
-
text: typeof text === "function" ? text(item) : item[text
|
|
3382
|
-
value: typeof value === "function" ? value(item) : item[value
|
|
3449
|
+
text: typeof text === "function" ? text(item) : item[text],
|
|
3450
|
+
value: typeof value === "function" ? value(item) : item[value]
|
|
3383
3451
|
}));
|
|
3384
3452
|
};
|
|
3385
3453
|
const getOptions = async () => {
|
|
@@ -3390,8 +3458,9 @@
|
|
|
3390
3458
|
}
|
|
3391
3459
|
loading.value = true;
|
|
3392
3460
|
let items = [];
|
|
3393
|
-
const {
|
|
3394
|
-
|
|
3461
|
+
const { option } = props.config;
|
|
3462
|
+
if (!option)
|
|
3463
|
+
return [];
|
|
3395
3464
|
const { root = "", totalKey = "total" } = option;
|
|
3396
3465
|
let { body = {}, url } = option;
|
|
3397
3466
|
if (typeof url === "function") {
|
|
@@ -3438,11 +3507,8 @@
|
|
|
3438
3507
|
postOptions
|
|
3439
3508
|
});
|
|
3440
3509
|
}
|
|
3441
|
-
const optionsData =
|
|
3442
|
-
const resTotal = globalThis.parseInt(
|
|
3443
|
-
totalKey.split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res),
|
|
3444
|
-
10
|
|
3445
|
-
);
|
|
3510
|
+
const optionsData = utils.getValueByKeyPath(root, res);
|
|
3511
|
+
const resTotal = globalThis.parseInt(utils.getValueByKeyPath(totalKey, res), 10);
|
|
3446
3512
|
if (resTotal > 0) {
|
|
3447
3513
|
total.value = resTotal;
|
|
3448
3514
|
}
|
|
@@ -3491,8 +3557,9 @@
|
|
|
3491
3557
|
const getInitOption = async () => {
|
|
3492
3558
|
if (!props.model)
|
|
3493
3559
|
return [];
|
|
3494
|
-
const {
|
|
3495
|
-
|
|
3560
|
+
const { option } = props.config;
|
|
3561
|
+
if (!option)
|
|
3562
|
+
return [];
|
|
3496
3563
|
const { root = "", initRoot = "" } = option;
|
|
3497
3564
|
let { initBody = {} } = option;
|
|
3498
3565
|
let options2 = [];
|
|
@@ -3542,7 +3609,7 @@
|
|
|
3542
3609
|
postOptions
|
|
3543
3610
|
});
|
|
3544
3611
|
}
|
|
3545
|
-
let initData = (initRoot || root
|
|
3612
|
+
let initData = utils.getValueByKeyPath(initRoot || root, res);
|
|
3546
3613
|
if (initData) {
|
|
3547
3614
|
if (!Array.isArray(initData)) {
|
|
3548
3615
|
initData = [initData];
|
|
@@ -3647,36 +3714,36 @@
|
|
|
3647
3714
|
const groupOptions = options;
|
|
3648
3715
|
return (_ctx, _cache) => {
|
|
3649
3716
|
const _directive_loading = vue.resolveDirective("loading");
|
|
3650
|
-
return
|
|
3717
|
+
return _ctx.model ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicSelect), {
|
|
3651
3718
|
key: 0,
|
|
3652
|
-
modelValue:
|
|
3653
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
3719
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3720
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3654
3721
|
class: "m-select",
|
|
3655
3722
|
ref_key: "tMagicSelect",
|
|
3656
3723
|
ref: tMagicSelect,
|
|
3657
|
-
clearable: typeof
|
|
3658
|
-
filterable: typeof
|
|
3724
|
+
clearable: typeof _ctx.config.clearable !== "undefined" ? _ctx.config.clearable : true,
|
|
3725
|
+
filterable: typeof _ctx.config.filterable !== "undefined" ? _ctx.config.filterable : true,
|
|
3659
3726
|
"popper-class": `m-select-popper ${vue.unref(popperClass)}`,
|
|
3660
|
-
size:
|
|
3727
|
+
size: _ctx.size,
|
|
3661
3728
|
remote: remote.value,
|
|
3662
|
-
placeholder:
|
|
3663
|
-
multiple:
|
|
3664
|
-
"value-key":
|
|
3665
|
-
"allow-create":
|
|
3666
|
-
disabled:
|
|
3667
|
-
"remote-method":
|
|
3729
|
+
placeholder: _ctx.config.placeholder,
|
|
3730
|
+
multiple: _ctx.config.multiple,
|
|
3731
|
+
"value-key": _ctx.config.valueKey || "value",
|
|
3732
|
+
"allow-create": _ctx.config.allowCreate,
|
|
3733
|
+
disabled: _ctx.disabled,
|
|
3734
|
+
"remote-method": _ctx.config.remote && remoteMethod,
|
|
3668
3735
|
onChange: changeHandler,
|
|
3669
3736
|
onVisibleChange: visibleHandler
|
|
3670
3737
|
}, {
|
|
3671
3738
|
default: vue.withCtx(() => [
|
|
3672
|
-
|
|
3739
|
+
_ctx.config.group ? (vue.openBlock(), vue.createBlock(_sfc_main$7, {
|
|
3673
3740
|
key: 0,
|
|
3674
3741
|
options: vue.unref(groupOptions)
|
|
3675
|
-
}, null, 8, ["options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3742
|
+
}, null, 8, ["options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$6, {
|
|
3676
3743
|
key: 1,
|
|
3677
3744
|
options: vue.unref(itemOptions)
|
|
3678
3745
|
}, null, 8, ["options"])),
|
|
3679
|
-
moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3746
|
+
moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3680
3747
|
[_directive_loading, true]
|
|
3681
3748
|
]) : vue.createCommentVNode("", true)
|
|
3682
3749
|
]),
|
|
@@ -3688,21 +3755,21 @@
|
|
|
3688
3755
|
}
|
|
3689
3756
|
});
|
|
3690
3757
|
|
|
3691
|
-
const
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3758
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
3759
|
+
...{
|
|
3760
|
+
name: "MFormSwitch"
|
|
3761
|
+
},
|
|
3762
|
+
__name: "Switch",
|
|
3696
3763
|
props: {
|
|
3697
|
-
config:
|
|
3698
|
-
model:
|
|
3699
|
-
initValues:
|
|
3700
|
-
values:
|
|
3701
|
-
name:
|
|
3702
|
-
prop:
|
|
3764
|
+
config: {},
|
|
3765
|
+
model: {},
|
|
3766
|
+
initValues: {},
|
|
3767
|
+
values: {},
|
|
3768
|
+
name: {},
|
|
3769
|
+
prop: {},
|
|
3703
3770
|
disabled: { type: Boolean },
|
|
3704
|
-
size:
|
|
3705
|
-
lastValues:
|
|
3771
|
+
size: {},
|
|
3772
|
+
lastValues: {}
|
|
3706
3773
|
},
|
|
3707
3774
|
emits: ["change"],
|
|
3708
3775
|
setup(__props, { emit }) {
|
|
@@ -3733,34 +3800,34 @@
|
|
|
3733
3800
|
});
|
|
3734
3801
|
return (_ctx, _cache) => {
|
|
3735
3802
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicSwitch), {
|
|
3736
|
-
modelValue:
|
|
3737
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
3738
|
-
size:
|
|
3739
|
-
activeValue:
|
|
3740
|
-
inactiveValue:
|
|
3741
|
-
disabled:
|
|
3803
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3804
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3805
|
+
size: _ctx.size,
|
|
3806
|
+
activeValue: activeValue.value,
|
|
3807
|
+
inactiveValue: inactiveValue.value,
|
|
3808
|
+
disabled: _ctx.disabled,
|
|
3742
3809
|
onChange: changeHandler
|
|
3743
3810
|
}, null, 8, ["modelValue", "size", "activeValue", "inactiveValue", "disabled"]);
|
|
3744
3811
|
};
|
|
3745
3812
|
}
|
|
3746
3813
|
});
|
|
3747
3814
|
|
|
3748
|
-
const _hoisted_1 = { key: 0 };
|
|
3749
|
-
const
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3815
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3816
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
3817
|
+
...{
|
|
3818
|
+
name: "MFormText"
|
|
3819
|
+
},
|
|
3820
|
+
__name: "Text",
|
|
3754
3821
|
props: {
|
|
3755
|
-
config:
|
|
3756
|
-
model:
|
|
3757
|
-
initValues:
|
|
3758
|
-
values:
|
|
3759
|
-
name:
|
|
3760
|
-
prop:
|
|
3822
|
+
config: {},
|
|
3823
|
+
model: {},
|
|
3824
|
+
initValues: {},
|
|
3825
|
+
values: {},
|
|
3826
|
+
name: {},
|
|
3827
|
+
prop: {},
|
|
3761
3828
|
disabled: { type: Boolean },
|
|
3762
|
-
size:
|
|
3763
|
-
lastValues:
|
|
3829
|
+
size: {},
|
|
3830
|
+
lastValues: {}
|
|
3764
3831
|
},
|
|
3765
3832
|
emits: ["change", "input"],
|
|
3766
3833
|
setup(__props, { emit }) {
|
|
@@ -3837,53 +3904,54 @@
|
|
|
3837
3904
|
};
|
|
3838
3905
|
return (_ctx, _cache) => {
|
|
3839
3906
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
|
|
3840
|
-
modelValue:
|
|
3841
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
3907
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3908
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3842
3909
|
clearable: "",
|
|
3843
|
-
size:
|
|
3844
|
-
placeholder:
|
|
3845
|
-
disabled:
|
|
3910
|
+
size: _ctx.size,
|
|
3911
|
+
placeholder: _ctx.config.placeholder,
|
|
3912
|
+
disabled: _ctx.disabled,
|
|
3846
3913
|
onChange: changeHandler,
|
|
3847
3914
|
onInput: inputHandler,
|
|
3848
3915
|
onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
|
|
3849
3916
|
}, vue.createSlots({ _: 2 }, [
|
|
3850
|
-
|
|
3917
|
+
_ctx.config.append ? {
|
|
3851
3918
|
name: "append",
|
|
3852
3919
|
fn: vue.withCtx(() => [
|
|
3853
|
-
typeof
|
|
3854
|
-
typeof
|
|
3920
|
+
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
|
|
3921
|
+
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3855
3922
|
key: 1,
|
|
3856
3923
|
style: { "color": "#409eff" },
|
|
3857
|
-
size:
|
|
3924
|
+
size: _ctx.size,
|
|
3858
3925
|
onClick: vue.withModifiers(buttonClickHandler, ["prevent"])
|
|
3859
3926
|
}, {
|
|
3860
3927
|
default: vue.withCtx(() => [
|
|
3861
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
3928
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.config.append.text), 1)
|
|
3862
3929
|
]),
|
|
3863
3930
|
_: 1
|
|
3864
3931
|
}, 8, ["size", "onClick"])) : vue.createCommentVNode("", true)
|
|
3865
|
-
])
|
|
3932
|
+
]),
|
|
3933
|
+
key: "0"
|
|
3866
3934
|
} : void 0
|
|
3867
3935
|
]), 1032, ["modelValue", "size", "placeholder", "disabled"]);
|
|
3868
3936
|
};
|
|
3869
3937
|
}
|
|
3870
3938
|
});
|
|
3871
3939
|
|
|
3872
|
-
const
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3940
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
3941
|
+
...{
|
|
3942
|
+
name: "MFormTextarea"
|
|
3943
|
+
},
|
|
3944
|
+
__name: "Textarea",
|
|
3877
3945
|
props: {
|
|
3878
|
-
config:
|
|
3879
|
-
model:
|
|
3880
|
-
initValues:
|
|
3881
|
-
values:
|
|
3882
|
-
name:
|
|
3883
|
-
prop:
|
|
3946
|
+
config: {},
|
|
3947
|
+
model: {},
|
|
3948
|
+
initValues: {},
|
|
3949
|
+
values: {},
|
|
3950
|
+
name: {},
|
|
3951
|
+
prop: {},
|
|
3884
3952
|
disabled: { type: Boolean },
|
|
3885
|
-
size:
|
|
3886
|
-
lastValues:
|
|
3953
|
+
size: {},
|
|
3954
|
+
lastValues: {}
|
|
3887
3955
|
},
|
|
3888
3956
|
emits: ["change", "input"],
|
|
3889
3957
|
setup(__props, { emit }) {
|
|
@@ -3899,13 +3967,13 @@
|
|
|
3899
3967
|
};
|
|
3900
3968
|
return (_ctx, _cache) => {
|
|
3901
3969
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
|
|
3902
|
-
modelValue:
|
|
3903
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
3970
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3971
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3904
3972
|
type: "textarea",
|
|
3905
|
-
size:
|
|
3973
|
+
size: _ctx.size,
|
|
3906
3974
|
clearable: "",
|
|
3907
|
-
placeholder:
|
|
3908
|
-
disabled:
|
|
3975
|
+
placeholder: _ctx.config.placeholder,
|
|
3976
|
+
disabled: _ctx.disabled,
|
|
3909
3977
|
onChange: changeHandler,
|
|
3910
3978
|
onInput: inputHandler
|
|
3911
3979
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled"]);
|
|
@@ -3913,21 +3981,21 @@
|
|
|
3913
3981
|
}
|
|
3914
3982
|
});
|
|
3915
3983
|
|
|
3916
|
-
const
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3984
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
3985
|
+
...{
|
|
3986
|
+
name: "MFormTime"
|
|
3987
|
+
},
|
|
3988
|
+
__name: "Time",
|
|
3921
3989
|
props: {
|
|
3922
|
-
config:
|
|
3923
|
-
model:
|
|
3924
|
-
initValues:
|
|
3925
|
-
values:
|
|
3926
|
-
name:
|
|
3927
|
-
prop:
|
|
3990
|
+
config: {},
|
|
3991
|
+
model: {},
|
|
3992
|
+
initValues: {},
|
|
3993
|
+
values: {},
|
|
3994
|
+
name: {},
|
|
3995
|
+
prop: {},
|
|
3928
3996
|
disabled: { type: Boolean },
|
|
3929
|
-
size:
|
|
3930
|
-
lastValues:
|
|
3997
|
+
size: {},
|
|
3998
|
+
lastValues: {}
|
|
3931
3999
|
},
|
|
3932
4000
|
emits: ["change"],
|
|
3933
4001
|
setup(__props, { emit }) {
|
|
@@ -3938,13 +4006,13 @@
|
|
|
3938
4006
|
};
|
|
3939
4007
|
return (_ctx, _cache) => {
|
|
3940
4008
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTimePicker), {
|
|
3941
|
-
modelValue:
|
|
3942
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
3943
|
-
"value-format":
|
|
3944
|
-
format:
|
|
3945
|
-
size:
|
|
3946
|
-
placeholder:
|
|
3947
|
-
disabled:
|
|
4009
|
+
modelValue: _ctx.model[_ctx.name],
|
|
4010
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
4011
|
+
"value-format": _ctx.config.valueFormat || "HH:mm:ss",
|
|
4012
|
+
format: _ctx.config.format || "HH:mm:ss",
|
|
4013
|
+
size: _ctx.size,
|
|
4014
|
+
placeholder: _ctx.config.placeholder,
|
|
4015
|
+
disabled: _ctx.disabled,
|
|
3948
4016
|
onChange: changeHandler
|
|
3949
4017
|
}, null, 8, ["modelValue", "value-format", "format", "size", "placeholder", "disabled"]);
|
|
3950
4018
|
};
|
|
@@ -3953,71 +4021,218 @@
|
|
|
3953
4021
|
|
|
3954
4022
|
const index$1 = '';
|
|
3955
4023
|
|
|
4024
|
+
const _hoisted_1 = { style: { "min-height": "1px" } };
|
|
4025
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
4026
|
+
...{
|
|
4027
|
+
name: "MFormDialog"
|
|
4028
|
+
},
|
|
4029
|
+
__name: "FormDrawer",
|
|
4030
|
+
props: {
|
|
4031
|
+
config: { default: () => [] },
|
|
4032
|
+
values: { default: () => ({}) },
|
|
4033
|
+
parentValues: {},
|
|
4034
|
+
width: {},
|
|
4035
|
+
labelWidth: {},
|
|
4036
|
+
disabled: { type: Boolean },
|
|
4037
|
+
closeOnPressEscape: { type: Boolean, default: true },
|
|
4038
|
+
title: {},
|
|
4039
|
+
zIndex: {},
|
|
4040
|
+
size: {},
|
|
4041
|
+
confirmText: { default: "确定" }
|
|
4042
|
+
},
|
|
4043
|
+
emits: ["close", "submit", "error", "change", "open", "opened"],
|
|
4044
|
+
setup(__props, { expose: __expose, emit }) {
|
|
4045
|
+
const form = vue.ref();
|
|
4046
|
+
const drawerBody = vue.ref();
|
|
4047
|
+
const visible = vue.ref(false);
|
|
4048
|
+
const saveFetch = vue.ref(false);
|
|
4049
|
+
const bodyHeight = vue.ref(0);
|
|
4050
|
+
vue.watchEffect(() => {
|
|
4051
|
+
if (drawerBody.value) {
|
|
4052
|
+
bodyHeight.value = drawerBody.value.clientHeight;
|
|
4053
|
+
}
|
|
4054
|
+
});
|
|
4055
|
+
const submitHandler = async () => {
|
|
4056
|
+
try {
|
|
4057
|
+
const values = await form.value?.submitForm();
|
|
4058
|
+
emit("submit", values);
|
|
4059
|
+
} catch (e) {
|
|
4060
|
+
emit("error", e);
|
|
4061
|
+
}
|
|
4062
|
+
};
|
|
4063
|
+
const changeHandler = (value) => {
|
|
4064
|
+
emit("change", value);
|
|
4065
|
+
};
|
|
4066
|
+
const openHandler = (value) => {
|
|
4067
|
+
emit("open", value);
|
|
4068
|
+
};
|
|
4069
|
+
const openedHandler = (value) => {
|
|
4070
|
+
emit("opened", value);
|
|
4071
|
+
};
|
|
4072
|
+
const show = () => {
|
|
4073
|
+
visible.value = true;
|
|
4074
|
+
};
|
|
4075
|
+
const hide = () => {
|
|
4076
|
+
visible.value = false;
|
|
4077
|
+
};
|
|
4078
|
+
__expose({
|
|
4079
|
+
form,
|
|
4080
|
+
saveFetch,
|
|
4081
|
+
bodyHeight,
|
|
4082
|
+
show,
|
|
4083
|
+
hide
|
|
4084
|
+
});
|
|
4085
|
+
return (_ctx, _cache) => {
|
|
4086
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDrawer), {
|
|
4087
|
+
class: "m-form-drawer",
|
|
4088
|
+
modelValue: visible.value,
|
|
4089
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
4090
|
+
title: _ctx.title,
|
|
4091
|
+
"close-on-press-escape": _ctx.closeOnPressEscape,
|
|
4092
|
+
"append-to-body": true,
|
|
4093
|
+
"show-close": true,
|
|
4094
|
+
"close-on-click-modal": true,
|
|
4095
|
+
size: _ctx.width,
|
|
4096
|
+
zIndex: _ctx.zIndex,
|
|
4097
|
+
onOpen: openHandler,
|
|
4098
|
+
onOpened: openedHandler
|
|
4099
|
+
}, {
|
|
4100
|
+
footer: vue.withCtx(() => [
|
|
4101
|
+
vue.createVNode(vue.unref(design.TMagicRow), { class: "dialog-footer" }, {
|
|
4102
|
+
default: vue.withCtx(() => [
|
|
4103
|
+
vue.createVNode(vue.unref(design.TMagicCol), {
|
|
4104
|
+
span: 12,
|
|
4105
|
+
style: { "text-align": "left" }
|
|
4106
|
+
}, {
|
|
4107
|
+
default: vue.withCtx(() => [
|
|
4108
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
4109
|
+
vue.renderSlot(_ctx.$slots, "left")
|
|
4110
|
+
])
|
|
4111
|
+
]),
|
|
4112
|
+
_: 3
|
|
4113
|
+
}),
|
|
4114
|
+
vue.createVNode(vue.unref(design.TMagicCol), { span: 12 }, {
|
|
4115
|
+
default: vue.withCtx(() => [
|
|
4116
|
+
vue.renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
4117
|
+
vue.createVNode(vue.unref(design.TMagicButton), { onClick: hide }, {
|
|
4118
|
+
default: vue.withCtx(() => [
|
|
4119
|
+
vue.createTextVNode("关闭")
|
|
4120
|
+
]),
|
|
4121
|
+
_: 1
|
|
4122
|
+
}),
|
|
4123
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4124
|
+
type: "primary",
|
|
4125
|
+
disabled: _ctx.disabled,
|
|
4126
|
+
loading: saveFetch.value,
|
|
4127
|
+
onClick: submitHandler
|
|
4128
|
+
}, {
|
|
4129
|
+
default: vue.withCtx(() => [
|
|
4130
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
|
|
4131
|
+
]),
|
|
4132
|
+
_: 1
|
|
4133
|
+
}, 8, ["disabled", "loading"])
|
|
4134
|
+
])
|
|
4135
|
+
]),
|
|
4136
|
+
_: 3
|
|
4137
|
+
})
|
|
4138
|
+
]),
|
|
4139
|
+
_: 3
|
|
4140
|
+
})
|
|
4141
|
+
]),
|
|
4142
|
+
default: vue.withCtx(() => [
|
|
4143
|
+
visible.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4144
|
+
key: 0,
|
|
4145
|
+
ref_key: "drawerBody",
|
|
4146
|
+
ref: drawerBody,
|
|
4147
|
+
class: "m-drawer-body"
|
|
4148
|
+
}, [
|
|
4149
|
+
vue.createVNode(_sfc_main$d, {
|
|
4150
|
+
ref_key: "form",
|
|
4151
|
+
ref: form,
|
|
4152
|
+
size: _ctx.size,
|
|
4153
|
+
disabled: _ctx.disabled,
|
|
4154
|
+
config: _ctx.config,
|
|
4155
|
+
"init-values": _ctx.values,
|
|
4156
|
+
"parent-values": _ctx.parentValues,
|
|
4157
|
+
"label-width": _ctx.labelWidth,
|
|
4158
|
+
onChange: changeHandler
|
|
4159
|
+
}, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width"]),
|
|
4160
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
4161
|
+
], 512)) : vue.createCommentVNode("", true)
|
|
4162
|
+
]),
|
|
4163
|
+
_: 3
|
|
4164
|
+
}, 8, ["modelValue", "title", "close-on-press-escape", "size", "zIndex"]);
|
|
4165
|
+
};
|
|
4166
|
+
}
|
|
4167
|
+
});
|
|
4168
|
+
|
|
3956
4169
|
const defaultInstallOpt = {};
|
|
3957
|
-
const install = (app, opt) => {
|
|
3958
|
-
const option = Object.assign(defaultInstallOpt, opt);
|
|
3959
|
-
app.config.globalProperties.$MAGIC_FORM = option;
|
|
3960
|
-
setConfig(option);
|
|
3961
|
-
app.component("m-form", _sfc_main$b);
|
|
3962
|
-
app.component("m-form-dialog", _sfc_main$a);
|
|
3963
|
-
app.component("m-form-container", _sfc_main$v);
|
|
3964
|
-
app.component("m-form-fieldset", _sfc_main$u);
|
|
3965
|
-
app.component("m-form-group-list", _sfc_main$s);
|
|
3966
|
-
app.component("m-form-panel", _sfc_main$r);
|
|
3967
|
-
app.component("m-form-row", _sfc_main$p);
|
|
3968
|
-
app.component("m-form-step", _sfc_main$o);
|
|
3969
|
-
app.component("m-form-table", _sfc_main$n);
|
|
3970
|
-
app.component("m-form-tab", _sfc_main$m);
|
|
3971
|
-
app.component("m-fields-text", _sfc_main$2);
|
|
3972
|
-
app.component("m-fields-number", _sfc_main$8);
|
|
3973
|
-
app.component("m-fields-textarea", _sfc_main$1);
|
|
3974
|
-
app.component("m-fields-hidden", _sfc_main$c);
|
|
3975
|
-
app.component("m-fields-date", _sfc_main$h);
|
|
3976
|
-
app.component("m-fields-datetime", _sfc_main$f);
|
|
3977
|
-
app.component("m-fields-daterange", _sfc_main$g);
|
|
3978
|
-
app.component("m-fields-time", _sfc_main);
|
|
3979
|
-
app.component("m-fields-checkbox", _sfc_main$k);
|
|
3980
|
-
app.component("m-fields-switch", _sfc_main$3);
|
|
3981
|
-
app.component("m-fields-color-picker", _sfc_main$i);
|
|
3982
|
-
app.component("m-fields-checkbox-group", _sfc_main$j);
|
|
3983
|
-
app.component("m-fields-radio-group", _sfc_main$7);
|
|
3984
|
-
app.component("m-fields-display", _sfc_main$e);
|
|
3985
|
-
app.component("m-fields-link", _sfc_main$9);
|
|
3986
|
-
app.component("m-fields-select", _sfc_main$4);
|
|
3987
|
-
app.component("m-fields-cascader", _sfc_main$l);
|
|
3988
|
-
app.component("m-fields-dynamic-field", _sfc_main$d);
|
|
3989
|
-
};
|
|
3990
4170
|
const index = {
|
|
3991
|
-
install
|
|
4171
|
+
install(app, opt = {}) {
|
|
4172
|
+
const option = Object.assign(defaultInstallOpt, opt);
|
|
4173
|
+
app.config.globalProperties.$MAGIC_FORM = option;
|
|
4174
|
+
setConfig(option);
|
|
4175
|
+
app.component("m-form", _sfc_main$d);
|
|
4176
|
+
app.component("m-form-dialog", _sfc_main$c);
|
|
4177
|
+
app.component("m-form-container", _sfc_main$x);
|
|
4178
|
+
app.component("m-form-fieldset", _sfc_main$w);
|
|
4179
|
+
app.component("m-form-group-list", _sfc_main$u);
|
|
4180
|
+
app.component("m-form-panel", _sfc_main$t);
|
|
4181
|
+
app.component("m-form-row", _sfc_main$r);
|
|
4182
|
+
app.component("m-form-step", _sfc_main$q);
|
|
4183
|
+
app.component("m-form-table", _sfc_main$p);
|
|
4184
|
+
app.component("m-form-tab", _sfc_main$o);
|
|
4185
|
+
app.component("m-fields-text", _sfc_main$3);
|
|
4186
|
+
app.component("m-fields-number", _sfc_main$a);
|
|
4187
|
+
app.component("m-fields-number-range", _sfc_main$9);
|
|
4188
|
+
app.component("m-fields-textarea", _sfc_main$2);
|
|
4189
|
+
app.component("m-fields-hidden", _sfc_main$e);
|
|
4190
|
+
app.component("m-fields-date", _sfc_main$j);
|
|
4191
|
+
app.component("m-fields-datetime", _sfc_main$h);
|
|
4192
|
+
app.component("m-fields-daterange", _sfc_main$i);
|
|
4193
|
+
app.component("m-fields-time", _sfc_main$1);
|
|
4194
|
+
app.component("m-fields-checkbox", _sfc_main$m);
|
|
4195
|
+
app.component("m-fields-switch", _sfc_main$4);
|
|
4196
|
+
app.component("m-fields-color-picker", _sfc_main$k);
|
|
4197
|
+
app.component("m-fields-checkbox-group", _sfc_main$l);
|
|
4198
|
+
app.component("m-fields-radio-group", _sfc_main$8);
|
|
4199
|
+
app.component("m-fields-display", _sfc_main$g);
|
|
4200
|
+
app.component("m-fields-link", _sfc_main$b);
|
|
4201
|
+
app.component("m-fields-select", _sfc_main$5);
|
|
4202
|
+
app.component("m-fields-cascader", _sfc_main$n);
|
|
4203
|
+
app.component("m-fields-dynamic-field", _sfc_main$f);
|
|
4204
|
+
}
|
|
3992
4205
|
};
|
|
3993
4206
|
|
|
3994
|
-
exports.MCascader = _sfc_main$
|
|
3995
|
-
exports.MCheckbox = _sfc_main$
|
|
3996
|
-
exports.MCheckboxGroup = _sfc_main$
|
|
3997
|
-
exports.MColorPicker = _sfc_main$
|
|
3998
|
-
exports.MContainer = _sfc_main$
|
|
3999
|
-
exports.MDate = _sfc_main$
|
|
4000
|
-
exports.MDateTime = _sfc_main$
|
|
4001
|
-
exports.MDaterange = _sfc_main$
|
|
4002
|
-
exports.MDisplay = _sfc_main$
|
|
4003
|
-
exports.MDynamicField = _sfc_main$
|
|
4004
|
-
exports.MFieldset = _sfc_main$
|
|
4005
|
-
exports.MForm = _sfc_main$
|
|
4006
|
-
exports.MFormDialog = _sfc_main$
|
|
4007
|
-
exports.
|
|
4008
|
-
exports.
|
|
4009
|
-
exports.
|
|
4010
|
-
exports.
|
|
4011
|
-
exports.
|
|
4012
|
-
exports.
|
|
4013
|
-
exports.
|
|
4014
|
-
exports.
|
|
4015
|
-
exports.
|
|
4016
|
-
exports.
|
|
4017
|
-
exports.
|
|
4018
|
-
exports.
|
|
4019
|
-
exports.
|
|
4020
|
-
exports.
|
|
4207
|
+
exports.MCascader = _sfc_main$n;
|
|
4208
|
+
exports.MCheckbox = _sfc_main$m;
|
|
4209
|
+
exports.MCheckboxGroup = _sfc_main$l;
|
|
4210
|
+
exports.MColorPicker = _sfc_main$k;
|
|
4211
|
+
exports.MContainer = _sfc_main$x;
|
|
4212
|
+
exports.MDate = _sfc_main$j;
|
|
4213
|
+
exports.MDateTime = _sfc_main$h;
|
|
4214
|
+
exports.MDaterange = _sfc_main$i;
|
|
4215
|
+
exports.MDisplay = _sfc_main$g;
|
|
4216
|
+
exports.MDynamicField = _sfc_main$f;
|
|
4217
|
+
exports.MFieldset = _sfc_main$w;
|
|
4218
|
+
exports.MForm = _sfc_main$d;
|
|
4219
|
+
exports.MFormDialog = _sfc_main$c;
|
|
4220
|
+
exports.MFormDrawer = _sfc_main;
|
|
4221
|
+
exports.MGroupList = _sfc_main$u;
|
|
4222
|
+
exports.MHidden = _sfc_main$e;
|
|
4223
|
+
exports.MLink = _sfc_main$b;
|
|
4224
|
+
exports.MNumber = _sfc_main$a;
|
|
4225
|
+
exports.MNumberRange = _sfc_main$9;
|
|
4226
|
+
exports.MPanel = _sfc_main$t;
|
|
4227
|
+
exports.MRadioGroup = _sfc_main$8;
|
|
4228
|
+
exports.MRow = _sfc_main$r;
|
|
4229
|
+
exports.MSelect = _sfc_main$5;
|
|
4230
|
+
exports.MSwitch = _sfc_main$4;
|
|
4231
|
+
exports.MTable = _sfc_main$p;
|
|
4232
|
+
exports.MTabs = _sfc_main$o;
|
|
4233
|
+
exports.MText = _sfc_main$3;
|
|
4234
|
+
exports.MTextarea = _sfc_main$2;
|
|
4235
|
+
exports.MTime = _sfc_main$1;
|
|
4021
4236
|
exports.createValues = createValues;
|
|
4022
4237
|
exports.default = index;
|
|
4023
4238
|
exports.display = display;
|