@tmagic/form 1.2.6 → 1.2.8
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 +29 -0
- package/dist/tmagic-form.js +357 -64
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +360 -67
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/Form.vue +31 -2
- package/src/containers/Col.vue +7 -1
- package/src/containers/Container.vue +147 -3
- package/src/containers/Fieldset.vue +12 -1
- package/src/containers/GroupList.vue +9 -1
- package/src/containers/GroupListItem.vue +7 -1
- package/src/containers/Panel.vue +10 -1
- package/src/containers/Row.vue +7 -1
- package/src/containers/Step.vue +7 -1
- package/src/containers/Table.vue +20 -1
- package/src/containers/Tabs.vue +58 -21
- package/src/schema.ts +2 -0
- package/src/theme/index.scss +1 -0
- package/src/theme/tabs.scss +4 -0
- package/types/Form.vue.d.ts +19 -0
- package/types/FormDialog.vue.d.ts +111 -3
- package/types/containers/Col.vue.d.ts +6 -1
- package/types/containers/Container.vue.d.ts +18 -1
- package/types/containers/Fieldset.vue.d.ts +12 -1
- package/types/containers/GroupList.vue.d.ts +6 -1
- package/types/containers/GroupListItem.vue.d.ts +6 -1
- package/types/containers/Panel.vue.d.ts +15 -3
- package/types/containers/Row.vue.d.ts +6 -1
- package/types/containers/Step.vue.d.ts +6 -1
- package/types/containers/Table.vue.d.ts +30 -4
- package/types/containers/Tabs.vue.d.ts +22 -3
- package/types/schema.d.ts +2 -0
package/dist/tmagic-form.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, unref, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString,
|
|
1
|
+
import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, watch, openBlock, createElementBlock, normalizeStyle, normalizeClass, unref, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, toRefs, 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
|
+
import { cloneDeep, isEqual } from 'lodash-es';
|
|
3
4
|
import { TMagicFormItem, TMagicTooltip, TMagicIcon, TMagicButton, TMagicCheckbox, TMagicCard, TMagicCol, TMagicRow, TMagicSteps, TMagicStep, TMagicTable, TMagicTableColumn, TMagicUpload, TMagicPagination, tMagicMessage, getConfig as getConfig$1, TMagicTabs, TMagicCascader, TMagicCheckboxGroup, TMagicColorPicker, TMagicDatePicker, TMagicForm, TMagicInput, TMagicDialog, TMagicInputNumber, TMagicRadioGroup, TMagicRadio, TMagicOptionGroup, TMagicOption, TMagicSelect, TMagicSwitch, TMagicTimePicker } from '@tmagic/design';
|
|
4
|
-
import { cloneDeep } from 'lodash-es';
|
|
5
5
|
import Sortable from 'sortablejs';
|
|
6
6
|
import { asyncLoadJs, sleep, datetimeFormatter, isNumber } from '@tmagic/utils';
|
|
7
7
|
import cloneDeep$1 from 'lodash-es/cloneDeep';
|
|
8
|
-
import isEqual from 'lodash-es/isEqual';
|
|
9
8
|
|
|
10
9
|
const isTableSelect = (type) => typeof type === "string" && ["table-select", "tableSelect"].includes(type);
|
|
11
10
|
const asyncLoadConfig = (value, initValue2, { asyncLoad, name, type }) => {
|
|
@@ -167,12 +166,20 @@ const initValue = async (mForm, { initValues, config }) => {
|
|
|
167
166
|
return valuesTmp || {};
|
|
168
167
|
};
|
|
169
168
|
|
|
170
|
-
const _hoisted_1$
|
|
169
|
+
const _hoisted_1$c = ["innerHTML"];
|
|
171
170
|
const _hoisted_2$7 = ["innerHTML"];
|
|
172
171
|
const _hoisted_3$7 = ["innerHTML"];
|
|
173
172
|
const _hoisted_4$6 = ["innerHTML"];
|
|
174
|
-
const _hoisted_5$4 =
|
|
175
|
-
|
|
173
|
+
const _hoisted_5$4 = ["innerHTML"];
|
|
174
|
+
const _hoisted_6$3 = ["innerHTML"];
|
|
175
|
+
const _hoisted_7$3 = ["innerHTML"];
|
|
176
|
+
const _hoisted_8$2 = ["innerHTML"];
|
|
177
|
+
const _hoisted_9$1 = ["innerHTML"];
|
|
178
|
+
const _hoisted_10$1 = ["innerHTML"];
|
|
179
|
+
const _hoisted_11 = ["innerHTML"];
|
|
180
|
+
const _hoisted_12 = ["innerHTML"];
|
|
181
|
+
const _hoisted_13 = {
|
|
182
|
+
key: 5,
|
|
176
183
|
style: { "text-align": "center" }
|
|
177
184
|
};
|
|
178
185
|
const __default__$v = defineComponent({
|
|
@@ -182,20 +189,29 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
182
189
|
...__default__$v,
|
|
183
190
|
props: {
|
|
184
191
|
model: null,
|
|
192
|
+
lastValues: { default: () => ({}) },
|
|
185
193
|
config: null,
|
|
186
194
|
prop: { default: "" },
|
|
187
195
|
disabled: { type: Boolean },
|
|
188
196
|
labelWidth: null,
|
|
189
197
|
expandMore: { type: Boolean, default: false },
|
|
190
198
|
stepActive: null,
|
|
191
|
-
size: { default: "small" }
|
|
199
|
+
size: { default: "small" },
|
|
200
|
+
isCompare: { type: Boolean, default: false }
|
|
192
201
|
},
|
|
193
|
-
emits: ["change"],
|
|
202
|
+
emits: ["change", "addDiffCount"],
|
|
194
203
|
setup(__props, { emit }) {
|
|
195
204
|
const props = __props;
|
|
196
205
|
const mForm = inject("mForm");
|
|
197
206
|
const expand = ref(false);
|
|
198
207
|
const name = computed(() => props.config.name || "");
|
|
208
|
+
const showDiff = computed(() => {
|
|
209
|
+
if (!props.isCompare)
|
|
210
|
+
return false;
|
|
211
|
+
const curValue = name.value ? props.model[name.value] : props.model;
|
|
212
|
+
const lastValue = name.value ? props.lastValues[name.value] : props.lastValues;
|
|
213
|
+
return !isEqual(curValue, lastValue);
|
|
214
|
+
});
|
|
199
215
|
const items = computed(() => props.config.items);
|
|
200
216
|
const itemProp = computed(() => {
|
|
201
217
|
let n = "";
|
|
@@ -241,6 +257,21 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
241
257
|
watchEffect(() => {
|
|
242
258
|
expand.value = props.expandMore;
|
|
243
259
|
});
|
|
260
|
+
watch(
|
|
261
|
+
showDiff,
|
|
262
|
+
(showDiff2) => {
|
|
263
|
+
if (type.value === "hidden")
|
|
264
|
+
return;
|
|
265
|
+
if (items.value && !props.config.text && type.value && display$1.value)
|
|
266
|
+
return;
|
|
267
|
+
if (display$1.value && showDiff2 && type.value) {
|
|
268
|
+
emit("addDiffCount");
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
immediate: true
|
|
273
|
+
}
|
|
274
|
+
);
|
|
244
275
|
const expandHandler = () => expand.value = !expand.value;
|
|
245
276
|
const key = (config) => config[mForm?.keyProps];
|
|
246
277
|
const filterHandler = (filter, value) => {
|
|
@@ -274,6 +305,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
274
305
|
return value.replace(/^\s*/, "").replace(/\s*$/, "");
|
|
275
306
|
}
|
|
276
307
|
};
|
|
308
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
277
309
|
const onChangeHandler = async function(v, key2) {
|
|
278
310
|
const { filter, onChange, trim, name: name2, dynamicKey } = props.config;
|
|
279
311
|
let value = v;
|
|
@@ -311,6 +343,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
311
343
|
key: key(__props.config),
|
|
312
344
|
size: __props.size,
|
|
313
345
|
model: __props.model,
|
|
346
|
+
"last-values": __props.lastValues,
|
|
347
|
+
"is-compare": __props.isCompare,
|
|
314
348
|
config: __props.config,
|
|
315
349
|
disabled: unref(disabled),
|
|
316
350
|
name: unref(name),
|
|
@@ -318,8 +352,9 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
318
352
|
"step-active": __props.stepActive,
|
|
319
353
|
"expand-more": expand.value,
|
|
320
354
|
"label-width": unref(itemLabelWidth),
|
|
321
|
-
onChange: onChangeHandler
|
|
322
|
-
|
|
355
|
+
onChange: onChangeHandler,
|
|
356
|
+
onAddDiffCount
|
|
357
|
+
}, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : unref(type) && unref(display$1) && !unref(showDiff) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
323
358
|
createVNode(unref(TMagicFormItem), {
|
|
324
359
|
style: normalizeStyle(__props.config.tip ? "flex: 1" : ""),
|
|
325
360
|
class: normalizeClass({ hidden: `${unref(itemLabelWidth)}` === "0" || !__props.config.text }),
|
|
@@ -330,7 +365,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
330
365
|
label: withCtx(() => [
|
|
331
366
|
createElementVNode("span", {
|
|
332
367
|
innerHTML: unref(type) === "checkbox" ? "" : __props.config.text
|
|
333
|
-
}, null, 8, _hoisted_1$
|
|
368
|
+
}, null, 8, _hoisted_1$c)
|
|
334
369
|
]),
|
|
335
370
|
default: withCtx(() => [
|
|
336
371
|
unref(tooltip) ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
|
|
@@ -346,7 +381,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
346
381
|
name: unref(name),
|
|
347
382
|
disabled: unref(disabled),
|
|
348
383
|
prop: unref(itemProp),
|
|
349
|
-
onChange: onChangeHandler
|
|
384
|
+
onChange: onChangeHandler,
|
|
385
|
+
onAddDiffCount
|
|
350
386
|
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
|
|
351
387
|
]),
|
|
352
388
|
_: 1
|
|
@@ -358,7 +394,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
358
394
|
name: unref(name),
|
|
359
395
|
disabled: unref(disabled),
|
|
360
396
|
prop: unref(itemProp),
|
|
361
|
-
onChange: onChangeHandler
|
|
397
|
+
onChange: onChangeHandler,
|
|
398
|
+
onAddDiffCount
|
|
362
399
|
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
|
|
363
400
|
unref(extra) ? (openBlock(), createElementBlock("div", {
|
|
364
401
|
key: 2,
|
|
@@ -387,11 +424,148 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
387
424
|
]),
|
|
388
425
|
_: 1
|
|
389
426
|
})) : createCommentVNode("", true)
|
|
390
|
-
], 64)) : unref(
|
|
427
|
+
], 64)) : unref(type) && unref(display$1) && unref(showDiff) ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
428
|
+
createVNode(unref(TMagicFormItem), {
|
|
429
|
+
style: normalizeStyle([__props.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
|
|
430
|
+
class: normalizeClass({ hidden: `${unref(itemLabelWidth)}` === "0" || !__props.config.text }),
|
|
431
|
+
prop: unref(itemProp),
|
|
432
|
+
"label-width": unref(itemLabelWidth),
|
|
433
|
+
rules: unref(rule)
|
|
434
|
+
}, {
|
|
435
|
+
label: withCtx(() => [
|
|
436
|
+
createElementVNode("span", {
|
|
437
|
+
innerHTML: unref(type) === "checkbox" ? "" : __props.config.text
|
|
438
|
+
}, null, 8, _hoisted_5$4)
|
|
439
|
+
]),
|
|
440
|
+
default: withCtx(() => [
|
|
441
|
+
unref(tooltip) ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
|
|
442
|
+
content: withCtx(() => [
|
|
443
|
+
createElementVNode("div", { innerHTML: unref(tooltip) }, null, 8, _hoisted_6$3)
|
|
444
|
+
]),
|
|
445
|
+
default: withCtx(() => [
|
|
446
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(tagName)), {
|
|
447
|
+
key: key(__props.config),
|
|
448
|
+
size: __props.size,
|
|
449
|
+
model: __props.lastValues,
|
|
450
|
+
config: __props.config,
|
|
451
|
+
name: unref(name),
|
|
452
|
+
disabled: unref(disabled),
|
|
453
|
+
prop: unref(itemProp),
|
|
454
|
+
onChange: onChangeHandler
|
|
455
|
+
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
|
|
456
|
+
]),
|
|
457
|
+
_: 1
|
|
458
|
+
})) : (openBlock(), createBlock(resolveDynamicComponent(unref(tagName)), {
|
|
459
|
+
key: key(__props.config),
|
|
460
|
+
size: __props.size,
|
|
461
|
+
model: __props.lastValues,
|
|
462
|
+
config: __props.config,
|
|
463
|
+
name: unref(name),
|
|
464
|
+
disabled: unref(disabled),
|
|
465
|
+
prop: unref(itemProp),
|
|
466
|
+
onChange: onChangeHandler
|
|
467
|
+
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
|
|
468
|
+
unref(extra) ? (openBlock(), createElementBlock("div", {
|
|
469
|
+
key: 2,
|
|
470
|
+
innerHTML: unref(extra),
|
|
471
|
+
class: "m-form-tip"
|
|
472
|
+
}, null, 8, _hoisted_7$3)) : createCommentVNode("", true)
|
|
473
|
+
]),
|
|
474
|
+
_: 1
|
|
475
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
476
|
+
__props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
477
|
+
key: 0,
|
|
478
|
+
placement: "left"
|
|
479
|
+
}, {
|
|
480
|
+
content: withCtx(() => [
|
|
481
|
+
createElementVNode("div", {
|
|
482
|
+
innerHTML: __props.config.tip
|
|
483
|
+
}, null, 8, _hoisted_8$2)
|
|
484
|
+
]),
|
|
485
|
+
default: withCtx(() => [
|
|
486
|
+
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
487
|
+
default: withCtx(() => [
|
|
488
|
+
createVNode(unref(WarningFilled))
|
|
489
|
+
]),
|
|
490
|
+
_: 1
|
|
491
|
+
})
|
|
492
|
+
]),
|
|
493
|
+
_: 1
|
|
494
|
+
})) : createCommentVNode("", true),
|
|
495
|
+
createVNode(unref(TMagicFormItem), {
|
|
496
|
+
style: normalizeStyle([__props.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
|
|
497
|
+
class: normalizeClass({ hidden: `${unref(itemLabelWidth)}` === "0" || !__props.config.text }),
|
|
498
|
+
prop: unref(itemProp),
|
|
499
|
+
"label-width": unref(itemLabelWidth),
|
|
500
|
+
rules: unref(rule)
|
|
501
|
+
}, {
|
|
502
|
+
label: withCtx(() => [
|
|
503
|
+
createElementVNode("span", {
|
|
504
|
+
innerHTML: unref(type) === "checkbox" ? "" : __props.config.text
|
|
505
|
+
}, null, 8, _hoisted_9$1)
|
|
506
|
+
]),
|
|
507
|
+
default: withCtx(() => [
|
|
508
|
+
unref(tooltip) ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
|
|
509
|
+
content: withCtx(() => [
|
|
510
|
+
createElementVNode("div", { innerHTML: unref(tooltip) }, null, 8, _hoisted_10$1)
|
|
511
|
+
]),
|
|
512
|
+
default: withCtx(() => [
|
|
513
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(tagName)), {
|
|
514
|
+
key: key(__props.config),
|
|
515
|
+
size: __props.size,
|
|
516
|
+
model: __props.model,
|
|
517
|
+
config: __props.config,
|
|
518
|
+
name: unref(name),
|
|
519
|
+
disabled: unref(disabled),
|
|
520
|
+
prop: unref(itemProp),
|
|
521
|
+
onChange: onChangeHandler
|
|
522
|
+
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
|
|
523
|
+
]),
|
|
524
|
+
_: 1
|
|
525
|
+
})) : (openBlock(), createBlock(resolveDynamicComponent(unref(tagName)), {
|
|
526
|
+
key: key(__props.config),
|
|
527
|
+
size: __props.size,
|
|
528
|
+
model: __props.model,
|
|
529
|
+
config: __props.config,
|
|
530
|
+
name: unref(name),
|
|
531
|
+
disabled: unref(disabled),
|
|
532
|
+
prop: unref(itemProp),
|
|
533
|
+
onChange: onChangeHandler
|
|
534
|
+
}, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
|
|
535
|
+
unref(extra) ? (openBlock(), createElementBlock("div", {
|
|
536
|
+
key: 2,
|
|
537
|
+
innerHTML: unref(extra),
|
|
538
|
+
class: "m-form-tip"
|
|
539
|
+
}, null, 8, _hoisted_11)) : createCommentVNode("", true)
|
|
540
|
+
]),
|
|
541
|
+
_: 1
|
|
542
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
543
|
+
__props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
544
|
+
key: 1,
|
|
545
|
+
placement: "left"
|
|
546
|
+
}, {
|
|
547
|
+
content: withCtx(() => [
|
|
548
|
+
createElementVNode("div", {
|
|
549
|
+
innerHTML: __props.config.tip
|
|
550
|
+
}, null, 8, _hoisted_12)
|
|
551
|
+
]),
|
|
552
|
+
default: withCtx(() => [
|
|
553
|
+
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
554
|
+
default: withCtx(() => [
|
|
555
|
+
createVNode(unref(WarningFilled))
|
|
556
|
+
]),
|
|
557
|
+
_: 1
|
|
558
|
+
})
|
|
559
|
+
]),
|
|
560
|
+
_: 1
|
|
561
|
+
})) : createCommentVNode("", true)
|
|
562
|
+
], 64)) : unref(items) && unref(display$1) ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
391
563
|
(unref(name) || unref(name) === 0 ? __props.model[unref(name)] : __props.model) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(items), (item) => {
|
|
392
564
|
return openBlock(), createBlock(_component_Container, {
|
|
393
565
|
key: key(item),
|
|
394
566
|
model: unref(name) || unref(name) === 0 ? __props.model[unref(name)] : __props.model,
|
|
567
|
+
"last-values": unref(name) || unref(name) === 0 ? __props.lastValues[unref(name)] : __props.lastValues,
|
|
568
|
+
"is-compare": __props.isCompare,
|
|
395
569
|
config: item,
|
|
396
570
|
size: __props.size,
|
|
397
571
|
disabled: unref(disabled),
|
|
@@ -399,11 +573,12 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
399
573
|
"expand-more": expand.value,
|
|
400
574
|
"label-width": unref(itemLabelWidth),
|
|
401
575
|
prop: unref(itemProp),
|
|
402
|
-
onChange: onChangeHandler
|
|
403
|
-
|
|
576
|
+
onChange: onChangeHandler,
|
|
577
|
+
onAddDiffCount
|
|
578
|
+
}, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
|
|
404
579
|
}), 128)) : createCommentVNode("", true)
|
|
405
580
|
], 64)) : createCommentVNode("", true),
|
|
406
|
-
__props.config.expand && unref(type) !== "fieldset" ? (openBlock(), createElementBlock("div",
|
|
581
|
+
__props.config.expand && unref(type) !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
407
582
|
createVNode(unref(TMagicButton), {
|
|
408
583
|
type: "primary",
|
|
409
584
|
size: "small",
|
|
@@ -422,7 +597,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
422
597
|
}
|
|
423
598
|
});
|
|
424
599
|
|
|
425
|
-
const _hoisted_1$
|
|
600
|
+
const _hoisted_1$b = ["innerHTML"];
|
|
426
601
|
const _hoisted_2$6 = ["innerHTML"];
|
|
427
602
|
const _hoisted_3$6 = { key: 1 };
|
|
428
603
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -443,11 +618,13 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
443
618
|
prop: { default: "" },
|
|
444
619
|
size: null,
|
|
445
620
|
model: null,
|
|
621
|
+
lastValues: { default: () => ({}) },
|
|
622
|
+
isCompare: { type: Boolean, default: false },
|
|
446
623
|
config: null,
|
|
447
624
|
rules: { default: {} },
|
|
448
625
|
disabled: { type: Boolean }
|
|
449
626
|
},
|
|
450
|
-
emits: ["change"],
|
|
627
|
+
emits: ["change", "addDiffCount"],
|
|
451
628
|
setup(__props, { emit }) {
|
|
452
629
|
const props = __props;
|
|
453
630
|
const mForm = inject("mForm");
|
|
@@ -476,6 +653,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
476
653
|
}
|
|
477
654
|
);
|
|
478
655
|
}
|
|
656
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
479
657
|
return (_ctx, _cache) => {
|
|
480
658
|
return (unref(name) ? __props.model[unref(name)] : __props.model) ? (openBlock(), createElementBlock("fieldset", {
|
|
481
659
|
key: 0,
|
|
@@ -494,7 +672,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
494
672
|
default: withCtx(() => [
|
|
495
673
|
createElementVNode("span", {
|
|
496
674
|
innerHTML: __props.config.legend
|
|
497
|
-
}, null, 8, _hoisted_1$
|
|
675
|
+
}, null, 8, _hoisted_1$b),
|
|
498
676
|
__props.config.extra ? (openBlock(), createElementBlock("span", {
|
|
499
677
|
key: 0,
|
|
500
678
|
innerHTML: __props.config.extra,
|
|
@@ -521,14 +699,17 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
521
699
|
return openBlock(), createBlock(_sfc_main$v, {
|
|
522
700
|
key: key(item, index),
|
|
523
701
|
model: unref(name) ? __props.model[unref(name)] : __props.model,
|
|
702
|
+
lastValues: unref(name) ? __props.lastValues[unref(name)] : __props.lastValues,
|
|
703
|
+
"is-compare": __props.isCompare,
|
|
524
704
|
rules: unref(name) ? __props.rules[unref(name)] : [],
|
|
525
705
|
config: item,
|
|
526
706
|
prop: __props.prop,
|
|
527
707
|
disabled: __props.disabled,
|
|
528
708
|
labelWidth: unref(lWidth),
|
|
529
709
|
size: __props.size,
|
|
530
|
-
onChange: change
|
|
531
|
-
|
|
710
|
+
onChange: change,
|
|
711
|
+
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
712
|
+
}, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
|
|
532
713
|
}), 128))
|
|
533
714
|
]),
|
|
534
715
|
createElementVNode("img", {
|
|
@@ -539,21 +720,24 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
539
720
|
return openBlock(), createBlock(_sfc_main$v, {
|
|
540
721
|
key: key(item, index),
|
|
541
722
|
model: unref(name) ? __props.model[unref(name)] : __props.model,
|
|
723
|
+
lastValues: unref(name) ? __props.lastValues[unref(name)] : __props.lastValues,
|
|
724
|
+
"is-compare": __props.isCompare,
|
|
542
725
|
rules: unref(name) ? __props.rules[unref(name)] : [],
|
|
543
726
|
config: item,
|
|
544
727
|
prop: __props.prop,
|
|
545
728
|
labelWidth: unref(lWidth),
|
|
546
729
|
size: __props.size,
|
|
547
730
|
disabled: __props.disabled,
|
|
548
|
-
onChange: change
|
|
549
|
-
|
|
731
|
+
onChange: change,
|
|
732
|
+
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
733
|
+
}, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
|
|
550
734
|
}), 128)) : createCommentVNode("", true)
|
|
551
735
|
], 4)) : createCommentVNode("", true);
|
|
552
736
|
};
|
|
553
737
|
}
|
|
554
738
|
});
|
|
555
739
|
|
|
556
|
-
const _hoisted_1$
|
|
740
|
+
const _hoisted_1$a = { class: "m-fields-group-list-item" };
|
|
557
741
|
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
|
|
558
742
|
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
|
|
559
743
|
const _hoisted_4$4 = ["innerHTML"];
|
|
@@ -564,6 +748,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
564
748
|
...__default__$t,
|
|
565
749
|
props: {
|
|
566
750
|
model: null,
|
|
751
|
+
lastValues: null,
|
|
752
|
+
isCompare: { type: Boolean },
|
|
567
753
|
groupModel: null,
|
|
568
754
|
config: null,
|
|
569
755
|
labelWidth: null,
|
|
@@ -572,7 +758,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
572
758
|
index: null,
|
|
573
759
|
disabled: { type: Boolean }
|
|
574
760
|
},
|
|
575
|
-
emits: ["swap-item", "remove-item", "change"],
|
|
761
|
+
emits: ["swap-item", "remove-item", "change", "addDiffCount"],
|
|
576
762
|
setup(__props, { emit }) {
|
|
577
763
|
const props = __props;
|
|
578
764
|
const mForm = inject("mForm");
|
|
@@ -617,8 +803,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
617
803
|
}
|
|
618
804
|
return movable2;
|
|
619
805
|
};
|
|
806
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
620
807
|
return (_ctx, _cache) => {
|
|
621
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
808
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
622
809
|
createElementVNode("div", null, [
|
|
623
810
|
createVNode(unref(TMagicIcon), {
|
|
624
811
|
style: { "margin-right": "7px" },
|
|
@@ -698,18 +885,21 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
698
885
|
key: 0,
|
|
699
886
|
config: unref(rowConfig),
|
|
700
887
|
model: __props.model,
|
|
888
|
+
lastValues: __props.lastValues,
|
|
889
|
+
"is-compare": __props.isCompare,
|
|
701
890
|
labelWidth: __props.labelWidth,
|
|
702
891
|
prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
|
|
703
892
|
size: __props.size,
|
|
704
893
|
disabled: __props.disabled,
|
|
705
|
-
onChange: changeHandler
|
|
706
|
-
|
|
894
|
+
onChange: changeHandler,
|
|
895
|
+
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
896
|
+
}, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : createCommentVNode("", true)
|
|
707
897
|
]);
|
|
708
898
|
};
|
|
709
899
|
}
|
|
710
900
|
});
|
|
711
901
|
|
|
712
|
-
const _hoisted_1$
|
|
902
|
+
const _hoisted_1$9 = { class: "m-fields-group-list" };
|
|
713
903
|
const _hoisted_2$4 = ["innerHTML"];
|
|
714
904
|
const _hoisted_3$4 = {
|
|
715
905
|
key: 1,
|
|
@@ -728,6 +918,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
728
918
|
...__default__$s,
|
|
729
919
|
props: {
|
|
730
920
|
model: null,
|
|
921
|
+
lastValues: null,
|
|
922
|
+
isCompare: { type: Boolean },
|
|
731
923
|
config: null,
|
|
732
924
|
name: null,
|
|
733
925
|
labelWidth: null,
|
|
@@ -735,7 +927,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
735
927
|
size: null,
|
|
736
928
|
disabled: { type: Boolean }
|
|
737
929
|
},
|
|
738
|
-
emits: ["change"],
|
|
930
|
+
emits: ["change", "addDiffCount"],
|
|
739
931
|
setup(__props, { emit }) {
|
|
740
932
|
const props = __props;
|
|
741
933
|
const mForm = inject("mForm");
|
|
@@ -799,8 +991,10 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
799
991
|
text: null
|
|
800
992
|
}));
|
|
801
993
|
};
|
|
994
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
995
|
+
const getLastValues = (item, index) => item?.[index] || {};
|
|
802
996
|
return (_ctx, _cache) => {
|
|
803
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
997
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
804
998
|
__props.config.extra ? (openBlock(), createElementBlock("div", {
|
|
805
999
|
key: 0,
|
|
806
1000
|
innerHTML: __props.config.extra,
|
|
@@ -810,6 +1004,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
810
1004
|
return openBlock(), createBlock(_sfc_main$t, {
|
|
811
1005
|
key: index,
|
|
812
1006
|
model: item,
|
|
1007
|
+
lastValues: getLastValues(__props.lastValues[__props.name], index),
|
|
1008
|
+
"is-compare": __props.isCompare,
|
|
813
1009
|
config: __props.config,
|
|
814
1010
|
prop: __props.prop,
|
|
815
1011
|
index,
|
|
@@ -819,8 +1015,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
819
1015
|
"group-model": __props.model[__props.name],
|
|
820
1016
|
onRemoveItem: removeHandler,
|
|
821
1017
|
onSwapItem: swapHandler,
|
|
822
|
-
onChange: changeHandler
|
|
823
|
-
|
|
1018
|
+
onChange: changeHandler,
|
|
1019
|
+
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
1020
|
+
}, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
|
|
824
1021
|
}), 128)),
|
|
825
1022
|
unref(addable) ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
826
1023
|
key: 3,
|
|
@@ -849,7 +1046,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
849
1046
|
}
|
|
850
1047
|
});
|
|
851
1048
|
|
|
852
|
-
const _hoisted_1$
|
|
1049
|
+
const _hoisted_1$8 = { class: "clearfix" };
|
|
853
1050
|
const _hoisted_2$3 = ["innerHTML"];
|
|
854
1051
|
const _hoisted_3$3 = {
|
|
855
1052
|
key: 0,
|
|
@@ -864,6 +1061,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
864
1061
|
...__default__$r,
|
|
865
1062
|
props: {
|
|
866
1063
|
model: null,
|
|
1064
|
+
lastValues: null,
|
|
1065
|
+
isCompare: { type: Boolean },
|
|
867
1066
|
config: null,
|
|
868
1067
|
name: null,
|
|
869
1068
|
labelWidth: null,
|
|
@@ -871,7 +1070,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
871
1070
|
size: null,
|
|
872
1071
|
disabled: { type: Boolean }
|
|
873
1072
|
},
|
|
874
|
-
emits: ["change"],
|
|
1073
|
+
emits: ["change", "addDiffCount"],
|
|
875
1074
|
setup(__props, { emit }) {
|
|
876
1075
|
const props = __props;
|
|
877
1076
|
const mForm = inject("mForm");
|
|
@@ -879,6 +1078,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
879
1078
|
const items = computed(() => props.config.items);
|
|
880
1079
|
const filter = (config) => filterFunction(mForm, config, props);
|
|
881
1080
|
const changeHandler = () => emit("change", props.model);
|
|
1081
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
882
1082
|
return (_ctx, _cache) => {
|
|
883
1083
|
return unref(items) && unref(items).length ? (openBlock(), createBlock(unref(TMagicCard), {
|
|
884
1084
|
key: 0,
|
|
@@ -886,7 +1086,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
886
1086
|
"body-style": { display: expand.value ? "block" : "none" }
|
|
887
1087
|
}, {
|
|
888
1088
|
header: withCtx(() => [
|
|
889
|
-
createElementVNode("div", _hoisted_1$
|
|
1089
|
+
createElementVNode("div", _hoisted_1$8, [
|
|
890
1090
|
createElementVNode("a", {
|
|
891
1091
|
href: "javascript:",
|
|
892
1092
|
style: { "width": "100%", "display": "block" },
|
|
@@ -917,12 +1117,15 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
917
1117
|
key: item[unref(mForm)?.keyProp || "__key"] ?? index,
|
|
918
1118
|
config: item,
|
|
919
1119
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
1120
|
+
lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
1121
|
+
"is-compare": __props.isCompare,
|
|
920
1122
|
prop: __props.prop,
|
|
921
1123
|
size: __props.size,
|
|
922
1124
|
disabled: __props.disabled,
|
|
923
1125
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
924
|
-
onChange: changeHandler
|
|
925
|
-
|
|
1126
|
+
onChange: changeHandler,
|
|
1127
|
+
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
1128
|
+
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
|
|
926
1129
|
}), 128))
|
|
927
1130
|
]),
|
|
928
1131
|
createElementVNode("img", {
|
|
@@ -934,12 +1137,15 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
934
1137
|
key: item[unref(mForm)?.keyProp || "__key"] ?? index,
|
|
935
1138
|
config: item,
|
|
936
1139
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
1140
|
+
lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
1141
|
+
"is-compare": __props.isCompare,
|
|
937
1142
|
prop: __props.prop,
|
|
938
1143
|
size: __props.size,
|
|
939
1144
|
disabled: __props.disabled,
|
|
940
1145
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
941
|
-
onChange: changeHandler
|
|
942
|
-
|
|
1146
|
+
onChange: changeHandler,
|
|
1147
|
+
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
1148
|
+
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
|
|
943
1149
|
}), 128))
|
|
944
1150
|
])
|
|
945
1151
|
]),
|
|
@@ -956,6 +1162,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
956
1162
|
...__default__$q,
|
|
957
1163
|
props: {
|
|
958
1164
|
model: null,
|
|
1165
|
+
lastValues: null,
|
|
1166
|
+
isCompare: { type: Boolean },
|
|
959
1167
|
config: null,
|
|
960
1168
|
labelWidth: null,
|
|
961
1169
|
expandMore: { type: Boolean },
|
|
@@ -964,25 +1172,29 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
964
1172
|
prop: null,
|
|
965
1173
|
disabled: { type: Boolean }
|
|
966
1174
|
},
|
|
967
|
-
emits: ["change"],
|
|
1175
|
+
emits: ["change", "addDiffCount"],
|
|
968
1176
|
setup(__props, { emit }) {
|
|
969
1177
|
const props = __props;
|
|
970
1178
|
const mForm = inject("mForm");
|
|
971
1179
|
const display$1 = computed(() => display(mForm, props.config.display, props));
|
|
972
1180
|
const changeHandler = () => emit("change", props.model);
|
|
1181
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
973
1182
|
return (_ctx, _cache) => {
|
|
974
1183
|
return withDirectives((openBlock(), createBlock(unref(TMagicCol), { span: __props.span }, {
|
|
975
1184
|
default: withCtx(() => [
|
|
976
1185
|
createVNode(_sfc_main$v, {
|
|
977
1186
|
model: __props.model,
|
|
1187
|
+
lastValues: __props.lastValues,
|
|
1188
|
+
"is-compare": __props.isCompare,
|
|
978
1189
|
config: __props.config,
|
|
979
1190
|
prop: __props.prop,
|
|
980
1191
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
981
1192
|
"expand-more": __props.expandMore,
|
|
982
1193
|
size: __props.size,
|
|
983
1194
|
disabled: __props.disabled,
|
|
984
|
-
onChange: changeHandler
|
|
985
|
-
|
|
1195
|
+
onChange: changeHandler,
|
|
1196
|
+
onAddDiffCount
|
|
1197
|
+
}, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "label-width", "expand-more", "size", "disabled"])
|
|
986
1198
|
]),
|
|
987
1199
|
_: 1
|
|
988
1200
|
}, 8, ["span"])), [
|
|
@@ -999,6 +1211,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
999
1211
|
...__default__$p,
|
|
1000
1212
|
props: {
|
|
1001
1213
|
model: null,
|
|
1214
|
+
lastValues: null,
|
|
1215
|
+
isCompare: { type: Boolean },
|
|
1002
1216
|
config: null,
|
|
1003
1217
|
name: null,
|
|
1004
1218
|
labelWidth: null,
|
|
@@ -1007,11 +1221,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1007
1221
|
expandMore: { type: Boolean },
|
|
1008
1222
|
disabled: { type: Boolean }
|
|
1009
1223
|
},
|
|
1010
|
-
emits: ["change"],
|
|
1224
|
+
emits: ["change", "addDiffCount"],
|
|
1011
1225
|
setup(__props, { emit }) {
|
|
1012
1226
|
const props = __props;
|
|
1013
1227
|
const mForm = inject("mForm");
|
|
1014
1228
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1229
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
1015
1230
|
return (_ctx, _cache) => {
|
|
1016
1231
|
return openBlock(), createBlock(unref(TMagicRow), { gutter: 10 }, {
|
|
1017
1232
|
default: withCtx(() => [
|
|
@@ -1023,11 +1238,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1023
1238
|
labelWidth: __props.config.labelWidth || __props.labelWidth,
|
|
1024
1239
|
expandMore: __props.expandMore,
|
|
1025
1240
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
1241
|
+
lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
1242
|
+
"is-compare": __props.isCompare,
|
|
1026
1243
|
prop: __props.prop,
|
|
1027
1244
|
size: __props.size,
|
|
1028
1245
|
disabled: __props.disabled,
|
|
1029
|
-
onChange: changeHandler
|
|
1030
|
-
|
|
1246
|
+
onChange: changeHandler,
|
|
1247
|
+
onAddDiffCount
|
|
1248
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "lastValues", "is-compare", "prop", "size", "disabled"]);
|
|
1031
1249
|
}), 128))
|
|
1032
1250
|
]),
|
|
1033
1251
|
_: 1
|
|
@@ -1043,13 +1261,15 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1043
1261
|
...__default__$o,
|
|
1044
1262
|
props: {
|
|
1045
1263
|
model: null,
|
|
1264
|
+
lastValues: null,
|
|
1265
|
+
isCompare: { type: Boolean },
|
|
1046
1266
|
config: null,
|
|
1047
1267
|
stepActive: { default: 1 },
|
|
1048
1268
|
labelWidth: null,
|
|
1049
1269
|
size: null,
|
|
1050
1270
|
disabled: { type: Boolean }
|
|
1051
1271
|
},
|
|
1052
|
-
emits: ["change"],
|
|
1272
|
+
emits: ["change", "addDiffCount"],
|
|
1053
1273
|
setup(__props, { emit }) {
|
|
1054
1274
|
const props = __props;
|
|
1055
1275
|
const mForm = inject("mForm");
|
|
@@ -1064,6 +1284,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1064
1284
|
const changeHandler = () => {
|
|
1065
1285
|
emit("change", props.model);
|
|
1066
1286
|
};
|
|
1287
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
1067
1288
|
return (_ctx, _cache) => {
|
|
1068
1289
|
return openBlock(), createElementBlock("div", null, [
|
|
1069
1290
|
createVNode(unref(TMagicSteps), {
|
|
@@ -1091,12 +1312,15 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1091
1312
|
key: item[unref(mForm)?.keyProp || "__key"],
|
|
1092
1313
|
config: item,
|
|
1093
1314
|
model: step.name ? __props.model[step.name] : __props.model,
|
|
1315
|
+
lastValues: step.name ? __props.lastValues[step.name] : __props.lastValues,
|
|
1316
|
+
"is-compare": __props.isCompare,
|
|
1094
1317
|
prop: `${step.name}`,
|
|
1095
1318
|
size: __props.size,
|
|
1096
1319
|
disabled: __props.disabled,
|
|
1097
1320
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
1098
|
-
onChange: changeHandler
|
|
1099
|
-
|
|
1321
|
+
onChange: changeHandler,
|
|
1322
|
+
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
1323
|
+
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"])), [
|
|
1100
1324
|
[vShow, active.value - 1 === index]
|
|
1101
1325
|
]) : createCommentVNode("", true)
|
|
1102
1326
|
], 64);
|
|
@@ -1108,7 +1332,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1108
1332
|
}
|
|
1109
1333
|
});
|
|
1110
1334
|
|
|
1111
|
-
const _hoisted_1$
|
|
1335
|
+
const _hoisted_1$7 = ["innerHTML"];
|
|
1112
1336
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1113
1337
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1114
1338
|
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
|
|
@@ -1129,6 +1353,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1129
1353
|
...__default__$n,
|
|
1130
1354
|
props: {
|
|
1131
1355
|
model: null,
|
|
1356
|
+
lastValues: { default: () => ({}) },
|
|
1357
|
+
isCompare: { type: Boolean, default: false },
|
|
1132
1358
|
config: null,
|
|
1133
1359
|
name: null,
|
|
1134
1360
|
prop: { default: "" },
|
|
@@ -1141,7 +1367,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1141
1367
|
enableToggleMode: { type: Boolean, default: true },
|
|
1142
1368
|
showIndex: { type: Boolean, default: true }
|
|
1143
1369
|
},
|
|
1144
|
-
emits: ["change", "select"],
|
|
1370
|
+
emits: ["change", "select", "addDiffCount"],
|
|
1145
1371
|
setup(__props, { expose, emit }) {
|
|
1146
1372
|
const props = __props;
|
|
1147
1373
|
let timer = null;
|
|
@@ -1159,6 +1385,11 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1159
1385
|
(item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value
|
|
1160
1386
|
) : props.model[modelName.value]
|
|
1161
1387
|
);
|
|
1388
|
+
const lastData = computed(
|
|
1389
|
+
() => props.config.pagination ? props.lastValues[modelName.value].filter(
|
|
1390
|
+
(item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value
|
|
1391
|
+
) : props.lastValues[modelName.value] || {}
|
|
1392
|
+
);
|
|
1162
1393
|
const sortChange = ({ prop, order }) => {
|
|
1163
1394
|
if (order === "ascending") {
|
|
1164
1395
|
props.model[modelName.value] = props.model[modelName.value].sort((a, b) => a[prop] - b[prop]);
|
|
@@ -1460,6 +1691,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1460
1691
|
const { prop } = toRefs(props);
|
|
1461
1692
|
return `${prop.value}${prop.value ? "." : ""}${index + 1 + pagecontext.value * pagesize.value - 1}`;
|
|
1462
1693
|
};
|
|
1694
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
1463
1695
|
expose({
|
|
1464
1696
|
toggleRowSelection
|
|
1465
1697
|
});
|
|
@@ -1473,7 +1705,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1473
1705
|
key: 0,
|
|
1474
1706
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1475
1707
|
innerHTML: __props.config.extra
|
|
1476
|
-
}, null, 8, _hoisted_1$
|
|
1708
|
+
}, null, 8, _hoisted_1$7)) : createCommentVNode("", true),
|
|
1477
1709
|
createElementVNode("div", _hoisted_2$2, [
|
|
1478
1710
|
createVNode(unref(TMagicTooltip), {
|
|
1479
1711
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1487,6 +1719,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1487
1719
|
style: { "width": "100%" },
|
|
1488
1720
|
"row-key": __props.config.rowKey || "id",
|
|
1489
1721
|
data: unref(data),
|
|
1722
|
+
lastData: unref(lastData),
|
|
1490
1723
|
border: __props.config.border,
|
|
1491
1724
|
"max-height": __props.config.maxHeight,
|
|
1492
1725
|
"default-expand-all": true,
|
|
@@ -1615,9 +1848,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1615
1848
|
rules: column.rules,
|
|
1616
1849
|
config: makeConfig(column, scope.row),
|
|
1617
1850
|
model: scope.row,
|
|
1851
|
+
lastValues: unref(lastData)[scope.$index],
|
|
1852
|
+
"is-compare": __props.isCompare,
|
|
1618
1853
|
size: __props.size,
|
|
1619
|
-
onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", __props.model[unref(modelName)]))
|
|
1620
|
-
|
|
1854
|
+
onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", __props.model[unref(modelName)])),
|
|
1855
|
+
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
1856
|
+
}, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : createCommentVNode("", true)
|
|
1621
1857
|
]),
|
|
1622
1858
|
_: 2
|
|
1623
1859
|
}, 1032, ["prop", "width", "label", "sortable", "class-name"])) : createCommentVNode("", true)
|
|
@@ -1625,7 +1861,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1625
1861
|
}), 256))
|
|
1626
1862
|
]),
|
|
1627
1863
|
_: 3
|
|
1628
|
-
}, 8, ["row-key", "data", "border", "max-height"])) : createCommentVNode("", true)
|
|
1864
|
+
}, 8, ["row-key", "data", "lastData", "border", "max-height"])) : createCommentVNode("", true)
|
|
1629
1865
|
]),
|
|
1630
1866
|
_: 3
|
|
1631
1867
|
}, 8, ["disabled"]),
|
|
@@ -1636,7 +1872,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1636
1872
|
type: "primary",
|
|
1637
1873
|
disabled: __props.disabled,
|
|
1638
1874
|
plain: "",
|
|
1639
|
-
onClick: _cache[
|
|
1875
|
+
onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
|
|
1640
1876
|
}, {
|
|
1641
1877
|
default: withCtx(() => [
|
|
1642
1878
|
_hoisted_4$1
|
|
@@ -1700,7 +1936,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1700
1936
|
type: "warning",
|
|
1701
1937
|
disabled: __props.disabled,
|
|
1702
1938
|
plain: "",
|
|
1703
|
-
onClick: _cache[
|
|
1939
|
+
onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
|
|
1704
1940
|
}, {
|
|
1705
1941
|
default: withCtx(() => [
|
|
1706
1942
|
_hoisted_9
|
|
@@ -1725,6 +1961,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1725
1961
|
}
|
|
1726
1962
|
});
|
|
1727
1963
|
|
|
1964
|
+
const _hoisted_1$6 = { class: "custom-tabs-label" };
|
|
1728
1965
|
const __default__$m = defineComponent({
|
|
1729
1966
|
name: "MFormTabs"
|
|
1730
1967
|
});
|
|
@@ -1732,6 +1969,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1732
1969
|
...__default__$m,
|
|
1733
1970
|
props: {
|
|
1734
1971
|
model: null,
|
|
1972
|
+
lastValues: { default: () => ({}) },
|
|
1973
|
+
isCompare: { type: Boolean, default: false },
|
|
1735
1974
|
config: null,
|
|
1736
1975
|
name: null,
|
|
1737
1976
|
size: null,
|
|
@@ -1740,7 +1979,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1740
1979
|
expandMore: { type: Boolean },
|
|
1741
1980
|
disabled: { type: Boolean }
|
|
1742
1981
|
},
|
|
1743
|
-
emits: ["change"],
|
|
1982
|
+
emits: ["change", "addDiffCount"],
|
|
1744
1983
|
setup(__props, { emit }) {
|
|
1745
1984
|
const props = __props;
|
|
1746
1985
|
const uiComponent = getConfig$1("components").tabPane;
|
|
@@ -1768,6 +2007,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1768
2007
|
};
|
|
1769
2008
|
const mForm = inject("mForm");
|
|
1770
2009
|
const activeTabName = ref(getActive(mForm, props, ""));
|
|
2010
|
+
const diffCount = ref({});
|
|
1771
2011
|
const tabs = computed(() => {
|
|
1772
2012
|
if (props.config.dynamic) {
|
|
1773
2013
|
if (!props.config.name)
|
|
@@ -1830,7 +2070,27 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1830
2070
|
props.config.onChange(mForm, { model: props.model, prop: props.prop, config: props.config });
|
|
1831
2071
|
}
|
|
1832
2072
|
};
|
|
2073
|
+
const getValues = (model, tabIndex, tab) => {
|
|
2074
|
+
const tabName = props.config.dynamic ? (model[props?.name] || model)[tabIndex] : tab.name;
|
|
2075
|
+
let propName = props.name;
|
|
2076
|
+
if (tabName) {
|
|
2077
|
+
propName = (model[props?.name] || model)[tab.name];
|
|
2078
|
+
}
|
|
2079
|
+
if (propName) {
|
|
2080
|
+
return model[props.name];
|
|
2081
|
+
}
|
|
2082
|
+
return model;
|
|
2083
|
+
};
|
|
2084
|
+
const onAddDiffCount = (tabIndex) => {
|
|
2085
|
+
if (!diffCount.value[tabIndex]) {
|
|
2086
|
+
diffCount.value[tabIndex] = 1;
|
|
2087
|
+
} else {
|
|
2088
|
+
diffCount.value[tabIndex] += 1;
|
|
2089
|
+
}
|
|
2090
|
+
emit("addDiffCount");
|
|
2091
|
+
};
|
|
1833
2092
|
return (_ctx, _cache) => {
|
|
2093
|
+
const _component_el_badge = resolveComponent("el-badge");
|
|
1834
2094
|
return openBlock(), createBlock(unref(TMagicTabs), {
|
|
1835
2095
|
modelValue: activeTabName.value,
|
|
1836
2096
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
|
|
@@ -1851,19 +2111,32 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1851
2111
|
label: filter(tab.title),
|
|
1852
2112
|
lazy: tab.lazy || false
|
|
1853
2113
|
}, {
|
|
2114
|
+
label: withCtx(() => [
|
|
2115
|
+
createElementVNode("span", _hoisted_1$6, [
|
|
2116
|
+
createTextVNode(toDisplayString(filter(tab.title)), 1),
|
|
2117
|
+
createVNode(_component_el_badge, {
|
|
2118
|
+
hidden: !diffCount.value[tabIndex],
|
|
2119
|
+
value: diffCount.value[tabIndex],
|
|
2120
|
+
class: "diff-count-badge"
|
|
2121
|
+
}, null, 8, ["hidden", "value"])
|
|
2122
|
+
])
|
|
2123
|
+
]),
|
|
1854
2124
|
default: withCtx(() => [
|
|
1855
2125
|
(openBlock(true), createElementBlock(Fragment, null, renderList(tabItems(tab), (item) => {
|
|
1856
2126
|
return openBlock(), createBlock(_sfc_main$v, {
|
|
1857
2127
|
key: item[unref(mForm)?.keyProp || "__key"],
|
|
1858
2128
|
config: item,
|
|
1859
2129
|
disabled: __props.disabled,
|
|
1860
|
-
model:
|
|
2130
|
+
model: getValues(__props.model, tabIndex, tab),
|
|
2131
|
+
"last-values": getValues(__props.lastValues, tabIndex, tab),
|
|
2132
|
+
"is-compare": __props.isCompare,
|
|
1861
2133
|
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
|
|
1862
2134
|
size: __props.size,
|
|
1863
2135
|
"label-width": tab.labelWidth || __props.labelWidth,
|
|
1864
2136
|
"expand-more": __props.expandMore,
|
|
1865
|
-
onChange: changeHandler
|
|
1866
|
-
|
|
2137
|
+
onChange: changeHandler,
|
|
2138
|
+
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
2139
|
+
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
1867
2140
|
}), 128))
|
|
1868
2141
|
]),
|
|
1869
2142
|
_: 2
|
|
@@ -2488,6 +2761,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2488
2761
|
props: {
|
|
2489
2762
|
config: { default: () => [] },
|
|
2490
2763
|
initValues: { default: () => ({}) },
|
|
2764
|
+
lastValues: { default: () => ({}) },
|
|
2765
|
+
isCompare: { type: Boolean, default: false },
|
|
2491
2766
|
parentValues: { default: () => ({}) },
|
|
2492
2767
|
labelWidth: { default: "200px" },
|
|
2493
2768
|
disabled: { type: Boolean, default: false },
|
|
@@ -2505,6 +2780,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2505
2780
|
const tMagicForm = ref();
|
|
2506
2781
|
const initialized = ref(false);
|
|
2507
2782
|
const values = ref({});
|
|
2783
|
+
const lastValuesProcessed = ref({});
|
|
2508
2784
|
const fields = /* @__PURE__ */ new Map();
|
|
2509
2785
|
const requestFuc = getConfig("request");
|
|
2510
2786
|
const formState = reactive({
|
|
@@ -2512,8 +2788,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2512
2788
|
popperClass: props.popperClass,
|
|
2513
2789
|
config: props.config,
|
|
2514
2790
|
initValues: props.initValues,
|
|
2791
|
+
isCompare: props.isCompare,
|
|
2792
|
+
lastValues: props.lastValues,
|
|
2515
2793
|
parentValues: props.parentValues,
|
|
2516
2794
|
values,
|
|
2795
|
+
lastValuesProcessed,
|
|
2517
2796
|
$emit: emit,
|
|
2518
2797
|
fields,
|
|
2519
2798
|
setField: (prop, field) => fields.set(prop, field),
|
|
@@ -2530,6 +2809,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2530
2809
|
});
|
|
2531
2810
|
watchEffect(() => {
|
|
2532
2811
|
formState.initValues = props.initValues;
|
|
2812
|
+
formState.lastValues = props.lastValues;
|
|
2813
|
+
formState.isCompare = props.isCompare;
|
|
2533
2814
|
formState.config = props.config;
|
|
2534
2815
|
formState.keyProp = props.keyProp;
|
|
2535
2816
|
formState.popperClass = props.popperClass;
|
|
@@ -2547,8 +2828,17 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2547
2828
|
config: props.config
|
|
2548
2829
|
}).then((value) => {
|
|
2549
2830
|
values.value = value;
|
|
2550
|
-
initialized.value =
|
|
2831
|
+
initialized.value = !props.isCompare;
|
|
2551
2832
|
});
|
|
2833
|
+
if (props.isCompare) {
|
|
2834
|
+
initValue(formState, {
|
|
2835
|
+
initValues: props.lastValues,
|
|
2836
|
+
config: props.config
|
|
2837
|
+
}).then((value) => {
|
|
2838
|
+
lastValuesProcessed.value = value;
|
|
2839
|
+
initialized.value = true;
|
|
2840
|
+
});
|
|
2841
|
+
}
|
|
2552
2842
|
},
|
|
2553
2843
|
{ immediate: true }
|
|
2554
2844
|
);
|
|
@@ -2557,6 +2847,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2557
2847
|
};
|
|
2558
2848
|
expose({
|
|
2559
2849
|
values,
|
|
2850
|
+
lastValuesProcessed,
|
|
2560
2851
|
formState,
|
|
2561
2852
|
initialized,
|
|
2562
2853
|
changeHandler,
|
|
@@ -2599,11 +2890,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2599
2890
|
key: item[__props.keyProp] ?? index,
|
|
2600
2891
|
config: item,
|
|
2601
2892
|
model: values.value,
|
|
2893
|
+
"last-values": lastValuesProcessed.value,
|
|
2894
|
+
"is-compare": __props.isCompare,
|
|
2602
2895
|
"label-width": item.labelWidth || __props.labelWidth,
|
|
2603
2896
|
"step-active": __props.stepActive,
|
|
2604
2897
|
size: __props.size,
|
|
2605
2898
|
onChange: changeHandler
|
|
2606
|
-
}, null, 8, ["disabled", "config", "model", "label-width", "step-active", "size"]);
|
|
2899
|
+
}, null, 8, ["disabled", "config", "model", "last-values", "is-compare", "label-width", "step-active", "size"]);
|
|
2607
2900
|
}), 128)) : createCommentVNode("", true)
|
|
2608
2901
|
]),
|
|
2609
2902
|
_: 1
|