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