@tmagic/form 1.6.1 → 1.7.0-beta.1
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 +23 -3
- package/dist/tmagic-form.js +1741 -1501
- package/dist/tmagic-form.umd.cjs +1774 -1530
- package/package.json +4 -4
- package/src/Form.vue +70 -9
- package/src/containers/Container.vue +109 -134
- package/src/containers/Fieldset.vue +31 -7
- package/src/containers/FlexLayout.vue +59 -0
- package/src/containers/Tabs.vue +11 -1
- package/src/fields/Cascader.vue +25 -16
- package/src/fields/Checkbox.vue +3 -3
- package/src/fields/CheckboxGroup.vue +1 -1
- package/src/fields/ColorPicker.vue +2 -2
- package/src/fields/Date.vue +2 -2
- package/src/fields/DateTime.vue +2 -2
- package/src/fields/Daterange.vue +2 -2
- package/src/fields/Number.vue +2 -2
- package/src/fields/NumberRange.vue +6 -6
- package/src/fields/RadioGroup.vue +7 -15
- package/src/fields/Select.vue +2 -2
- package/src/fields/Switch.vue +2 -2
- package/src/fields/Text.vue +20 -8
- package/src/fields/Textarea.vue +3 -2
- package/src/fields/Time.vue +2 -2
- package/src/fields/Timerange.vue +2 -2
- package/src/index.ts +5 -2
- package/src/table/ActionsColumn.vue +97 -0
- package/src/table/SortColumn.vue +101 -0
- package/src/table/Table.vue +170 -0
- package/src/table/type.ts +18 -0
- package/src/table/useAdd.ts +111 -0
- package/src/table/useFullscreen.ts +28 -0
- package/src/table/useImport.ts +68 -0
- package/src/table/usePagination.ts +30 -0
- package/src/table/useSelection.ts +34 -0
- package/src/table/useSortable.ts +48 -0
- package/src/table/useTableColumns.ts +194 -0
- package/src/theme/container.scss +17 -0
- package/src/theme/form.scss +15 -3
- package/src/utils/form.ts +56 -2
- package/types/index.d.ts +65 -36
- package/src/containers/Table.vue +0 -681
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('@tmagic/utils'), require('dayjs'), require('dayjs/plugin/utc'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', '@tmagic/design', '@tmagic/utils', 'dayjs', 'dayjs/plugin/utc', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.iconsVue, global.design, global.utils, global.dayjs, global.utc, global.
|
|
5
|
-
})(this, (function (exports, vue, iconsVue, design, utils, dayjs, utc,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('@tmagic/utils'), require('dayjs'), require('dayjs/plugin/utc'), require('@popperjs/core'), require('sortablejs'), require('@tmagic/form-schema')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', '@tmagic/design', '@tmagic/utils', 'dayjs', 'dayjs/plugin/utc', '@popperjs/core', 'sortablejs', '@tmagic/form-schema'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.iconsVue, global.design, global.utils, global.dayjs, global.utc, global.core, global.Sortable, global.formSchema));
|
|
5
|
+
})(this, (function (exports, vue, iconsVue, design, utils, dayjs, utc, core, Sortable, formSchema) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/** Detect free variable `global` from Node.js. */
|
|
8
8
|
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
@@ -2968,8 +2968,10 @@
|
|
|
2968
2968
|
value[name] = getDefaultValue(mForm, item);
|
|
2969
2969
|
}
|
|
2970
2970
|
if (type === "fieldset" && checkbox) {
|
|
2971
|
-
|
|
2972
|
-
|
|
2971
|
+
const checkboxName = typeof checkbox === "object" && typeof checkbox.name === "string" ? checkbox.name : "value";
|
|
2972
|
+
const checkboxFalseValue = typeof checkbox === "object" && typeof checkbox.falseValue !== "undefined" ? checkbox.falseValue : 0;
|
|
2973
|
+
if (name && typeof value[name] === "object") {
|
|
2974
|
+
value[name][checkboxName] = typeof initValue2[name] === "object" ? initValue2[name][checkboxName] || checkboxFalseValue : checkboxFalseValue;
|
|
2973
2975
|
}
|
|
2974
2976
|
}
|
|
2975
2977
|
};
|
|
@@ -2999,6 +3001,16 @@
|
|
|
2999
3001
|
return createValues(mForm, items, initValue2, value);
|
|
3000
3002
|
}
|
|
3001
3003
|
setValue(mForm, value, initValue2, item);
|
|
3004
|
+
if (type === "table") {
|
|
3005
|
+
if (item.defautSort) {
|
|
3006
|
+
sortChange(value[name], item.defautSort);
|
|
3007
|
+
} else if (item.defaultSort) {
|
|
3008
|
+
sortChange(value[name], item.defaultSort);
|
|
3009
|
+
}
|
|
3010
|
+
if (item.sort && item.sortKey) {
|
|
3011
|
+
value[name].sort((a, b) => b[item.sortKey] - a[item.sortKey]);
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3002
3014
|
return value;
|
|
3003
3015
|
};
|
|
3004
3016
|
const createValues = function(mForm, config = [], initValue2 = {}, value = {}) {
|
|
@@ -3039,7 +3051,8 @@
|
|
|
3039
3051
|
formValue: mForm?.values || props.model,
|
|
3040
3052
|
prop: props.prop,
|
|
3041
3053
|
config: props.config,
|
|
3042
|
-
index: props.index
|
|
3054
|
+
index: props.index,
|
|
3055
|
+
getFormValue: (prop) => utils.getValueByKeyPath(prop, mForm?.values || props.model)
|
|
3043
3056
|
});
|
|
3044
3057
|
}
|
|
3045
3058
|
return config;
|
|
@@ -3116,25 +3129,47 @@
|
|
|
3116
3129
|
}
|
|
3117
3130
|
return defaultValue;
|
|
3118
3131
|
};
|
|
3132
|
+
const getDataByPage = (data = [], pagecontext, pagesize) => data.filter(
|
|
3133
|
+
(item, index) => index >= pagecontext * pagesize && index + 1 <= (pagecontext + 1) * pagesize
|
|
3134
|
+
);
|
|
3135
|
+
const sortArray = (data, newIndex, oldIndex, sortKey) => {
|
|
3136
|
+
if (newIndex === oldIndex) {
|
|
3137
|
+
return data;
|
|
3138
|
+
}
|
|
3139
|
+
if (newIndex < 0 || newIndex >= data.length || oldIndex < 0 || oldIndex >= data.length) {
|
|
3140
|
+
return data;
|
|
3141
|
+
}
|
|
3142
|
+
const newData = data.toSpliced(newIndex, 0, ...data.splice(oldIndex, 1));
|
|
3143
|
+
if (sortKey) {
|
|
3144
|
+
for (let i = newData.length - 1, v = 0; i >= 0; i--, v++) {
|
|
3145
|
+
newData[v][sortKey] = i;
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
return newData;
|
|
3149
|
+
};
|
|
3150
|
+
const sortChange = (data, { prop, order }) => {
|
|
3151
|
+
if (order === "ascending") {
|
|
3152
|
+
data = data.sort((a, b) => a[prop] - b[prop]);
|
|
3153
|
+
} else if (order === "descending") {
|
|
3154
|
+
data = data.sort((a, b) => b[prop] - a[prop]);
|
|
3155
|
+
}
|
|
3156
|
+
};
|
|
3119
3157
|
|
|
3120
|
-
const _hoisted_1$
|
|
3158
|
+
const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
|
|
3121
3159
|
const _hoisted_2$7 = ["innerHTML", "title"];
|
|
3122
|
-
const _hoisted_3$
|
|
3160
|
+
const _hoisted_3$6 = ["innerHTML"];
|
|
3123
3161
|
const _hoisted_4$3 = ["innerHTML"];
|
|
3124
|
-
const _hoisted_5$3 = ["innerHTML"];
|
|
3125
|
-
const _hoisted_6$
|
|
3162
|
+
const _hoisted_5$3 = ["innerHTML", "title"];
|
|
3163
|
+
const _hoisted_6$1 = ["innerHTML"];
|
|
3126
3164
|
const _hoisted_7$1 = ["innerHTML"];
|
|
3127
|
-
const _hoisted_8$1 = ["innerHTML"];
|
|
3165
|
+
const _hoisted_8$1 = ["innerHTML", "title"];
|
|
3128
3166
|
const _hoisted_9 = ["innerHTML"];
|
|
3129
|
-
const _hoisted_10 = ["innerHTML"
|
|
3130
|
-
const _hoisted_11 =
|
|
3131
|
-
const _hoisted_12 = ["innerHTML"];
|
|
3132
|
-
const _hoisted_13 = ["innerHTML"];
|
|
3133
|
-
const _hoisted_14 = {
|
|
3167
|
+
const _hoisted_10 = ["innerHTML"];
|
|
3168
|
+
const _hoisted_11 = {
|
|
3134
3169
|
key: 5,
|
|
3135
3170
|
style: { "text-align": "center" }
|
|
3136
3171
|
};
|
|
3137
|
-
const _sfc_main$
|
|
3172
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
3138
3173
|
...{
|
|
3139
3174
|
name: "MFormContainer"
|
|
3140
3175
|
},
|
|
@@ -3188,8 +3223,19 @@
|
|
|
3188
3223
|
});
|
|
3189
3224
|
const disabled = vue.computed(() => props.disabled || filterFunction(mForm, props.config.disabled, props));
|
|
3190
3225
|
const text = vue.computed(() => filterFunction(mForm, props.config.text, props));
|
|
3191
|
-
const tooltip = vue.computed(() =>
|
|
3192
|
-
|
|
3226
|
+
const tooltip = vue.computed(() => {
|
|
3227
|
+
const config = filterFunction(mForm, props.config.tooltip, props);
|
|
3228
|
+
if (typeof config === "string") {
|
|
3229
|
+
return {
|
|
3230
|
+
text: config,
|
|
3231
|
+
placement: "top"
|
|
3232
|
+
};
|
|
3233
|
+
}
|
|
3234
|
+
return {
|
|
3235
|
+
text: config?.text,
|
|
3236
|
+
placement: config?.placement || "top"
|
|
3237
|
+
};
|
|
3238
|
+
});
|
|
3193
3239
|
const rule = vue.computed(() => getRules(mForm, props.config.rules, props));
|
|
3194
3240
|
const type = vue.computed(() => {
|
|
3195
3241
|
let { type: type2 } = props.config;
|
|
@@ -3205,6 +3251,22 @@
|
|
|
3205
3251
|
}
|
|
3206
3252
|
return value;
|
|
3207
3253
|
});
|
|
3254
|
+
const fieldsProps = vue.computed(() => ({
|
|
3255
|
+
size: props.size,
|
|
3256
|
+
config: props.config,
|
|
3257
|
+
name: name.value,
|
|
3258
|
+
disabled: disabled.value,
|
|
3259
|
+
prop: itemProp.value,
|
|
3260
|
+
key: props.config[mForm?.keyProps],
|
|
3261
|
+
style: props.config.fieldStyle
|
|
3262
|
+
}));
|
|
3263
|
+
const formItemProps = vue.computed(() => ({
|
|
3264
|
+
prop: itemProp.value,
|
|
3265
|
+
labelWidth: itemLabelWidth.value,
|
|
3266
|
+
labelPosition: props.config.labelPosition,
|
|
3267
|
+
rules: rule.value,
|
|
3268
|
+
extra: filterFunction(mForm, props.config.extra, props)
|
|
3269
|
+
}));
|
|
3208
3270
|
const itemLabelWidth = vue.computed(() => props.config.labelWidth ?? props.labelWidth);
|
|
3209
3271
|
vue.watchEffect(() => {
|
|
3210
3272
|
expand.value = props.expandMore;
|
|
@@ -3231,7 +3293,8 @@
|
|
|
3231
3293
|
values: mForm?.initValues,
|
|
3232
3294
|
formValue: mForm?.values,
|
|
3233
3295
|
prop: itemProp.value,
|
|
3234
|
-
config: props.config
|
|
3296
|
+
config: props.config,
|
|
3297
|
+
getFormValue: (prop) => utils.getValueByKeyPath(prop, mForm?.values || props.model)
|
|
3235
3298
|
});
|
|
3236
3299
|
}
|
|
3237
3300
|
if (filter === "number") {
|
|
@@ -3259,27 +3322,50 @@
|
|
|
3259
3322
|
}
|
|
3260
3323
|
return true;
|
|
3261
3324
|
};
|
|
3325
|
+
const createModelProxy = (target, setModelFn, pathPrefix = "") => {
|
|
3326
|
+
return new Proxy(target, {
|
|
3327
|
+
get: (obj, key2) => {
|
|
3328
|
+
const value = obj[key2];
|
|
3329
|
+
if (value && typeof value === "object") {
|
|
3330
|
+
const newPath = pathPrefix ? `${pathPrefix}.${key2}` : key2;
|
|
3331
|
+
return createModelProxy(value, setModelFn, newPath);
|
|
3332
|
+
}
|
|
3333
|
+
return value;
|
|
3334
|
+
},
|
|
3335
|
+
set: (obj, key2, value) => {
|
|
3336
|
+
setModelFn(pathPrefix ? `${pathPrefix}.${key2}` : key2, value);
|
|
3337
|
+
return true;
|
|
3338
|
+
}
|
|
3339
|
+
});
|
|
3340
|
+
};
|
|
3262
3341
|
const onChangeHandler = async function(v, eventData = {}) {
|
|
3263
|
-
const { filter, onChange, trim
|
|
3342
|
+
const { filter, onChange, trim } = props.config;
|
|
3264
3343
|
let value = vue.toRaw(v);
|
|
3265
3344
|
const changeRecords = eventData.changeRecords || [];
|
|
3266
3345
|
const newChangeRecords = [...changeRecords];
|
|
3267
3346
|
try {
|
|
3268
3347
|
value = filterHandler(filter, v);
|
|
3269
3348
|
if (typeof onChange === "function") {
|
|
3349
|
+
const setModel = (key2, value2) => {
|
|
3350
|
+
if (props.config.name) {
|
|
3351
|
+
newChangeRecords.push({ propPath: itemProp.value.replace(`${props.config.name}`, key2), value: value2 });
|
|
3352
|
+
} else {
|
|
3353
|
+
newChangeRecords.push({ propPath: itemProp.value, value: value2 });
|
|
3354
|
+
}
|
|
3355
|
+
};
|
|
3356
|
+
const setFormValue = (key2, value2) => {
|
|
3357
|
+
newChangeRecords.push({ propPath: key2, value: value2 });
|
|
3358
|
+
};
|
|
3270
3359
|
value = await onChange(mForm, value, {
|
|
3271
|
-
model: props.model,
|
|
3272
|
-
values: mForm
|
|
3273
|
-
formValue: mForm?.values,
|
|
3360
|
+
model: createModelProxy(props.model, setModel),
|
|
3361
|
+
values: mForm ? vue.readonly(mForm.initValues) : null,
|
|
3362
|
+
formValue: createModelProxy(mForm?.values || {}, setFormValue),
|
|
3274
3363
|
prop: itemProp.value,
|
|
3275
3364
|
config: props.config,
|
|
3276
3365
|
changeRecords: newChangeRecords,
|
|
3277
|
-
setModel
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
newChangeRecords.push({ propPath: itemProp.value.replace(`${props.config.name}`, key2), value: value2 });
|
|
3281
|
-
}
|
|
3282
|
-
}
|
|
3366
|
+
setModel,
|
|
3367
|
+
setFormValue,
|
|
3368
|
+
getFormValue: (prop) => utils.getValueByKeyPath(prop, mForm?.values || props.model)
|
|
3283
3369
|
}) ?? value;
|
|
3284
3370
|
}
|
|
3285
3371
|
value = trimHandler(trim, value) ?? value;
|
|
@@ -3288,15 +3374,8 @@
|
|
|
3288
3374
|
}
|
|
3289
3375
|
let valueProp = itemProp.value;
|
|
3290
3376
|
if (hasModifyKey(eventData)) {
|
|
3291
|
-
if (dynamicKey) {
|
|
3292
|
-
props.model[eventData.modifyKey] = value;
|
|
3293
|
-
} else if (isValidName()) {
|
|
3294
|
-
props.model[name.value][eventData.modifyKey] = value;
|
|
3295
|
-
}
|
|
3296
3377
|
valueProp = valueProp ? `${valueProp}.${eventData.modifyKey}` : eventData.modifyKey;
|
|
3297
3378
|
delete eventData.modifyKey;
|
|
3298
|
-
} else if (isValidName() && props.model !== value && (v !== value || props.model[name.value] !== value)) {
|
|
3299
|
-
props.model[name.value] = value;
|
|
3300
3379
|
}
|
|
3301
3380
|
if (changeRecords.length === 0) {
|
|
3302
3381
|
newChangeRecords.push({
|
|
@@ -3312,95 +3391,65 @@
|
|
|
3312
3391
|
return (_ctx, _cache) => {
|
|
3313
3392
|
const _component_m_fields_hidden = vue.resolveComponent("m-fields-hidden");
|
|
3314
3393
|
const _component_Container = vue.resolveComponent("Container", true);
|
|
3315
|
-
return
|
|
3316
|
-
key: 0,
|
|
3394
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3317
3395
|
"data-tmagic-id": __props.config.id,
|
|
3318
3396
|
"data-tmagic-form-item-prop": itemProp.value,
|
|
3319
|
-
|
|
3320
|
-
|
|
3397
|
+
class: vue.normalizeClass(`m-form-container m-container-${type.value || ""} ${__props.config.className || ""}${__props.config.tip ? " has-tip" : ""}`),
|
|
3398
|
+
style: vue.normalizeStyle(__props.config.style)
|
|
3321
3399
|
}, [
|
|
3322
|
-
type.value === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, {
|
|
3323
|
-
key: 0,
|
|
3324
|
-
model: __props.model,
|
|
3325
|
-
config: __props.config,
|
|
3326
|
-
name: __props.config.name,
|
|
3327
|
-
disabled: disabled.value,
|
|
3328
|
-
prop: itemProp.value
|
|
3329
|
-
}, null, 8, ["model", "config", "name", "disabled", "prop"])) : items.value && !text.value && type.value && display$1.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
3330
|
-
key: key(__props.config),
|
|
3331
|
-
size: __props.size,
|
|
3400
|
+
type.value === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, vue.mergeProps({ key: 0 }, fieldsProps.value, { model: __props.model }), null, 16, ["model"])) : items.value && !text.value && type.value && display$1.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps({ key: 1 }, fieldsProps.value, {
|
|
3332
3401
|
model: __props.model,
|
|
3333
3402
|
"last-values": __props.lastValues,
|
|
3334
3403
|
"is-compare": __props.isCompare,
|
|
3335
|
-
config: __props.config,
|
|
3336
|
-
disabled: disabled.value,
|
|
3337
|
-
name: name.value,
|
|
3338
|
-
prop: itemProp.value,
|
|
3339
3404
|
"step-active": __props.stepActive,
|
|
3340
3405
|
"expand-more": expand.value,
|
|
3341
3406
|
"label-width": itemLabelWidth.value,
|
|
3407
|
+
style: __props.config.fieldStyle,
|
|
3342
3408
|
onChange: onChangeHandler,
|
|
3343
3409
|
onAddDiffCount
|
|
3344
|
-
}, null,
|
|
3410
|
+
}), null, 16, ["model", "last-values", "is-compare", "step-active", "expand-more", "label-width", "style"])) : type.value && display$1.value && !showDiff.value ? (vue.openBlock(), vue.createElementBlock(
|
|
3345
3411
|
vue.Fragment,
|
|
3346
3412
|
{ key: 2 },
|
|
3347
3413
|
[
|
|
3348
|
-
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
prop: itemProp.value,
|
|
3352
|
-
"label-width": itemLabelWidth.value,
|
|
3353
|
-
"label-position": __props.config.labelPosition,
|
|
3354
|
-
rules: rule.value
|
|
3355
|
-
}, {
|
|
3414
|
+
vue.createVNode(vue.unref(design.TMagicFormItem), vue.mergeProps(formItemProps.value, {
|
|
3415
|
+
class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }
|
|
3416
|
+
}), {
|
|
3356
3417
|
label: vue.withCtx(() => [
|
|
3357
3418
|
vue.createElementVNode("span", {
|
|
3358
|
-
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
3419
|
+
innerHTML: type.value === "checkbox" && !__props.config.useLabel ? "" : text.value,
|
|
3359
3420
|
title: __props.config.labelTitle
|
|
3360
3421
|
}, null, 8, _hoisted_2$7)
|
|
3361
3422
|
]),
|
|
3362
3423
|
default: vue.withCtx(() => [
|
|
3363
|
-
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3424
|
+
tooltip.value.text ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3425
|
+
key: 0,
|
|
3426
|
+
placement: tooltip.value.placement
|
|
3427
|
+
}, {
|
|
3364
3428
|
content: vue.withCtx(() => [
|
|
3365
|
-
vue.createElementVNode("div", {
|
|
3429
|
+
vue.createElementVNode("div", {
|
|
3430
|
+
innerHTML: tooltip.value.text
|
|
3431
|
+
}, null, 8, _hoisted_3$6)
|
|
3366
3432
|
]),
|
|
3367
3433
|
default: vue.withCtx(() => [
|
|
3368
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
3369
|
-
key: key(__props.config),
|
|
3370
|
-
size: __props.size,
|
|
3434
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps(fieldsProps.value, {
|
|
3371
3435
|
model: __props.model,
|
|
3372
3436
|
"last-values": __props.lastValues,
|
|
3373
|
-
config: __props.config,
|
|
3374
|
-
name: name.value,
|
|
3375
|
-
disabled: disabled.value,
|
|
3376
|
-
prop: itemProp.value,
|
|
3377
3437
|
onChange: onChangeHandler,
|
|
3378
3438
|
onAddDiffCount
|
|
3379
|
-
}, null,
|
|
3439
|
+
}), null, 16, ["model", "last-values"]))
|
|
3380
3440
|
]),
|
|
3381
3441
|
_: 1
|
|
3382
3442
|
/* STABLE */
|
|
3383
|
-
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
3384
|
-
key: key(__props.config),
|
|
3385
|
-
size: __props.size,
|
|
3443
|
+
}, 8, ["placement"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps({ key: 1 }, fieldsProps.value, {
|
|
3386
3444
|
model: __props.model,
|
|
3387
3445
|
"last-values": __props.lastValues,
|
|
3388
|
-
config: __props.config,
|
|
3389
|
-
name: name.value,
|
|
3390
|
-
disabled: disabled.value,
|
|
3391
|
-
prop: itemProp.value,
|
|
3392
3446
|
onChange: onChangeHandler,
|
|
3393
3447
|
onAddDiffCount
|
|
3394
|
-
}, null,
|
|
3395
|
-
extra.value && type.value !== "table" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3396
|
-
key: 2,
|
|
3397
|
-
innerHTML: extra.value,
|
|
3398
|
-
class: "m-form-tip"
|
|
3399
|
-
}, null, 8, _hoisted_4$3)) : vue.createCommentVNode("v-if", true)
|
|
3448
|
+
}), null, 16, ["model", "last-values"]))
|
|
3400
3449
|
]),
|
|
3401
3450
|
_: 1
|
|
3402
3451
|
/* STABLE */
|
|
3403
|
-
},
|
|
3452
|
+
}, 16, ["class"]),
|
|
3404
3453
|
__props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3405
3454
|
key: 0,
|
|
3406
3455
|
placement: "left"
|
|
@@ -3408,7 +3457,7 @@
|
|
|
3408
3457
|
content: vue.withCtx(() => [
|
|
3409
3458
|
vue.createElementVNode("div", {
|
|
3410
3459
|
innerHTML: __props.config.tip
|
|
3411
|
-
}, null, 8,
|
|
3460
|
+
}, null, 8, _hoisted_4$3)
|
|
3412
3461
|
]),
|
|
3413
3462
|
default: vue.withCtx(() => [
|
|
3414
3463
|
vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -3431,58 +3480,41 @@
|
|
|
3431
3480
|
[
|
|
3432
3481
|
vue.createCommentVNode(" 对比 "),
|
|
3433
3482
|
vue.createCommentVNode(" 上次内容 "),
|
|
3434
|
-
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
prop: itemProp.value,
|
|
3438
|
-
"label-width": itemLabelWidth.value,
|
|
3439
|
-
"label-position": __props.config.labelPosition,
|
|
3440
|
-
rules: rule.value
|
|
3441
|
-
}, {
|
|
3483
|
+
vue.createVNode(vue.unref(design.TMagicFormItem), vue.mergeProps(formItemProps.value, {
|
|
3484
|
+
class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
|
|
3485
|
+
}), {
|
|
3442
3486
|
label: vue.withCtx(() => [
|
|
3443
3487
|
vue.createElementVNode("span", {
|
|
3444
3488
|
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
3445
3489
|
title: __props.config.labelTitle
|
|
3446
|
-
}, null, 8,
|
|
3490
|
+
}, null, 8, _hoisted_5$3)
|
|
3447
3491
|
]),
|
|
3448
3492
|
default: vue.withCtx(() => [
|
|
3449
|
-
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3493
|
+
tooltip.value.text ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3494
|
+
key: 0,
|
|
3495
|
+
placement: tooltip.value.placement
|
|
3496
|
+
}, {
|
|
3450
3497
|
content: vue.withCtx(() => [
|
|
3451
|
-
vue.createElementVNode("div", {
|
|
3498
|
+
vue.createElementVNode("div", {
|
|
3499
|
+
innerHTML: tooltip.value.text
|
|
3500
|
+
}, null, 8, _hoisted_6$1)
|
|
3452
3501
|
]),
|
|
3453
3502
|
default: vue.withCtx(() => [
|
|
3454
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
3455
|
-
key: key(__props.config),
|
|
3456
|
-
size: __props.size,
|
|
3503
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps(fieldsProps.value, {
|
|
3457
3504
|
model: __props.lastValues,
|
|
3458
|
-
config: __props.config,
|
|
3459
|
-
name: name.value,
|
|
3460
|
-
disabled: disabled.value,
|
|
3461
|
-
prop: itemProp.value,
|
|
3462
3505
|
onChange: onChangeHandler
|
|
3463
|
-
}, null,
|
|
3506
|
+
}), null, 16, ["model"]))
|
|
3464
3507
|
]),
|
|
3465
3508
|
_: 1
|
|
3466
3509
|
/* STABLE */
|
|
3467
|
-
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
3468
|
-
key: key(__props.config),
|
|
3469
|
-
size: __props.size,
|
|
3510
|
+
}, 8, ["placement"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps({ key: 1 }, fieldsProps.value, {
|
|
3470
3511
|
model: __props.lastValues,
|
|
3471
|
-
config: __props.config,
|
|
3472
|
-
name: name.value,
|
|
3473
|
-
disabled: disabled.value,
|
|
3474
|
-
prop: itemProp.value,
|
|
3475
3512
|
onChange: onChangeHandler
|
|
3476
|
-
}, null,
|
|
3477
|
-
extra.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3478
|
-
key: 2,
|
|
3479
|
-
innerHTML: extra.value,
|
|
3480
|
-
class: "m-form-tip"
|
|
3481
|
-
}, null, 8, _hoisted_8$1)) : vue.createCommentVNode("v-if", true)
|
|
3513
|
+
}), null, 16, ["model"]))
|
|
3482
3514
|
]),
|
|
3483
3515
|
_: 1
|
|
3484
3516
|
/* STABLE */
|
|
3485
|
-
},
|
|
3517
|
+
}, 16, ["class"]),
|
|
3486
3518
|
__props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3487
3519
|
key: 0,
|
|
3488
3520
|
placement: "left"
|
|
@@ -3490,7 +3522,7 @@
|
|
|
3490
3522
|
content: vue.withCtx(() => [
|
|
3491
3523
|
vue.createElementVNode("div", {
|
|
3492
3524
|
innerHTML: __props.config.tip
|
|
3493
|
-
}, null, 8,
|
|
3525
|
+
}, null, 8, _hoisted_7$1)
|
|
3494
3526
|
]),
|
|
3495
3527
|
default: vue.withCtx(() => [
|
|
3496
3528
|
vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -3505,58 +3537,42 @@
|
|
|
3505
3537
|
/* STABLE */
|
|
3506
3538
|
})) : vue.createCommentVNode("v-if", true),
|
|
3507
3539
|
vue.createCommentVNode(" 当前内容 "),
|
|
3508
|
-
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
3509
|
-
style:
|
|
3510
|
-
class:
|
|
3511
|
-
|
|
3512
|
-
"label-width": itemLabelWidth.value,
|
|
3513
|
-
"label-position": __props.config.labelPosition,
|
|
3514
|
-
rules: rule.value
|
|
3515
|
-
}, {
|
|
3540
|
+
vue.createVNode(vue.unref(design.TMagicFormItem), vue.mergeProps(formItemProps.value, {
|
|
3541
|
+
style: __props.config.tip ? "flex: 1" : "",
|
|
3542
|
+
class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
|
|
3543
|
+
}), {
|
|
3516
3544
|
label: vue.withCtx(() => [
|
|
3517
3545
|
vue.createElementVNode("span", {
|
|
3518
3546
|
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
3519
3547
|
title: __props.config.labelTitle
|
|
3520
|
-
}, null, 8,
|
|
3548
|
+
}, null, 8, _hoisted_8$1)
|
|
3521
3549
|
]),
|
|
3522
3550
|
default: vue.withCtx(() => [
|
|
3523
|
-
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3551
|
+
tooltip.value.text ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3552
|
+
key: 0,
|
|
3553
|
+
placement: tooltip.value.placement
|
|
3554
|
+
}, {
|
|
3524
3555
|
content: vue.withCtx(() => [
|
|
3525
|
-
vue.createElementVNode("div", {
|
|
3556
|
+
vue.createElementVNode("div", {
|
|
3557
|
+
innerHTML: tooltip.value.text
|
|
3558
|
+
}, null, 8, _hoisted_9)
|
|
3526
3559
|
]),
|
|
3527
3560
|
default: vue.withCtx(() => [
|
|
3528
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
3529
|
-
key: key(__props.config),
|
|
3530
|
-
size: __props.size,
|
|
3561
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps(fieldsProps.value, {
|
|
3531
3562
|
model: __props.model,
|
|
3532
|
-
config: __props.config,
|
|
3533
|
-
name: name.value,
|
|
3534
|
-
disabled: disabled.value,
|
|
3535
|
-
prop: itemProp.value,
|
|
3536
3563
|
onChange: onChangeHandler
|
|
3537
|
-
}, null,
|
|
3564
|
+
}), null, 16, ["model"]))
|
|
3538
3565
|
]),
|
|
3539
3566
|
_: 1
|
|
3540
3567
|
/* STABLE */
|
|
3541
|
-
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
3542
|
-
key: key(__props.config),
|
|
3543
|
-
size: __props.size,
|
|
3568
|
+
}, 8, ["placement"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), vue.mergeProps({ key: 1 }, fieldsProps.value, {
|
|
3544
3569
|
model: __props.model,
|
|
3545
|
-
config: __props.config,
|
|
3546
|
-
name: name.value,
|
|
3547
|
-
disabled: disabled.value,
|
|
3548
|
-
prop: itemProp.value,
|
|
3549
3570
|
onChange: onChangeHandler
|
|
3550
|
-
}, null,
|
|
3551
|
-
extra.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3552
|
-
key: 2,
|
|
3553
|
-
innerHTML: extra.value,
|
|
3554
|
-
class: "m-form-tip"
|
|
3555
|
-
}, null, 8, _hoisted_12)) : vue.createCommentVNode("v-if", true)
|
|
3571
|
+
}), null, 16, ["model"]))
|
|
3556
3572
|
]),
|
|
3557
3573
|
_: 1
|
|
3558
3574
|
/* STABLE */
|
|
3559
|
-
},
|
|
3575
|
+
}, 16, ["style", "class"]),
|
|
3560
3576
|
__props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3561
3577
|
key: 1,
|
|
3562
3578
|
placement: "left"
|
|
@@ -3564,7 +3580,7 @@
|
|
|
3564
3580
|
content: vue.withCtx(() => [
|
|
3565
3581
|
vue.createElementVNode("div", {
|
|
3566
3582
|
innerHTML: __props.config.tip
|
|
3567
|
-
}, null, 8,
|
|
3583
|
+
}, null, 8, _hoisted_10)
|
|
3568
3584
|
]),
|
|
3569
3585
|
default: vue.withCtx(() => [
|
|
3570
3586
|
vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -3612,7 +3628,7 @@
|
|
|
3612
3628
|
64
|
|
3613
3629
|
/* STABLE_FRAGMENT */
|
|
3614
3630
|
)) : vue.createCommentVNode("v-if", true),
|
|
3615
|
-
__props.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div",
|
|
3631
|
+
__props.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
|
|
3616
3632
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3617
3633
|
type: "primary",
|
|
3618
3634
|
size: "small",
|
|
@@ -3631,23 +3647,23 @@
|
|
|
3631
3647
|
/* STABLE */
|
|
3632
3648
|
})
|
|
3633
3649
|
])) : vue.createCommentVNode("v-if", true)
|
|
3634
|
-
], 14, _hoisted_1$
|
|
3650
|
+
], 14, _hoisted_1$d);
|
|
3635
3651
|
};
|
|
3636
3652
|
}
|
|
3637
3653
|
});
|
|
3638
3654
|
|
|
3639
|
-
const _hoisted_1$
|
|
3655
|
+
const _hoisted_1$c = ["innerHTML"];
|
|
3640
3656
|
const _hoisted_2$6 = ["innerHTML"];
|
|
3641
|
-
const _hoisted_3$
|
|
3657
|
+
const _hoisted_3$5 = { key: 1 };
|
|
3642
3658
|
const _hoisted_4$2 = ["innerHTML"];
|
|
3643
3659
|
const _hoisted_5$2 = ["innerHTML"];
|
|
3644
|
-
const _hoisted_6
|
|
3660
|
+
const _hoisted_6 = {
|
|
3645
3661
|
key: 2,
|
|
3646
3662
|
style: { "display": "flex" }
|
|
3647
3663
|
};
|
|
3648
3664
|
const _hoisted_7 = { style: { "flex": "1" } };
|
|
3649
3665
|
const _hoisted_8 = ["src"];
|
|
3650
|
-
const _sfc_main$
|
|
3666
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
3651
3667
|
...{
|
|
3652
3668
|
name: "MFormFieldset"
|
|
3653
3669
|
},
|
|
@@ -3669,9 +3685,27 @@
|
|
|
3669
3685
|
const emit = __emit;
|
|
3670
3686
|
const mForm = vue.inject("mForm");
|
|
3671
3687
|
const name = vue.computed(() => props.config.name || "");
|
|
3688
|
+
const checkboxName = vue.computed(() => {
|
|
3689
|
+
if (typeof props.config.checkbox === "object" && typeof props.config.checkbox.name === "string") {
|
|
3690
|
+
return props.config.checkbox.name;
|
|
3691
|
+
}
|
|
3692
|
+
return "value";
|
|
3693
|
+
});
|
|
3694
|
+
const checkboxTrueValue = vue.computed(() => {
|
|
3695
|
+
if (typeof props.config.checkbox === "object" && typeof props.config.checkbox.trueValue !== "undefined") {
|
|
3696
|
+
return props.config.checkbox.trueValue;
|
|
3697
|
+
}
|
|
3698
|
+
return 1;
|
|
3699
|
+
});
|
|
3700
|
+
const checkboxFalseValue = vue.computed(() => {
|
|
3701
|
+
if (typeof props.config.checkbox === "object" && typeof props.config.checkbox.falseValue !== "undefined") {
|
|
3702
|
+
return props.config.checkbox.falseValue;
|
|
3703
|
+
}
|
|
3704
|
+
return 0;
|
|
3705
|
+
});
|
|
3672
3706
|
const show = vue.computed(() => {
|
|
3673
|
-
if (props.config.expand &&
|
|
3674
|
-
return props.model[name.value]?.value;
|
|
3707
|
+
if (props.config.expand && checkboxName.value) {
|
|
3708
|
+
return (name.value ? props.model[name.value] : props.model)?.[checkboxName.value] === checkboxTrueValue.value;
|
|
3675
3709
|
}
|
|
3676
3710
|
return true;
|
|
3677
3711
|
});
|
|
@@ -3682,7 +3716,7 @@
|
|
|
3682
3716
|
return props.config.labelWidth || props.labelWidth || (props.config.text ? void 0 : "0");
|
|
3683
3717
|
});
|
|
3684
3718
|
const valueChangeHandler = (value) => {
|
|
3685
|
-
emit("change", value, { modifyKey:
|
|
3719
|
+
emit("change", value, { modifyKey: checkboxName.value });
|
|
3686
3720
|
};
|
|
3687
3721
|
const changeHandler = (v, eventData) => emit("change", v, eventData);
|
|
3688
3722
|
const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
|
|
@@ -3699,19 +3733,16 @@
|
|
|
3699
3733
|
name.value && __props.config.checkbox ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!show.value ? "div" : "legend"), { key: 0 }, {
|
|
3700
3734
|
default: vue.withCtx(() => [
|
|
3701
3735
|
vue.createVNode(vue.unref(design.TMagicCheckbox), {
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
prop: `${__props.prop}${__props.prop ? "." : ""}${__props.config.name}.value`,
|
|
3708
|
-
"true-value": 1,
|
|
3709
|
-
"false-value": 0
|
|
3736
|
+
"model-value": (name.value ? __props.model[name.value] : __props.model)[checkboxName.value],
|
|
3737
|
+
prop: `${__props.prop}${__props.prop ? "." : ""}${__props.config.name}.${checkboxName.value}`,
|
|
3738
|
+
"true-value": checkboxTrueValue.value,
|
|
3739
|
+
"false-value": checkboxFalseValue.value,
|
|
3740
|
+
"onUpdate:modelValue": valueChangeHandler
|
|
3710
3741
|
}, {
|
|
3711
3742
|
default: vue.withCtx(() => [
|
|
3712
3743
|
vue.createElementVNode("span", {
|
|
3713
3744
|
innerHTML: __props.config.legend
|
|
3714
|
-
}, null, 8, _hoisted_1$
|
|
3745
|
+
}, null, 8, _hoisted_1$c),
|
|
3715
3746
|
__props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3716
3747
|
key: 0,
|
|
3717
3748
|
innerHTML: __props.config.extra,
|
|
@@ -3720,11 +3751,11 @@
|
|
|
3720
3751
|
]),
|
|
3721
3752
|
_: 1
|
|
3722
3753
|
/* STABLE */
|
|
3723
|
-
}, 8, ["
|
|
3754
|
+
}, 8, ["model-value", "prop", "true-value", "false-value"])
|
|
3724
3755
|
]),
|
|
3725
3756
|
_: 1
|
|
3726
3757
|
/* STABLE */
|
|
3727
|
-
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$
|
|
3758
|
+
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$5, [
|
|
3728
3759
|
vue.createElementVNode("span", {
|
|
3729
3760
|
innerHTML: __props.config.legend
|
|
3730
3761
|
}, null, 8, _hoisted_4$2),
|
|
@@ -3734,13 +3765,13 @@
|
|
|
3734
3765
|
class: "m-form-tip"
|
|
3735
3766
|
}, null, 8, _hoisted_5$2)) : vue.createCommentVNode("v-if", true)
|
|
3736
3767
|
])),
|
|
3737
|
-
__props.config.schematic && show.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6
|
|
3768
|
+
__props.config.schematic && show.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
3738
3769
|
vue.createElementVNode("div", _hoisted_7, [
|
|
3739
3770
|
(vue.openBlock(true), vue.createElementBlock(
|
|
3740
3771
|
vue.Fragment,
|
|
3741
3772
|
null,
|
|
3742
3773
|
vue.renderList(__props.config.items, (item, index) => {
|
|
3743
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3774
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
3744
3775
|
key: key(item, index),
|
|
3745
3776
|
model: name.value ? __props.model[name.value] : __props.model,
|
|
3746
3777
|
lastValues: name.value ? __props.lastValues[name.value] : __props.lastValues,
|
|
@@ -3752,7 +3783,7 @@
|
|
|
3752
3783
|
labelWidth: lWidth.value,
|
|
3753
3784
|
size: __props.size,
|
|
3754
3785
|
onChange: changeHandler,
|
|
3755
|
-
onAddDiffCount: _cache[
|
|
3786
|
+
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
3756
3787
|
}, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
|
|
3757
3788
|
}),
|
|
3758
3789
|
128
|
|
@@ -3767,7 +3798,7 @@
|
|
|
3767
3798
|
vue.Fragment,
|
|
3768
3799
|
{ key: 3 },
|
|
3769
3800
|
vue.renderList(__props.config.items, (item, index) => {
|
|
3770
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3801
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
3771
3802
|
key: key(item, index),
|
|
3772
3803
|
model: name.value ? __props.model[name.value] : __props.model,
|
|
3773
3804
|
lastValues: name.value ? __props.lastValues[name.value] : __props.lastValues,
|
|
@@ -3779,7 +3810,7 @@
|
|
|
3779
3810
|
size: __props.size,
|
|
3780
3811
|
disabled: __props.disabled,
|
|
3781
3812
|
onChange: changeHandler,
|
|
3782
|
-
onAddDiffCount: _cache[
|
|
3813
|
+
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
3783
3814
|
}, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
|
|
3784
3815
|
}),
|
|
3785
3816
|
128
|
|
@@ -3793,10 +3824,73 @@
|
|
|
3793
3824
|
}
|
|
3794
3825
|
});
|
|
3795
3826
|
|
|
3796
|
-
const
|
|
3827
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
3828
|
+
...{
|
|
3829
|
+
name: "MFormFlexLayout"
|
|
3830
|
+
},
|
|
3831
|
+
__name: "FlexLayout",
|
|
3832
|
+
props: {
|
|
3833
|
+
model: {},
|
|
3834
|
+
lastValues: {},
|
|
3835
|
+
isCompare: { type: Boolean },
|
|
3836
|
+
config: {},
|
|
3837
|
+
name: {},
|
|
3838
|
+
labelWidth: {},
|
|
3839
|
+
prop: {},
|
|
3840
|
+
size: {},
|
|
3841
|
+
disabled: { type: Boolean }
|
|
3842
|
+
},
|
|
3843
|
+
emits: ["change", "addDiffCount"],
|
|
3844
|
+
setup(__props, { emit: __emit }) {
|
|
3845
|
+
const props = __props;
|
|
3846
|
+
const emit = __emit;
|
|
3847
|
+
const mForm = vue.inject("mForm");
|
|
3848
|
+
const gap = vue.computed(() => props.config.gap || "16px");
|
|
3849
|
+
const changeHandler = (v, eventData) => {
|
|
3850
|
+
emit("change", props.model, eventData);
|
|
3851
|
+
};
|
|
3852
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
3853
|
+
return (_ctx, _cache) => {
|
|
3854
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
3855
|
+
"div",
|
|
3856
|
+
{
|
|
3857
|
+
class: "m-form-flex-layout",
|
|
3858
|
+
style: vue.normalizeStyle({ display: "flex", flexWrap: "wrap", gap: gap.value })
|
|
3859
|
+
},
|
|
3860
|
+
[
|
|
3861
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
3862
|
+
vue.Fragment,
|
|
3863
|
+
null,
|
|
3864
|
+
vue.renderList(__props.config.items, (item, index) => {
|
|
3865
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
3866
|
+
key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
3867
|
+
config: item,
|
|
3868
|
+
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
3869
|
+
lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
3870
|
+
"is-compare": __props.isCompare,
|
|
3871
|
+
prop: __props.prop,
|
|
3872
|
+
size: __props.size,
|
|
3873
|
+
disabled: __props.disabled,
|
|
3874
|
+
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
3875
|
+
onChange: changeHandler,
|
|
3876
|
+
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
3877
|
+
}, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
|
|
3878
|
+
}),
|
|
3879
|
+
128
|
|
3880
|
+
/* KEYED_FRAGMENT */
|
|
3881
|
+
))
|
|
3882
|
+
],
|
|
3883
|
+
4
|
|
3884
|
+
/* STYLE */
|
|
3885
|
+
);
|
|
3886
|
+
};
|
|
3887
|
+
}
|
|
3888
|
+
});
|
|
3889
|
+
|
|
3890
|
+
const _hoisted_1$b = { class: "m-fields-group-list-item" };
|
|
3797
3891
|
const _hoisted_2$5 = { style: { "text-align": "right", "margin-top": "20px" } };
|
|
3798
|
-
const _hoisted_3$
|
|
3799
|
-
const _sfc_main$
|
|
3892
|
+
const _hoisted_3$4 = ["innerHTML"];
|
|
3893
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
3800
3894
|
...{
|
|
3801
3895
|
name: "MFormGroupListItem"
|
|
3802
3896
|
},
|
|
@@ -3874,7 +3968,7 @@
|
|
|
3874
3968
|
emit("swap-item", props.index, moveSpecifyLocationIndex.value - 1);
|
|
3875
3969
|
};
|
|
3876
3970
|
return (_ctx, _cache) => {
|
|
3877
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3971
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
3878
3972
|
vue.createElementVNode("div", null, [
|
|
3879
3973
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3880
3974
|
link: "",
|
|
@@ -4063,9 +4157,9 @@
|
|
|
4063
4157
|
key: 3,
|
|
4064
4158
|
innerHTML: itemExtra.value,
|
|
4065
4159
|
class: "m-form-tip"
|
|
4066
|
-
}, null, 8, _hoisted_3$
|
|
4160
|
+
}, null, 8, _hoisted_3$4)) : vue.createCommentVNode("v-if", true)
|
|
4067
4161
|
]),
|
|
4068
|
-
expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4162
|
+
expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
4069
4163
|
key: 0,
|
|
4070
4164
|
config: rowConfig.value,
|
|
4071
4165
|
model: __props.model,
|
|
@@ -4083,13 +4177,13 @@
|
|
|
4083
4177
|
}
|
|
4084
4178
|
});
|
|
4085
4179
|
|
|
4086
|
-
const _hoisted_1$
|
|
4180
|
+
const _hoisted_1$a = { class: "m-fields-group-list" };
|
|
4087
4181
|
const _hoisted_2$4 = ["innerHTML"];
|
|
4088
|
-
const _hoisted_3$
|
|
4182
|
+
const _hoisted_3$3 = {
|
|
4089
4183
|
key: 1,
|
|
4090
4184
|
class: "el-table__empty-block"
|
|
4091
4185
|
};
|
|
4092
|
-
const _sfc_main$
|
|
4186
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
4093
4187
|
...{
|
|
4094
4188
|
name: "MFormGroupList"
|
|
4095
4189
|
},
|
|
@@ -4179,13 +4273,13 @@
|
|
|
4179
4273
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
4180
4274
|
const getLastValues = (item, index) => item?.[index] || {};
|
|
4181
4275
|
return (_ctx, _cache) => {
|
|
4182
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4276
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
4183
4277
|
__props.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4184
4278
|
key: 0,
|
|
4185
4279
|
innerHTML: __props.config.extra,
|
|
4186
4280
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
4187
4281
|
}, null, 8, _hoisted_2$4)) : vue.createCommentVNode("v-if", true),
|
|
4188
|
-
!__props.model[__props.name] || !__props.model[__props.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
4282
|
+
!__props.model[__props.name] || !__props.model[__props.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [..._cache[1] || (_cache[1] = [
|
|
4189
4283
|
vue.createElementVNode(
|
|
4190
4284
|
"span",
|
|
4191
4285
|
{ class: "el-table__empty-text" },
|
|
@@ -4197,7 +4291,7 @@
|
|
|
4197
4291
|
vue.Fragment,
|
|
4198
4292
|
{ key: 2 },
|
|
4199
4293
|
vue.renderList(__props.model[__props.name], (item, index) => {
|
|
4200
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4294
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
4201
4295
|
key: index,
|
|
4202
4296
|
model: item,
|
|
4203
4297
|
lastValues: getLastValues(__props.lastValues[__props.name], index),
|
|
@@ -4257,15 +4351,15 @@
|
|
|
4257
4351
|
}
|
|
4258
4352
|
});
|
|
4259
4353
|
|
|
4260
|
-
const _hoisted_1$
|
|
4354
|
+
const _hoisted_1$9 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
|
|
4261
4355
|
const _hoisted_2$3 = ["innerHTML"];
|
|
4262
|
-
const _hoisted_3$
|
|
4356
|
+
const _hoisted_3$2 = {
|
|
4263
4357
|
key: 0,
|
|
4264
4358
|
style: { "display": "flex" }
|
|
4265
4359
|
};
|
|
4266
4360
|
const _hoisted_4$1 = { style: { "flex": "1" } };
|
|
4267
4361
|
const _hoisted_5$1 = ["src"];
|
|
4268
|
-
const _sfc_main$
|
|
4362
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
4269
4363
|
...{
|
|
4270
4364
|
name: "MFormPanel"
|
|
4271
4365
|
},
|
|
@@ -4300,7 +4394,7 @@
|
|
|
4300
4394
|
"body-style": { display: expand.value ? "block" : "none" }
|
|
4301
4395
|
}, {
|
|
4302
4396
|
header: vue.withCtx(() => [
|
|
4303
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4397
|
+
vue.createElementVNode("div", _hoisted_1$9, [
|
|
4304
4398
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4305
4399
|
style: { "padding": "0" },
|
|
4306
4400
|
link: "",
|
|
@@ -4324,13 +4418,13 @@
|
|
|
4324
4418
|
default: vue.withCtx(() => [
|
|
4325
4419
|
vue.createElementVNode("div", null, [
|
|
4326
4420
|
vue.renderSlot(_ctx.$slots, "default"),
|
|
4327
|
-
__props.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
4421
|
+
__props.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
|
|
4328
4422
|
vue.createElementVNode("div", _hoisted_4$1, [
|
|
4329
4423
|
(vue.openBlock(true), vue.createElementBlock(
|
|
4330
4424
|
vue.Fragment,
|
|
4331
4425
|
null,
|
|
4332
4426
|
vue.renderList(items.value, (item, index) => {
|
|
4333
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4427
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
4334
4428
|
key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
4335
4429
|
config: item,
|
|
4336
4430
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
@@ -4356,7 +4450,7 @@
|
|
|
4356
4450
|
vue.Fragment,
|
|
4357
4451
|
{ key: 1 },
|
|
4358
4452
|
vue.renderList(items.value, (item, index) => {
|
|
4359
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4453
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
4360
4454
|
key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
4361
4455
|
config: item,
|
|
4362
4456
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
@@ -4382,7 +4476,7 @@
|
|
|
4382
4476
|
}
|
|
4383
4477
|
});
|
|
4384
4478
|
|
|
4385
|
-
const _sfc_main$
|
|
4479
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
4386
4480
|
...{
|
|
4387
4481
|
name: "MFormCol"
|
|
4388
4482
|
},
|
|
@@ -4410,7 +4504,7 @@
|
|
|
4410
4504
|
return (_ctx, _cache) => {
|
|
4411
4505
|
return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCol), { span: __props.span }, {
|
|
4412
4506
|
default: vue.withCtx(() => [
|
|
4413
|
-
vue.createVNode(_sfc_main$
|
|
4507
|
+
vue.createVNode(_sfc_main$A, {
|
|
4414
4508
|
model: __props.model,
|
|
4415
4509
|
lastValues: __props.lastValues,
|
|
4416
4510
|
"is-compare": __props.isCompare,
|
|
@@ -4433,7 +4527,7 @@
|
|
|
4433
4527
|
}
|
|
4434
4528
|
});
|
|
4435
4529
|
|
|
4436
|
-
const _sfc_main$
|
|
4530
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
4437
4531
|
...{
|
|
4438
4532
|
name: "MFormRow"
|
|
4439
4533
|
},
|
|
@@ -4466,7 +4560,7 @@
|
|
|
4466
4560
|
vue.Fragment,
|
|
4467
4561
|
null,
|
|
4468
4562
|
vue.renderList(__props.config.items, (col, index) => {
|
|
4469
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4563
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$u, {
|
|
4470
4564
|
key: col[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
4471
4565
|
span: col.span || __props.config.span || 24 / __props.config.items.length,
|
|
4472
4566
|
config: col,
|
|
@@ -4493,7 +4587,7 @@
|
|
|
4493
4587
|
}
|
|
4494
4588
|
});
|
|
4495
4589
|
|
|
4496
|
-
const _sfc_main$
|
|
4590
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
4497
4591
|
...{
|
|
4498
4592
|
name: "MFormStep"
|
|
4499
4593
|
},
|
|
@@ -4568,7 +4662,7 @@
|
|
|
4568
4662
|
vue.Fragment,
|
|
4569
4663
|
null,
|
|
4570
4664
|
[
|
|
4571
|
-
item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4665
|
+
item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
4572
4666
|
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
4573
4667
|
config: item,
|
|
4574
4668
|
model: step.name ? __props.model[step.name] : __props.model,
|
|
@@ -4604,1044 +4698,325 @@
|
|
|
4604
4698
|
}
|
|
4605
4699
|
});
|
|
4606
4700
|
|
|
4607
|
-
const
|
|
4608
|
-
const _hoisted_2$2 = ["innerHTML"];
|
|
4609
|
-
const _hoisted_3 = ["innerHTML"];
|
|
4610
|
-
const _hoisted_4 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
|
|
4611
|
-
const _hoisted_5 = { style: { "display": "flex" } };
|
|
4612
|
-
const _hoisted_6 = {
|
|
4613
|
-
key: 1,
|
|
4614
|
-
class: "bottom",
|
|
4615
|
-
style: { "text-align": "right" }
|
|
4616
|
-
};
|
|
4617
|
-
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
4701
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
4618
4702
|
...{
|
|
4619
|
-
name: "
|
|
4703
|
+
name: "MFormTabs"
|
|
4620
4704
|
},
|
|
4621
|
-
__name: "
|
|
4705
|
+
__name: "Tabs",
|
|
4622
4706
|
props: {
|
|
4623
4707
|
model: {},
|
|
4624
4708
|
lastValues: { default: () => ({}) },
|
|
4625
4709
|
isCompare: { type: Boolean, default: false },
|
|
4626
4710
|
config: {},
|
|
4627
4711
|
name: {},
|
|
4628
|
-
prop: { default: "" },
|
|
4629
|
-
labelWidth: {},
|
|
4630
|
-
sort: { type: Boolean },
|
|
4631
|
-
disabled: { type: Boolean },
|
|
4632
|
-
sortKey: { default: "" },
|
|
4633
|
-
text: {},
|
|
4634
4712
|
size: {},
|
|
4635
|
-
|
|
4636
|
-
|
|
4713
|
+
labelWidth: {},
|
|
4714
|
+
prop: {},
|
|
4715
|
+
expandMore: { type: Boolean },
|
|
4716
|
+
disabled: { type: Boolean }
|
|
4637
4717
|
},
|
|
4638
|
-
emits: ["change", "
|
|
4639
|
-
setup(__props, {
|
|
4640
|
-
const
|
|
4641
|
-
const
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
const pagecontext = vue.ref(0);
|
|
4650
|
-
const updateKey = vue.ref(1);
|
|
4651
|
-
const isFullscreen = vue.ref(false);
|
|
4652
|
-
const modelName = vue.computed(() => props.name || props.config.name || "");
|
|
4653
|
-
const getDataByPage = (data2 = []) => data2.filter(
|
|
4654
|
-
(item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value
|
|
4655
|
-
);
|
|
4656
|
-
const pageinationData = vue.computed(() => getDataByPage(props.model[modelName.value]));
|
|
4657
|
-
const data = vue.computed(() => props.config.pagination ? pageinationData.value : props.model[modelName.value]);
|
|
4658
|
-
const lastData = vue.computed(
|
|
4659
|
-
() => props.config.pagination ? getDataByPage(props.lastValues[modelName.value]) : props.lastValues[modelName.value] || []
|
|
4660
|
-
);
|
|
4661
|
-
const sortChange = ({ prop, order }) => {
|
|
4662
|
-
if (order === "ascending") {
|
|
4663
|
-
props.model[modelName.value] = props.model[modelName.value].sort((a, b) => a[prop] - b[prop]);
|
|
4664
|
-
} else if (order === "descending") {
|
|
4665
|
-
props.model[modelName.value] = props.model[modelName.value].sort((a, b) => b[prop] - a[prop]);
|
|
4666
|
-
}
|
|
4718
|
+
emits: ["change", "addDiffCount"],
|
|
4719
|
+
setup(__props, { emit: __emit }) {
|
|
4720
|
+
const tabPaneComponent = design.getDesignConfig("components")?.tabPane;
|
|
4721
|
+
const tabsComponent = design.getDesignConfig("components")?.tabs;
|
|
4722
|
+
const getActive = (mForm2, props2, activeTabName2) => {
|
|
4723
|
+
const { config, model, prop } = props2;
|
|
4724
|
+
const { active } = config;
|
|
4725
|
+
if (typeof active === "function") return active(mForm2, { model, formValue: mForm2?.values, prop });
|
|
4726
|
+
if (0 >= props2.config.items.length) return "0";
|
|
4727
|
+
if (typeof active !== "undefined") return active;
|
|
4728
|
+
return "0";
|
|
4667
4729
|
};
|
|
4668
|
-
const
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
}
|
|
4730
|
+
const tabClick = (mForm2, tab, props2) => {
|
|
4731
|
+
const { config, model, prop } = props2;
|
|
4732
|
+
tab.name = tab.paneName;
|
|
4733
|
+
if (typeof config.onTabClick === "function") {
|
|
4734
|
+
config.onTabClick(mForm2, tab, { model, formValue: mForm2?.values, prop, config });
|
|
4674
4735
|
}
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
const rowDrop = () => {
|
|
4679
|
-
sortable?.destroy();
|
|
4680
|
-
const tableEl = tMagicTable.value?.instance.$el;
|
|
4681
|
-
const tBodyEl = tableEl?.querySelector(".el-table__body > tbody");
|
|
4682
|
-
if (!tBodyEl) {
|
|
4683
|
-
return;
|
|
4736
|
+
const tabConfig = config.items.find((item) => tab.name === item.status);
|
|
4737
|
+
if (tabConfig && typeof tabConfig.onTabClick === "function") {
|
|
4738
|
+
tabConfig.onTabClick(mForm2, tab, { model, formValue: mForm2?.values, prop, config });
|
|
4684
4739
|
}
|
|
4685
|
-
sortable = Sortable.create(tBodyEl, {
|
|
4686
|
-
draggable: ".tmagic-design-table-row",
|
|
4687
|
-
filter: "input",
|
|
4688
|
-
// 表单组件选字操作和触发拖拽会冲突,优先保证选字操作
|
|
4689
|
-
preventOnFilter: false,
|
|
4690
|
-
// 允许选字
|
|
4691
|
-
direction: "vertical",
|
|
4692
|
-
onEnd: ({ newIndex, oldIndex }) => {
|
|
4693
|
-
if (typeof newIndex === "undefined") return;
|
|
4694
|
-
if (typeof oldIndex === "undefined") return;
|
|
4695
|
-
swapArray(newIndex, oldIndex);
|
|
4696
|
-
emit("change", props.model[modelName.value]);
|
|
4697
|
-
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
4698
|
-
}
|
|
4699
|
-
});
|
|
4700
4740
|
};
|
|
4701
|
-
const
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4741
|
+
const props = __props;
|
|
4742
|
+
const emit = __emit;
|
|
4743
|
+
const mForm = vue.inject("mForm");
|
|
4744
|
+
const activeTabName = vue.ref(getActive(mForm, props));
|
|
4745
|
+
const diffCount = vue.ref({});
|
|
4746
|
+
const tabs = vue.computed(() => {
|
|
4747
|
+
if (props.config.dynamic) {
|
|
4748
|
+
if (!props.config.name) throw new Error("dynamic tab 必须配置name");
|
|
4749
|
+
return props.model[props.config.name] || [];
|
|
4705
4750
|
}
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4751
|
+
return props.config.items.filter((item) => display(mForm, item.display, props));
|
|
4752
|
+
});
|
|
4753
|
+
const filter = (config) => filterFunction(mForm, config, props);
|
|
4754
|
+
vue.watchEffect(() => {
|
|
4755
|
+
if (typeof props.config.activeChange === "function") {
|
|
4756
|
+
props.config.activeChange(mForm, activeTabName.value, {
|
|
4757
|
+
model: props.model,
|
|
4710
4758
|
prop: props.prop
|
|
4711
4759
|
});
|
|
4712
|
-
if (!beforeCheckRes) return;
|
|
4713
4760
|
}
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
let inputs = {};
|
|
4720
|
-
if (enumValues.length) {
|
|
4721
|
-
if (length >= enumValues.length) {
|
|
4722
|
-
return;
|
|
4723
|
-
}
|
|
4724
|
-
enumV = enumValues.filter((item) => {
|
|
4725
|
-
let i = 0;
|
|
4726
|
-
for (; i < length; i++) {
|
|
4727
|
-
if (item[key] === props.model[modelName.value][i][key]) {
|
|
4728
|
-
break;
|
|
4729
|
-
}
|
|
4730
|
-
}
|
|
4731
|
-
return i === length;
|
|
4732
|
-
});
|
|
4733
|
-
if (enumV.length > 0) {
|
|
4734
|
-
inputs = enumV[0];
|
|
4735
|
-
}
|
|
4736
|
-
} else if (Array.isArray(row)) {
|
|
4737
|
-
columns.forEach((column, index) => {
|
|
4738
|
-
column.name && (inputs[column.name] = row[index]);
|
|
4739
|
-
});
|
|
4761
|
+
});
|
|
4762
|
+
const tabItems = (tab) => props.config.dynamic ? props.config.items : tab.items;
|
|
4763
|
+
const tabClickHandler = (tab) => {
|
|
4764
|
+
if (typeof tab === "object") {
|
|
4765
|
+
tabClick(mForm, tab, props);
|
|
4740
4766
|
} else {
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
formValue: mForm?.values
|
|
4745
|
-
});
|
|
4746
|
-
} else if (props.config.defaultAdd) {
|
|
4747
|
-
inputs = props.config.defaultAdd;
|
|
4767
|
+
let item = tabs.value.find((tab2) => tab2.status === tab2);
|
|
4768
|
+
if (!item) {
|
|
4769
|
+
item = tabs.value[tab];
|
|
4748
4770
|
}
|
|
4749
|
-
|
|
4750
|
-
config: columns,
|
|
4751
|
-
initValues: inputs
|
|
4752
|
-
});
|
|
4771
|
+
tabClick(mForm, item, props);
|
|
4753
4772
|
}
|
|
4754
|
-
if (props.sortKey && length) {
|
|
4755
|
-
inputs[props.sortKey] = props.model[modelName.value][length - 1][props.sortKey] - 1;
|
|
4756
|
-
}
|
|
4757
|
-
props.model[modelName.value].push(inputs);
|
|
4758
|
-
emit("change", props.model[modelName.value], {
|
|
4759
|
-
changeRecords: [
|
|
4760
|
-
{
|
|
4761
|
-
propPath: `${props.prop}.${props.model[modelName.value].length - 1}`,
|
|
4762
|
-
value: inputs
|
|
4763
|
-
}
|
|
4764
|
-
]
|
|
4765
|
-
});
|
|
4766
4773
|
};
|
|
4767
|
-
|
|
4768
|
-
if (props.
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
props.model[modelName.value].sort((a, b) => b[props.sortKey] - a[props.sortKey]);
|
|
4775
|
-
}
|
|
4776
|
-
});
|
|
4777
|
-
vue.watchEffect(() => {
|
|
4778
|
-
if (props.config.dropSort) {
|
|
4779
|
-
rowDrop();
|
|
4780
|
-
}
|
|
4781
|
-
});
|
|
4782
|
-
const addable = vue.computed(() => {
|
|
4783
|
-
if (!props.model[modelName.value].length) {
|
|
4784
|
-
return true;
|
|
4785
|
-
}
|
|
4786
|
-
if (typeof props.config.addable === "function") {
|
|
4787
|
-
return props.config.addable(mForm, {
|
|
4788
|
-
model: props.model[modelName.value],
|
|
4789
|
-
formValue: mForm?.values,
|
|
4790
|
-
prop: props.prop
|
|
4774
|
+
const onTabAdd = async () => {
|
|
4775
|
+
if (!props.name) throw new Error("dynamic tab 必须配置name");
|
|
4776
|
+
if (typeof props.config.onTabAdd === "function") {
|
|
4777
|
+
props.config.onTabAdd(mForm, {
|
|
4778
|
+
model: props.model,
|
|
4779
|
+
prop: props.prop,
|
|
4780
|
+
config: props.config
|
|
4791
4781
|
});
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4782
|
+
emit("change", props.model);
|
|
4783
|
+
} else {
|
|
4784
|
+
const newObj = await initValue(mForm, {
|
|
4785
|
+
config: props.config.items,
|
|
4786
|
+
initValues: {}
|
|
4787
|
+
});
|
|
4788
|
+
newObj.title = `标签${tabs.value.length + 1}`;
|
|
4789
|
+
props.model[props.name].push(newObj);
|
|
4790
|
+
emit("change", props.model[props.name], {
|
|
4791
|
+
changeRecords: [
|
|
4792
|
+
{
|
|
4793
|
+
propPath: `${props.prop}.${props.model[props.name].length - 1}`,
|
|
4794
|
+
value: newObj
|
|
4795
|
+
}
|
|
4796
|
+
]
|
|
4806
4797
|
});
|
|
4807
4798
|
}
|
|
4808
|
-
|
|
4809
|
-
}
|
|
4810
|
-
const
|
|
4811
|
-
|
|
4812
|
-
if (typeof
|
|
4813
|
-
|
|
4814
|
-
values: mForm?.initValues,
|
|
4799
|
+
mForm?.$emit("field-change", props.prop, props.model[props.name]);
|
|
4800
|
+
};
|
|
4801
|
+
const onTabRemove = (tabName) => {
|
|
4802
|
+
if (!props.name) throw new Error("dynamic tab 必须配置name");
|
|
4803
|
+
if (typeof props.config.onTabRemove === "function") {
|
|
4804
|
+
props.config.onTabRemove(mForm, tabName, {
|
|
4815
4805
|
model: props.model,
|
|
4816
|
-
formValue: mForm ? mForm.values : props.model,
|
|
4817
4806
|
prop: props.prop,
|
|
4818
|
-
|
|
4807
|
+
config: props.config
|
|
4819
4808
|
});
|
|
4809
|
+
} else {
|
|
4810
|
+
props.model[props.name].splice(+tabName, 1);
|
|
4811
|
+
if (tabName < activeTabName.value || activeTabName.value >= props.model[props.name].length) {
|
|
4812
|
+
activeTabName.value = (+activeTabName.value - 1).toString();
|
|
4813
|
+
tabClick(mForm, { name: activeTabName.value }, props);
|
|
4814
|
+
}
|
|
4820
4815
|
}
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
const removeHandler = (index) => {
|
|
4824
|
-
if (props.disabled) return;
|
|
4825
|
-
props.model[modelName.value].splice(index, 1);
|
|
4826
|
-
emit("change", props.model[modelName.value]);
|
|
4827
|
-
};
|
|
4828
|
-
const selectHandle = (selection2, row) => {
|
|
4829
|
-
if (typeof props.config.selection === "string" && props.config.selection === "single") {
|
|
4830
|
-
tMagicTable.value?.clearSelection();
|
|
4831
|
-
tMagicTable.value?.toggleRowSelection(row, true);
|
|
4832
|
-
}
|
|
4833
|
-
emit("select", selection2, row);
|
|
4834
|
-
if (typeof props.config.onSelect === "function") {
|
|
4835
|
-
props.config.onSelect(mForm, { selection: selection2, row, config: props.config });
|
|
4836
|
-
}
|
|
4816
|
+
emit("change", props.model);
|
|
4817
|
+
mForm?.$emit("field-change", props.prop, props.model[props.name]);
|
|
4837
4818
|
};
|
|
4838
|
-
const
|
|
4839
|
-
|
|
4819
|
+
const changeHandler = (v, eventData) => {
|
|
4820
|
+
emit("change", props.model, eventData);
|
|
4840
4821
|
};
|
|
4841
|
-
const
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4822
|
+
const onAddDiffCount = (tabIndex) => {
|
|
4823
|
+
if (!diffCount.value[tabIndex]) {
|
|
4824
|
+
diffCount.value[tabIndex] = 1;
|
|
4825
|
+
} else {
|
|
4826
|
+
diffCount.value[tabIndex] += 1;
|
|
4845
4827
|
}
|
|
4846
|
-
|
|
4847
|
-
return newConfig;
|
|
4828
|
+
emit("addDiffCount");
|
|
4848
4829
|
};
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4830
|
+
return (_ctx, _cache) => {
|
|
4831
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent)?.component || "el-tabs"), vue.mergeProps(
|
|
4832
|
+
{
|
|
4833
|
+
modelValue: activeTabName.value,
|
|
4834
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event)
|
|
4835
|
+
},
|
|
4836
|
+
vue.unref(tabsComponent)?.props({
|
|
4837
|
+
type: __props.config.tabType,
|
|
4838
|
+
editable: __props.config.editable || false,
|
|
4839
|
+
tabPosition: __props.config.tabPosition || "top"
|
|
4840
|
+
}) || {},
|
|
4841
|
+
{
|
|
4842
|
+
class: `tmagic-design-tabs ${__props.config.dynamic ? "magic-form-dynamic-tab" : "magic-form-tab"}`,
|
|
4843
|
+
onTabClick: tabClickHandler,
|
|
4844
|
+
onTabAdd,
|
|
4845
|
+
onTabRemove
|
|
4846
|
+
}
|
|
4847
|
+
), {
|
|
4848
|
+
default: vue.withCtx(() => [
|
|
4849
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
4850
|
+
vue.Fragment,
|
|
4851
|
+
null,
|
|
4852
|
+
vue.renderList(tabs.value, (tab, tabIndex) => {
|
|
4853
|
+
return vue.openBlock(), vue.createBlock(
|
|
4854
|
+
vue.resolveDynamicComponent(vue.unref(tabPaneComponent)?.component || "el-tab-pane"),
|
|
4855
|
+
vue.mergeProps(
|
|
4856
|
+
{
|
|
4857
|
+
key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex
|
|
4858
|
+
},
|
|
4859
|
+
{ ref_for: true },
|
|
4860
|
+
vue.unref(tabPaneComponent)?.props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false }) || {}
|
|
4861
|
+
),
|
|
4862
|
+
{
|
|
4863
|
+
label: vue.withCtx(() => [
|
|
4864
|
+
vue.createElementVNode("span", null, [
|
|
4865
|
+
vue.createTextVNode(
|
|
4866
|
+
vue.toDisplayString(filter(tab.title)),
|
|
4867
|
+
1
|
|
4868
|
+
/* TEXT */
|
|
4869
|
+
),
|
|
4870
|
+
vue.createVNode(vue.unref(design.TMagicBadge), {
|
|
4871
|
+
hidden: !diffCount.value[tabIndex],
|
|
4872
|
+
value: diffCount.value[tabIndex],
|
|
4873
|
+
class: "diff-count-badge"
|
|
4874
|
+
}, null, 8, ["hidden", "value"])
|
|
4875
|
+
])
|
|
4876
|
+
]),
|
|
4877
|
+
default: vue.withCtx(() => [
|
|
4878
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
4879
|
+
vue.Fragment,
|
|
4880
|
+
null,
|
|
4881
|
+
vue.renderList(tabItems(tab), (item) => {
|
|
4882
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
4883
|
+
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
4884
|
+
config: item,
|
|
4885
|
+
disabled: __props.disabled,
|
|
4886
|
+
model: __props.config.dynamic ? (__props.name ? __props.model[__props.name] : __props.model)[tabIndex] : tab.name ? (__props.name ? __props.model[__props.name] : __props.model)[tab.name] : __props.name ? __props.model[__props.name] : __props.model,
|
|
4887
|
+
"last-values": vue.unref(isEmpty)(__props.lastValues) ? {} : __props.config.dynamic ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tabIndex] : tab.name ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tab.name] : __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
4888
|
+
"is-compare": __props.isCompare,
|
|
4889
|
+
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
|
|
4890
|
+
size: __props.size,
|
|
4891
|
+
"label-width": tab.labelWidth || __props.labelWidth,
|
|
4892
|
+
"expand-more": __props.expandMore,
|
|
4893
|
+
onChange: changeHandler,
|
|
4894
|
+
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
4895
|
+
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
4896
|
+
}),
|
|
4897
|
+
128
|
|
4898
|
+
/* KEYED_FRAGMENT */
|
|
4899
|
+
))
|
|
4900
|
+
]),
|
|
4901
|
+
_: 2
|
|
4902
|
+
/* DYNAMIC */
|
|
4903
|
+
},
|
|
4904
|
+
1040
|
|
4905
|
+
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
4906
|
+
);
|
|
4907
|
+
}),
|
|
4908
|
+
128
|
|
4909
|
+
/* KEYED_FRAGMENT */
|
|
4910
|
+
))
|
|
4911
|
+
]),
|
|
4912
|
+
_: 1
|
|
4913
|
+
/* STABLE */
|
|
4914
|
+
}, 16, ["modelValue", "class"]);
|
|
4857
4915
|
};
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4916
|
+
}
|
|
4917
|
+
});
|
|
4918
|
+
|
|
4919
|
+
let $MAGIC_FORM = {};
|
|
4920
|
+
const setConfig = (option) => {
|
|
4921
|
+
$MAGIC_FORM = option;
|
|
4922
|
+
};
|
|
4923
|
+
const getConfig = (key) => $MAGIC_FORM[key];
|
|
4924
|
+
|
|
4925
|
+
const useAddField = (prop) => {
|
|
4926
|
+
if (!prop) return;
|
|
4927
|
+
const mForm = vue.inject("mForm");
|
|
4928
|
+
const instance = vue.getCurrentInstance();
|
|
4929
|
+
vue.watch(
|
|
4930
|
+
() => instance?.proxy,
|
|
4931
|
+
(vm) => {
|
|
4932
|
+
if (vm) {
|
|
4933
|
+
mForm?.setField(prop, vm);
|
|
4934
|
+
} else {
|
|
4935
|
+
mForm?.deleteField(prop);
|
|
4861
4936
|
}
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4937
|
+
},
|
|
4938
|
+
{
|
|
4939
|
+
immediate: true
|
|
4940
|
+
}
|
|
4941
|
+
);
|
|
4942
|
+
};
|
|
4943
|
+
|
|
4944
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
4945
|
+
...{
|
|
4946
|
+
name: "MFormCascader"
|
|
4947
|
+
},
|
|
4948
|
+
__name: "Cascader",
|
|
4949
|
+
props: {
|
|
4950
|
+
config: {},
|
|
4951
|
+
model: {},
|
|
4952
|
+
initValues: {},
|
|
4953
|
+
values: {},
|
|
4954
|
+
name: {},
|
|
4955
|
+
prop: {},
|
|
4956
|
+
disabled: { type: Boolean },
|
|
4957
|
+
size: {},
|
|
4958
|
+
lastValues: {}
|
|
4959
|
+
},
|
|
4960
|
+
emits: ["change"],
|
|
4961
|
+
setup(__props, { emit: __emit }) {
|
|
4962
|
+
const props = __props;
|
|
4963
|
+
const emit = __emit;
|
|
4964
|
+
const mForm = vue.inject("mForm");
|
|
4965
|
+
useAddField(props.prop);
|
|
4966
|
+
const requestFunc = getConfig("request");
|
|
4967
|
+
const tMagicCascader = vue.ref();
|
|
4968
|
+
const options = vue.ref([]);
|
|
4969
|
+
const remoteData = vue.ref(null);
|
|
4970
|
+
const checkStrictly = vue.computed(() => filterFunction(mForm, props.config.checkStrictly, props));
|
|
4971
|
+
const valueSeparator = vue.computed(() => filterFunction(mForm, props.config.valueSeparator, props));
|
|
4972
|
+
const value = vue.computed(() => {
|
|
4973
|
+
if (typeof props.model[props.name] === "string" && valueSeparator.value) {
|
|
4974
|
+
return props.model[props.name].split(valueSeparator.value);
|
|
4866
4975
|
}
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4976
|
+
return props.model[props.name];
|
|
4977
|
+
});
|
|
4978
|
+
const updateModelValueHandler = (value2) => {
|
|
4979
|
+
let result = value2;
|
|
4980
|
+
if (valueSeparator.value) {
|
|
4981
|
+
result = value2.join(valueSeparator.value);
|
|
4982
|
+
}
|
|
4983
|
+
if (typeof result === "undefined") {
|
|
4984
|
+
if (Array.isArray(props.model[props.name])) {
|
|
4985
|
+
emit("change", []);
|
|
4986
|
+
} else if (typeof props.model[props.name] === "string") {
|
|
4987
|
+
emit("change", "");
|
|
4988
|
+
} else if (typeof props.model[props.name] === "object") {
|
|
4989
|
+
emit("change", null);
|
|
4990
|
+
}
|
|
4871
4991
|
}
|
|
4872
|
-
|
|
4873
|
-
swapArray(index, index + 1);
|
|
4874
|
-
timer = void 0;
|
|
4875
|
-
}, 300);
|
|
4992
|
+
emit("change", result);
|
|
4876
4993
|
};
|
|
4877
|
-
const
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4994
|
+
const setRemoteOptions = async function() {
|
|
4995
|
+
const { config } = props;
|
|
4996
|
+
const { option } = config;
|
|
4997
|
+
if (!option) return;
|
|
4998
|
+
let { body } = option;
|
|
4999
|
+
const postOptions = {
|
|
5000
|
+
url: option.url,
|
|
5001
|
+
cache: option.cache,
|
|
5002
|
+
timeout: option.timeout,
|
|
5003
|
+
data: {}
|
|
5004
|
+
};
|
|
5005
|
+
if (body && mForm) {
|
|
5006
|
+
if (typeof body === "function" && props.model && mForm) {
|
|
5007
|
+
body = body(mForm, {
|
|
5008
|
+
model: props.model,
|
|
5009
|
+
formValue: mForm.values,
|
|
5010
|
+
formValues: mForm.values,
|
|
5011
|
+
config: props.config
|
|
5012
|
+
});
|
|
5013
|
+
}
|
|
5014
|
+
postOptions.data = body;
|
|
4885
5015
|
}
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
return deleteFunc(props.model[modelName.value], index, mForm?.values);
|
|
4891
|
-
}
|
|
4892
|
-
return true;
|
|
4893
|
-
};
|
|
4894
|
-
const copyable = (index) => {
|
|
4895
|
-
const copyableFunc = props.config.copyable;
|
|
4896
|
-
if (copyableFunc && typeof copyableFunc === "function") {
|
|
4897
|
-
return copyableFunc(mForm, {
|
|
4898
|
-
values: mForm?.initValues || {},
|
|
4899
|
-
model: props.model,
|
|
4900
|
-
parent: mForm?.parentValues || {},
|
|
4901
|
-
formValue: mForm?.values || props.model,
|
|
4902
|
-
prop: props.prop,
|
|
4903
|
-
config: props.config,
|
|
4904
|
-
index
|
|
4905
|
-
});
|
|
4906
|
-
}
|
|
4907
|
-
return true;
|
|
4908
|
-
};
|
|
4909
|
-
const clearHandler = () => {
|
|
4910
|
-
const len = props.model[modelName.value].length;
|
|
4911
|
-
props.model[modelName.value].splice(0, len);
|
|
4912
|
-
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
4913
|
-
};
|
|
4914
|
-
const excelHandler = async (file) => {
|
|
4915
|
-
if (!file?.raw) {
|
|
4916
|
-
return false;
|
|
4917
|
-
}
|
|
4918
|
-
if (!globalThis.XLSX) {
|
|
4919
|
-
await utils.asyncLoadJs("https://cdn.bootcdn.net/ajax/libs/xlsx/0.17.0/xlsx.full.min.js");
|
|
4920
|
-
}
|
|
4921
|
-
const reader = new FileReader();
|
|
4922
|
-
reader.onload = () => {
|
|
4923
|
-
const data2 = reader.result;
|
|
4924
|
-
const pdata = globalThis.XLSX.read(data2, { type: "array" });
|
|
4925
|
-
pdata.SheetNames.forEach((sheetName) => {
|
|
4926
|
-
const arr = globalThis.XLSX.utils.sheet_to_json(pdata.Sheets[sheetName], { header: 1 });
|
|
4927
|
-
if (arr?.[0]) {
|
|
4928
|
-
arr.forEach((row) => {
|
|
4929
|
-
newHandler(row);
|
|
4930
|
-
});
|
|
4931
|
-
}
|
|
4932
|
-
setTimeout(() => {
|
|
4933
|
-
excelBtn.value?.clearFiles();
|
|
4934
|
-
}, 300);
|
|
4935
|
-
});
|
|
4936
|
-
};
|
|
4937
|
-
reader.readAsArrayBuffer(file.raw);
|
|
4938
|
-
return false;
|
|
4939
|
-
};
|
|
4940
|
-
const handleSizeChange = (val) => {
|
|
4941
|
-
pagesize.value = val;
|
|
4942
|
-
};
|
|
4943
|
-
const handleCurrentChange = (val) => {
|
|
4944
|
-
pagecontext.value = val - 1;
|
|
4945
|
-
};
|
|
4946
|
-
const copyHandler = (index) => {
|
|
4947
|
-
props.model[modelName.value].push(cloneDeep(props.model[modelName.value][index]));
|
|
4948
|
-
};
|
|
4949
|
-
const toggleMode = () => {
|
|
4950
|
-
const calcLabelWidth = (label) => {
|
|
4951
|
-
if (!label) return "0px";
|
|
4952
|
-
const zhLength = label.match(/[^\x00-\xff]/g)?.length || 0;
|
|
4953
|
-
const chLength = label.length - zhLength;
|
|
4954
|
-
return `${Math.max(chLength * 8 + zhLength * 20, 80)}px`;
|
|
4955
|
-
};
|
|
4956
|
-
props.config.type = "groupList";
|
|
4957
|
-
props.config.enableToggleMode = true;
|
|
4958
|
-
props.config.tableItems = props.config.items;
|
|
4959
|
-
props.config.items = props.config.groupItems || props.config.items.map((item) => {
|
|
4960
|
-
const text = item.text || item.label;
|
|
4961
|
-
const labelWidth = calcLabelWidth(text);
|
|
4962
|
-
return {
|
|
4963
|
-
...item,
|
|
4964
|
-
text,
|
|
4965
|
-
labelWidth,
|
|
4966
|
-
span: item.span || 12
|
|
4967
|
-
};
|
|
4968
|
-
});
|
|
4969
|
-
};
|
|
4970
|
-
const toggleFullscreen = () => {
|
|
4971
|
-
if (!mTable.value) return;
|
|
4972
|
-
if (isFullscreen.value) {
|
|
4973
|
-
mTable.value.classList.remove("fixed");
|
|
4974
|
-
isFullscreen.value = false;
|
|
4975
|
-
} else {
|
|
4976
|
-
mTable.value.classList.add("fixed");
|
|
4977
|
-
mTable.value.style.zIndex = `${nextZIndex()}`;
|
|
4978
|
-
isFullscreen.value = true;
|
|
4979
|
-
}
|
|
4980
|
-
};
|
|
4981
|
-
const getProp = (index) => {
|
|
4982
|
-
const { prop } = vue.toRefs(props);
|
|
4983
|
-
return `${prop.value}${prop.value ? "." : ""}${index + 1 + pagecontext.value * pagesize.value - 1}`;
|
|
4984
|
-
};
|
|
4985
|
-
const onAddDiffCount = () => emit("addDiffCount");
|
|
4986
|
-
const changeHandler = (v, eventData) => {
|
|
4987
|
-
emit("change", props.model, eventData);
|
|
4988
|
-
};
|
|
4989
|
-
__expose({
|
|
4990
|
-
toggleRowSelection
|
|
4991
|
-
});
|
|
4992
|
-
return (_ctx, _cache) => {
|
|
4993
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
4994
|
-
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
4995
|
-
to: "body",
|
|
4996
|
-
disabled: !isFullscreen.value
|
|
4997
|
-
}, [
|
|
4998
|
-
vue.createElementVNode(
|
|
4999
|
-
"div",
|
|
5000
|
-
{
|
|
5001
|
-
ref_key: "mTable",
|
|
5002
|
-
ref: mTable,
|
|
5003
|
-
class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": __props.config.itemExtra }])
|
|
5004
|
-
},
|
|
5005
|
-
[
|
|
5006
|
-
__props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
5007
|
-
key: 0,
|
|
5008
|
-
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
5009
|
-
innerHTML: __props.config.extra
|
|
5010
|
-
}, null, 8, _hoisted_2$2)) : vue.createCommentVNode("v-if", true),
|
|
5011
|
-
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
5012
|
-
content: "拖拽可排序",
|
|
5013
|
-
placement: "left-start",
|
|
5014
|
-
disabled: __props.config.dropSort !== true
|
|
5015
|
-
}, {
|
|
5016
|
-
default: vue.withCtx(() => [
|
|
5017
|
-
__props.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
|
|
5018
|
-
ref_key: "tMagicTable",
|
|
5019
|
-
ref: tMagicTable,
|
|
5020
|
-
style: { "width": "100%" },
|
|
5021
|
-
"row-key": __props.config.rowKey || "id",
|
|
5022
|
-
data: data.value,
|
|
5023
|
-
lastData: lastData.value,
|
|
5024
|
-
border: __props.config.border,
|
|
5025
|
-
"max-height": __props.config.maxHeight,
|
|
5026
|
-
"default-expand-all": true,
|
|
5027
|
-
key: updateKey.value,
|
|
5028
|
-
onSelect: selectHandle,
|
|
5029
|
-
onSortChange: sortChange
|
|
5030
|
-
}, {
|
|
5031
|
-
default: vue.withCtx(() => [
|
|
5032
|
-
__props.config.itemExtra && !__props.config.dropSort ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
5033
|
-
key: 0,
|
|
5034
|
-
fixed: "left",
|
|
5035
|
-
width: "30",
|
|
5036
|
-
type: "expand"
|
|
5037
|
-
}, {
|
|
5038
|
-
default: vue.withCtx((scope) => [
|
|
5039
|
-
vue.createElementVNode("span", {
|
|
5040
|
-
innerHTML: itemExtra(__props.config.itemExtra, scope.$index),
|
|
5041
|
-
class: "m-form-tip"
|
|
5042
|
-
}, null, 8, _hoisted_3)
|
|
5043
|
-
]),
|
|
5044
|
-
_: 1
|
|
5045
|
-
/* STABLE */
|
|
5046
|
-
})) : vue.createCommentVNode("v-if", true),
|
|
5047
|
-
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
5048
|
-
label: "操作",
|
|
5049
|
-
width: __props.config.operateColWidth || 100,
|
|
5050
|
-
align: "center",
|
|
5051
|
-
fixed: __props.config.fixed === false ? void 0 : "left"
|
|
5052
|
-
}, {
|
|
5053
|
-
default: vue.withCtx((scope) => [
|
|
5054
|
-
vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
|
|
5055
|
-
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5056
|
-
size: "small",
|
|
5057
|
-
type: "danger",
|
|
5058
|
-
link: "",
|
|
5059
|
-
title: "删除",
|
|
5060
|
-
icon: vue.unref(iconsVue.Delete),
|
|
5061
|
-
onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
5062
|
-
}, null, 8, ["icon", "onClick"]), [
|
|
5063
|
-
[vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
|
|
5064
|
-
]),
|
|
5065
|
-
copyable(scope.$index + 1 + pagecontext.value * pagesize.value - 1) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5066
|
-
key: 0,
|
|
5067
|
-
link: "",
|
|
5068
|
-
size: "small",
|
|
5069
|
-
type: "primary",
|
|
5070
|
-
title: "复制",
|
|
5071
|
-
icon: vue.unref(iconsVue.DocumentCopy),
|
|
5072
|
-
disabled: __props.disabled,
|
|
5073
|
-
onClick: ($event) => copyHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
5074
|
-
}, null, 8, ["icon", "disabled", "onClick"])) : vue.createCommentVNode("v-if", true)
|
|
5075
|
-
]),
|
|
5076
|
-
_: 3
|
|
5077
|
-
/* FORWARDED */
|
|
5078
|
-
}, 8, ["width", "fixed"]),
|
|
5079
|
-
__props.sort && __props.model[modelName.value] && __props.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
5080
|
-
key: 1,
|
|
5081
|
-
label: "排序",
|
|
5082
|
-
width: "60"
|
|
5083
|
-
}, {
|
|
5084
|
-
default: vue.withCtx((scope) => [
|
|
5085
|
-
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(
|
|
5086
|
-
vue.unref(design.TMagicTooltip),
|
|
5087
|
-
{
|
|
5088
|
-
key: 0,
|
|
5089
|
-
content: "点击上移,双击置顶",
|
|
5090
|
-
placement: "top"
|
|
5091
|
-
},
|
|
5092
|
-
{
|
|
5093
|
-
default: vue.withCtx(() => [
|
|
5094
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5095
|
-
plain: "",
|
|
5096
|
-
size: "small",
|
|
5097
|
-
type: "primary",
|
|
5098
|
-
icon: vue.unref(iconsVue.ArrowUp),
|
|
5099
|
-
disabled: __props.disabled,
|
|
5100
|
-
link: "",
|
|
5101
|
-
onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
5102
|
-
onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
5103
|
-
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
5104
|
-
]),
|
|
5105
|
-
_: 2
|
|
5106
|
-
/* DYNAMIC */
|
|
5107
|
-
},
|
|
5108
|
-
1024
|
|
5109
|
-
/* DYNAMIC_SLOTS */
|
|
5110
|
-
)) : vue.createCommentVNode("v-if", true),
|
|
5111
|
-
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== __props.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(
|
|
5112
|
-
vue.unref(design.TMagicTooltip),
|
|
5113
|
-
{
|
|
5114
|
-
key: 1,
|
|
5115
|
-
content: "点击下移,双击置底",
|
|
5116
|
-
placement: "top"
|
|
5117
|
-
},
|
|
5118
|
-
{
|
|
5119
|
-
default: vue.withCtx(() => [
|
|
5120
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5121
|
-
plain: "",
|
|
5122
|
-
size: "small",
|
|
5123
|
-
type: "primary",
|
|
5124
|
-
icon: vue.unref(iconsVue.ArrowDown),
|
|
5125
|
-
disabled: __props.disabled,
|
|
5126
|
-
link: "",
|
|
5127
|
-
onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
5128
|
-
onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
5129
|
-
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
5130
|
-
]),
|
|
5131
|
-
_: 2
|
|
5132
|
-
/* DYNAMIC */
|
|
5133
|
-
},
|
|
5134
|
-
1024
|
|
5135
|
-
/* DYNAMIC_SLOTS */
|
|
5136
|
-
)) : vue.createCommentVNode("v-if", true)
|
|
5137
|
-
]),
|
|
5138
|
-
_: 1
|
|
5139
|
-
/* STABLE */
|
|
5140
|
-
})) : vue.createCommentVNode("v-if", true),
|
|
5141
|
-
selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
5142
|
-
key: 2,
|
|
5143
|
-
align: "center",
|
|
5144
|
-
"header-align": "center",
|
|
5145
|
-
type: "selection",
|
|
5146
|
-
width: "45"
|
|
5147
|
-
})) : vue.createCommentVNode("v-if", true),
|
|
5148
|
-
__props.showIndex && __props.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
5149
|
-
key: 3,
|
|
5150
|
-
width: "60",
|
|
5151
|
-
label: "序号"
|
|
5152
|
-
}, {
|
|
5153
|
-
default: vue.withCtx((scope) => [
|
|
5154
|
-
vue.createTextVNode(
|
|
5155
|
-
vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value),
|
|
5156
|
-
1
|
|
5157
|
-
/* TEXT */
|
|
5158
|
-
)
|
|
5159
|
-
]),
|
|
5160
|
-
_: 1
|
|
5161
|
-
/* STABLE */
|
|
5162
|
-
})) : vue.createCommentVNode("v-if", true),
|
|
5163
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
5164
|
-
vue.Fragment,
|
|
5165
|
-
null,
|
|
5166
|
-
vue.renderList(__props.config.items, (column, index) => {
|
|
5167
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
5168
|
-
vue.Fragment,
|
|
5169
|
-
null,
|
|
5170
|
-
[
|
|
5171
|
-
column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
5172
|
-
prop: column.name,
|
|
5173
|
-
width: column.width,
|
|
5174
|
-
label: column.label,
|
|
5175
|
-
sortable: column.sortable,
|
|
5176
|
-
"sort-orders": ["ascending", "descending"],
|
|
5177
|
-
key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
5178
|
-
"class-name": __props.config.dropSort === true ? "el-table__column--dropable" : ""
|
|
5179
|
-
}, {
|
|
5180
|
-
default: vue.withCtx((scope) => [
|
|
5181
|
-
scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
5182
|
-
key: 0,
|
|
5183
|
-
labelWidth: "0",
|
|
5184
|
-
disabled: __props.disabled,
|
|
5185
|
-
prop: getProp(scope.$index),
|
|
5186
|
-
rules: column.rules,
|
|
5187
|
-
config: makeConfig(column, scope.row),
|
|
5188
|
-
model: scope.row,
|
|
5189
|
-
lastValues: lastData.value[scope.$index],
|
|
5190
|
-
"is-compare": __props.isCompare,
|
|
5191
|
-
size: __props.size,
|
|
5192
|
-
onChange: changeHandler,
|
|
5193
|
-
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
5194
|
-
}, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("v-if", true)
|
|
5195
|
-
]),
|
|
5196
|
-
_: 2
|
|
5197
|
-
/* DYNAMIC */
|
|
5198
|
-
}, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("v-if", true)
|
|
5199
|
-
],
|
|
5200
|
-
64
|
|
5201
|
-
/* STABLE_FRAGMENT */
|
|
5202
|
-
);
|
|
5203
|
-
}),
|
|
5204
|
-
256
|
|
5205
|
-
/* UNKEYED_FRAGMENT */
|
|
5206
|
-
))
|
|
5207
|
-
]),
|
|
5208
|
-
_: 3
|
|
5209
|
-
/* FORWARDED */
|
|
5210
|
-
}, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("v-if", true)
|
|
5211
|
-
]),
|
|
5212
|
-
_: 3
|
|
5213
|
-
/* FORWARDED */
|
|
5214
|
-
}, 8, ["disabled"]),
|
|
5215
|
-
vue.renderSlot(_ctx.$slots, "default"),
|
|
5216
|
-
vue.createElementVNode("div", _hoisted_4, [
|
|
5217
|
-
addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5218
|
-
key: 0,
|
|
5219
|
-
size: "small",
|
|
5220
|
-
type: "primary",
|
|
5221
|
-
disabled: __props.disabled,
|
|
5222
|
-
plain: "",
|
|
5223
|
-
onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
|
|
5224
|
-
}, {
|
|
5225
|
-
default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
5226
|
-
vue.createTextVNode(
|
|
5227
|
-
"新增一行",
|
|
5228
|
-
-1
|
|
5229
|
-
/* CACHED */
|
|
5230
|
-
)
|
|
5231
|
-
])]),
|
|
5232
|
-
_: 1
|
|
5233
|
-
/* STABLE */
|
|
5234
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
5235
|
-
vue.createElementVNode("div", _hoisted_5, [
|
|
5236
|
-
__props.enableToggleMode && __props.config.enableToggleMode !== false && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5237
|
-
key: 0,
|
|
5238
|
-
icon: vue.unref(iconsVue.Grid),
|
|
5239
|
-
size: "small",
|
|
5240
|
-
type: "primary",
|
|
5241
|
-
onClick: toggleMode
|
|
5242
|
-
}, {
|
|
5243
|
-
default: vue.withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
5244
|
-
vue.createTextVNode(
|
|
5245
|
-
"展开配置",
|
|
5246
|
-
-1
|
|
5247
|
-
/* CACHED */
|
|
5248
|
-
)
|
|
5249
|
-
])]),
|
|
5250
|
-
_: 1
|
|
5251
|
-
/* STABLE */
|
|
5252
|
-
}, 8, ["icon"])) : vue.createCommentVNode("v-if", true),
|
|
5253
|
-
__props.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5254
|
-
key: 1,
|
|
5255
|
-
icon: vue.unref(iconsVue.FullScreen),
|
|
5256
|
-
size: "small",
|
|
5257
|
-
type: "primary",
|
|
5258
|
-
onClick: toggleFullscreen
|
|
5259
|
-
}, {
|
|
5260
|
-
default: vue.withCtx(() => [
|
|
5261
|
-
vue.createTextVNode(
|
|
5262
|
-
vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"),
|
|
5263
|
-
1
|
|
5264
|
-
/* TEXT */
|
|
5265
|
-
)
|
|
5266
|
-
]),
|
|
5267
|
-
_: 1
|
|
5268
|
-
/* STABLE */
|
|
5269
|
-
}, 8, ["icon"])) : vue.createCommentVNode("v-if", true),
|
|
5270
|
-
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
|
|
5271
|
-
key: 2,
|
|
5272
|
-
style: { "display": "inline-block" },
|
|
5273
|
-
ref_key: "excelBtn",
|
|
5274
|
-
ref: excelBtn,
|
|
5275
|
-
action: "/noop",
|
|
5276
|
-
disabled: __props.disabled,
|
|
5277
|
-
"on-change": excelHandler,
|
|
5278
|
-
"auto-upload": false
|
|
5279
|
-
}, {
|
|
5280
|
-
default: vue.withCtx(() => [
|
|
5281
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5282
|
-
size: "small",
|
|
5283
|
-
type: "success",
|
|
5284
|
-
disabled: __props.disabled,
|
|
5285
|
-
plain: ""
|
|
5286
|
-
}, {
|
|
5287
|
-
default: vue.withCtx(() => [..._cache[5] || (_cache[5] = [
|
|
5288
|
-
vue.createTextVNode(
|
|
5289
|
-
"导入EXCEL",
|
|
5290
|
-
-1
|
|
5291
|
-
/* CACHED */
|
|
5292
|
-
)
|
|
5293
|
-
])]),
|
|
5294
|
-
_: 1
|
|
5295
|
-
/* STABLE */
|
|
5296
|
-
}, 8, ["disabled"])
|
|
5297
|
-
]),
|
|
5298
|
-
_: 1
|
|
5299
|
-
/* STABLE */
|
|
5300
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
5301
|
-
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5302
|
-
key: 3,
|
|
5303
|
-
size: "small",
|
|
5304
|
-
type: "warning",
|
|
5305
|
-
disabled: __props.disabled,
|
|
5306
|
-
plain: "",
|
|
5307
|
-
onClick: _cache[2] || (_cache[2] = ($event) => clearHandler())
|
|
5308
|
-
}, {
|
|
5309
|
-
default: vue.withCtx(() => [..._cache[6] || (_cache[6] = [
|
|
5310
|
-
vue.createTextVNode(
|
|
5311
|
-
"清空",
|
|
5312
|
-
-1
|
|
5313
|
-
/* CACHED */
|
|
5314
|
-
)
|
|
5315
|
-
])]),
|
|
5316
|
-
_: 1
|
|
5317
|
-
/* STABLE */
|
|
5318
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true)
|
|
5319
|
-
])
|
|
5320
|
-
]),
|
|
5321
|
-
__props.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
5322
|
-
vue.createVNode(vue.unref(design.TMagicPagination), {
|
|
5323
|
-
layout: "total, sizes, prev, pager, next, jumper",
|
|
5324
|
-
"hide-on-single-page": __props.model[modelName.value].length < pagesize.value,
|
|
5325
|
-
"current-page": pagecontext.value + 1,
|
|
5326
|
-
"page-sizes": [pagesize.value, 60, 120, 300],
|
|
5327
|
-
"page-size": pagesize.value,
|
|
5328
|
-
total: __props.model[modelName.value].length,
|
|
5329
|
-
onSizeChange: handleSizeChange,
|
|
5330
|
-
onCurrentChange: handleCurrentChange
|
|
5331
|
-
}, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
|
|
5332
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
5333
|
-
],
|
|
5334
|
-
2
|
|
5335
|
-
/* CLASS */
|
|
5336
|
-
)
|
|
5337
|
-
], 8, ["disabled"]))
|
|
5338
|
-
]);
|
|
5339
|
-
};
|
|
5340
|
-
}
|
|
5341
|
-
});
|
|
5342
|
-
|
|
5343
|
-
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
5344
|
-
...{
|
|
5345
|
-
name: "MFormTabs"
|
|
5346
|
-
},
|
|
5347
|
-
__name: "Tabs",
|
|
5348
|
-
props: {
|
|
5349
|
-
model: {},
|
|
5350
|
-
lastValues: { default: () => ({}) },
|
|
5351
|
-
isCompare: { type: Boolean, default: false },
|
|
5352
|
-
config: {},
|
|
5353
|
-
name: {},
|
|
5354
|
-
size: {},
|
|
5355
|
-
labelWidth: {},
|
|
5356
|
-
prop: {},
|
|
5357
|
-
expandMore: { type: Boolean },
|
|
5358
|
-
disabled: { type: Boolean }
|
|
5359
|
-
},
|
|
5360
|
-
emits: ["change", "addDiffCount"],
|
|
5361
|
-
setup(__props, { emit: __emit }) {
|
|
5362
|
-
const tabPaneComponent = design.getDesignConfig("components")?.tabPane;
|
|
5363
|
-
const tabsComponent = design.getDesignConfig("components")?.tabs;
|
|
5364
|
-
const getActive = (mForm2, props2, activeTabName2) => {
|
|
5365
|
-
const { config, model, prop } = props2;
|
|
5366
|
-
const { active } = config;
|
|
5367
|
-
if (typeof active === "function") return active(mForm2, { model, formValue: mForm2?.values, prop });
|
|
5368
|
-
if (0 >= props2.config.items.length) return "0";
|
|
5369
|
-
if (typeof active !== "undefined") return active;
|
|
5370
|
-
return "0";
|
|
5371
|
-
};
|
|
5372
|
-
const tabClick = (mForm2, tab, props2) => {
|
|
5373
|
-
const { config, model, prop } = props2;
|
|
5374
|
-
tab.name = tab.paneName;
|
|
5375
|
-
if (typeof config.onTabClick === "function") {
|
|
5376
|
-
config.onTabClick(mForm2, tab, { model, formValue: mForm2?.values, prop, config });
|
|
5377
|
-
}
|
|
5378
|
-
const tabConfig = config.items.find((item) => tab.name === item.status);
|
|
5379
|
-
if (tabConfig && typeof tabConfig.onTabClick === "function") {
|
|
5380
|
-
tabConfig.onTabClick(mForm2, tab, { model, formValue: mForm2?.values, prop, config });
|
|
5381
|
-
}
|
|
5382
|
-
};
|
|
5383
|
-
const props = __props;
|
|
5384
|
-
const emit = __emit;
|
|
5385
|
-
const mForm = vue.inject("mForm");
|
|
5386
|
-
const activeTabName = vue.ref(getActive(mForm, props));
|
|
5387
|
-
const diffCount = vue.ref({});
|
|
5388
|
-
const tabs = vue.computed(() => {
|
|
5389
|
-
if (props.config.dynamic) {
|
|
5390
|
-
if (!props.config.name) throw new Error("dynamic tab 必须配置name");
|
|
5391
|
-
return props.model[props.config.name] || [];
|
|
5392
|
-
}
|
|
5393
|
-
return props.config.items.filter((item) => display(mForm, item.display, props));
|
|
5394
|
-
});
|
|
5395
|
-
const filter = (config) => filterFunction(mForm, config, props);
|
|
5396
|
-
vue.watchEffect(() => {
|
|
5397
|
-
if (typeof props.config.activeChange === "function") {
|
|
5398
|
-
props.config.activeChange(mForm, activeTabName.value, {
|
|
5399
|
-
model: props.model,
|
|
5400
|
-
prop: props.prop
|
|
5401
|
-
});
|
|
5402
|
-
}
|
|
5403
|
-
});
|
|
5404
|
-
const tabItems = (tab) => props.config.dynamic ? props.config.items : tab.items;
|
|
5405
|
-
const tabClickHandler = (tab) => tabClick(mForm, tab, props);
|
|
5406
|
-
const onTabAdd = async () => {
|
|
5407
|
-
if (!props.name) throw new Error("dynamic tab 必须配置name");
|
|
5408
|
-
if (typeof props.config.onTabAdd === "function") {
|
|
5409
|
-
props.config.onTabAdd(mForm, {
|
|
5410
|
-
model: props.model,
|
|
5411
|
-
prop: props.prop,
|
|
5412
|
-
config: props.config
|
|
5413
|
-
});
|
|
5414
|
-
emit("change", props.model);
|
|
5415
|
-
} else {
|
|
5416
|
-
const newObj = await initValue(mForm, {
|
|
5417
|
-
config: props.config.items,
|
|
5418
|
-
initValues: {}
|
|
5419
|
-
});
|
|
5420
|
-
newObj.title = `标签${tabs.value.length + 1}`;
|
|
5421
|
-
props.model[props.name].push(newObj);
|
|
5422
|
-
emit("change", props.model[props.name], {
|
|
5423
|
-
changeRecords: [
|
|
5424
|
-
{
|
|
5425
|
-
propPath: `${props.prop}.${props.model[props.name].length - 1}`,
|
|
5426
|
-
value: newObj
|
|
5427
|
-
}
|
|
5428
|
-
]
|
|
5429
|
-
});
|
|
5430
|
-
}
|
|
5431
|
-
mForm?.$emit("field-change", props.prop, props.model[props.name]);
|
|
5432
|
-
};
|
|
5433
|
-
const onTabRemove = (tabName) => {
|
|
5434
|
-
if (!props.name) throw new Error("dynamic tab 必须配置name");
|
|
5435
|
-
if (typeof props.config.onTabRemove === "function") {
|
|
5436
|
-
props.config.onTabRemove(mForm, tabName, {
|
|
5437
|
-
model: props.model,
|
|
5438
|
-
prop: props.prop,
|
|
5439
|
-
config: props.config
|
|
5440
|
-
});
|
|
5441
|
-
} else {
|
|
5442
|
-
props.model[props.name].splice(+tabName, 1);
|
|
5443
|
-
if (tabName < activeTabName.value || activeTabName.value >= props.model[props.name].length) {
|
|
5444
|
-
activeTabName.value = (+activeTabName.value - 1).toString();
|
|
5445
|
-
tabClick(mForm, { name: activeTabName.value }, props);
|
|
5446
|
-
}
|
|
5447
|
-
}
|
|
5448
|
-
emit("change", props.model);
|
|
5449
|
-
mForm?.$emit("field-change", props.prop, props.model[props.name]);
|
|
5450
|
-
};
|
|
5451
|
-
const changeHandler = (v, eventData) => {
|
|
5452
|
-
emit("change", props.model, eventData);
|
|
5453
|
-
};
|
|
5454
|
-
const onAddDiffCount = (tabIndex) => {
|
|
5455
|
-
if (!diffCount.value[tabIndex]) {
|
|
5456
|
-
diffCount.value[tabIndex] = 1;
|
|
5457
|
-
} else {
|
|
5458
|
-
diffCount.value[tabIndex] += 1;
|
|
5459
|
-
}
|
|
5460
|
-
emit("addDiffCount");
|
|
5461
|
-
};
|
|
5462
|
-
return (_ctx, _cache) => {
|
|
5463
|
-
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent)?.component || "el-tabs"), vue.mergeProps(
|
|
5464
|
-
{
|
|
5465
|
-
modelValue: activeTabName.value,
|
|
5466
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event)
|
|
5467
|
-
},
|
|
5468
|
-
vue.unref(tabsComponent)?.props({
|
|
5469
|
-
type: __props.config.tabType,
|
|
5470
|
-
editable: __props.config.editable || false,
|
|
5471
|
-
tabPosition: __props.config.tabPosition || "top"
|
|
5472
|
-
}) || {},
|
|
5473
|
-
{
|
|
5474
|
-
class: `tmagic-design-tabs ${__props.config.dynamic ? "magic-form-dynamic-tab" : "magic-form-tab"}`,
|
|
5475
|
-
onTabClick: tabClickHandler,
|
|
5476
|
-
onTabAdd,
|
|
5477
|
-
onTabRemove
|
|
5478
|
-
}
|
|
5479
|
-
), {
|
|
5480
|
-
default: vue.withCtx(() => [
|
|
5481
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
5482
|
-
vue.Fragment,
|
|
5483
|
-
null,
|
|
5484
|
-
vue.renderList(tabs.value, (tab, tabIndex) => {
|
|
5485
|
-
return vue.openBlock(), vue.createBlock(
|
|
5486
|
-
vue.resolveDynamicComponent(vue.unref(tabPaneComponent)?.component || "el-tab-pane"),
|
|
5487
|
-
vue.mergeProps(
|
|
5488
|
-
{
|
|
5489
|
-
key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex
|
|
5490
|
-
},
|
|
5491
|
-
{ ref_for: true },
|
|
5492
|
-
vue.unref(tabPaneComponent)?.props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false }) || {}
|
|
5493
|
-
),
|
|
5494
|
-
{
|
|
5495
|
-
label: vue.withCtx(() => [
|
|
5496
|
-
vue.createElementVNode("span", null, [
|
|
5497
|
-
vue.createTextVNode(
|
|
5498
|
-
vue.toDisplayString(filter(tab.title)),
|
|
5499
|
-
1
|
|
5500
|
-
/* TEXT */
|
|
5501
|
-
),
|
|
5502
|
-
vue.createVNode(vue.unref(design.TMagicBadge), {
|
|
5503
|
-
hidden: !diffCount.value[tabIndex],
|
|
5504
|
-
value: diffCount.value[tabIndex],
|
|
5505
|
-
class: "diff-count-badge"
|
|
5506
|
-
}, null, 8, ["hidden", "value"])
|
|
5507
|
-
])
|
|
5508
|
-
]),
|
|
5509
|
-
default: vue.withCtx(() => [
|
|
5510
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
5511
|
-
vue.Fragment,
|
|
5512
|
-
null,
|
|
5513
|
-
vue.renderList(tabItems(tab), (item) => {
|
|
5514
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
5515
|
-
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
5516
|
-
config: item,
|
|
5517
|
-
disabled: __props.disabled,
|
|
5518
|
-
model: __props.config.dynamic ? (__props.name ? __props.model[__props.name] : __props.model)[tabIndex] : tab.name ? (__props.name ? __props.model[__props.name] : __props.model)[tab.name] : __props.name ? __props.model[__props.name] : __props.model,
|
|
5519
|
-
"last-values": vue.unref(isEmpty)(__props.lastValues) ? {} : __props.config.dynamic ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tabIndex] : tab.name ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tab.name] : __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
5520
|
-
"is-compare": __props.isCompare,
|
|
5521
|
-
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
|
|
5522
|
-
size: __props.size,
|
|
5523
|
-
"label-width": tab.labelWidth || __props.labelWidth,
|
|
5524
|
-
"expand-more": __props.expandMore,
|
|
5525
|
-
onChange: changeHandler,
|
|
5526
|
-
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
5527
|
-
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
5528
|
-
}),
|
|
5529
|
-
128
|
|
5530
|
-
/* KEYED_FRAGMENT */
|
|
5531
|
-
))
|
|
5532
|
-
]),
|
|
5533
|
-
_: 2
|
|
5534
|
-
/* DYNAMIC */
|
|
5535
|
-
},
|
|
5536
|
-
1040
|
|
5537
|
-
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
5538
|
-
);
|
|
5539
|
-
}),
|
|
5540
|
-
128
|
|
5541
|
-
/* KEYED_FRAGMENT */
|
|
5542
|
-
))
|
|
5543
|
-
]),
|
|
5544
|
-
_: 1
|
|
5545
|
-
/* STABLE */
|
|
5546
|
-
}, 16, ["modelValue", "class"]);
|
|
5547
|
-
};
|
|
5548
|
-
}
|
|
5549
|
-
});
|
|
5550
|
-
|
|
5551
|
-
let $MAGIC_FORM = {};
|
|
5552
|
-
const setConfig = (option) => {
|
|
5553
|
-
$MAGIC_FORM = option;
|
|
5554
|
-
};
|
|
5555
|
-
const getConfig = (key) => $MAGIC_FORM[key];
|
|
5556
|
-
|
|
5557
|
-
const useAddField = (prop) => {
|
|
5558
|
-
if (!prop) return;
|
|
5559
|
-
const mForm = vue.inject("mForm");
|
|
5560
|
-
const instance = vue.getCurrentInstance();
|
|
5561
|
-
vue.watch(
|
|
5562
|
-
() => instance?.proxy,
|
|
5563
|
-
(vm) => {
|
|
5564
|
-
if (vm) {
|
|
5565
|
-
mForm?.setField(prop, vm);
|
|
5566
|
-
} else {
|
|
5567
|
-
mForm?.deleteField(prop);
|
|
5568
|
-
}
|
|
5569
|
-
},
|
|
5570
|
-
{
|
|
5571
|
-
immediate: true
|
|
5572
|
-
}
|
|
5573
|
-
);
|
|
5574
|
-
};
|
|
5575
|
-
|
|
5576
|
-
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
5577
|
-
...{
|
|
5578
|
-
name: "MFormCascader"
|
|
5579
|
-
},
|
|
5580
|
-
__name: "Cascader",
|
|
5581
|
-
props: {
|
|
5582
|
-
config: {},
|
|
5583
|
-
model: {},
|
|
5584
|
-
initValues: {},
|
|
5585
|
-
values: {},
|
|
5586
|
-
name: {},
|
|
5587
|
-
prop: {},
|
|
5588
|
-
disabled: { type: Boolean },
|
|
5589
|
-
size: {},
|
|
5590
|
-
lastValues: {}
|
|
5591
|
-
},
|
|
5592
|
-
emits: ["change"],
|
|
5593
|
-
setup(__props, { emit: __emit }) {
|
|
5594
|
-
const props = __props;
|
|
5595
|
-
const emit = __emit;
|
|
5596
|
-
const mForm = vue.inject("mForm");
|
|
5597
|
-
useAddField(props.prop);
|
|
5598
|
-
const requestFunc = getConfig("request");
|
|
5599
|
-
const tMagicCascader = vue.ref();
|
|
5600
|
-
const options = vue.ref([]);
|
|
5601
|
-
const remoteData = vue.ref(null);
|
|
5602
|
-
const checkStrictly = vue.computed(() => filterFunction(mForm, props.config.checkStrictly, props));
|
|
5603
|
-
const valueSeparator = vue.computed(() => filterFunction(mForm, props.config.valueSeparator, props));
|
|
5604
|
-
const value = vue.computed({
|
|
5605
|
-
get() {
|
|
5606
|
-
if (typeof props.model[props.name] === "string" && valueSeparator.value) {
|
|
5607
|
-
return props.model[props.name].split(valueSeparator.value);
|
|
5608
|
-
}
|
|
5609
|
-
return props.model[props.name];
|
|
5610
|
-
},
|
|
5611
|
-
set(value2) {
|
|
5612
|
-
let result = value2;
|
|
5613
|
-
if (valueSeparator.value) {
|
|
5614
|
-
result = value2.join(valueSeparator.value);
|
|
5615
|
-
}
|
|
5616
|
-
props.model[props.name] = result;
|
|
5617
|
-
}
|
|
5618
|
-
});
|
|
5619
|
-
const setRemoteOptions = async function() {
|
|
5620
|
-
const { config } = props;
|
|
5621
|
-
const { option } = config;
|
|
5622
|
-
if (!option) return;
|
|
5623
|
-
let { body } = option;
|
|
5624
|
-
const postOptions = {
|
|
5625
|
-
url: option.url,
|
|
5626
|
-
cache: option.cache,
|
|
5627
|
-
timeout: option.timeout,
|
|
5628
|
-
data: {}
|
|
5629
|
-
};
|
|
5630
|
-
if (body && mForm) {
|
|
5631
|
-
if (typeof body === "function" && props.model && mForm) {
|
|
5632
|
-
body = body(mForm, {
|
|
5633
|
-
model: props.model,
|
|
5634
|
-
formValue: mForm.values,
|
|
5635
|
-
formValues: mForm.values,
|
|
5636
|
-
config: props.config
|
|
5637
|
-
});
|
|
5638
|
-
}
|
|
5639
|
-
postOptions.data = body;
|
|
5640
|
-
}
|
|
5641
|
-
const res = await requestFunc(postOptions);
|
|
5642
|
-
remoteData.value = res[option.root];
|
|
5643
|
-
if (remoteData.value && typeof option?.item === "function") {
|
|
5644
|
-
options.value = option.item(res[option.root]);
|
|
5016
|
+
const res = await requestFunc(postOptions);
|
|
5017
|
+
remoteData.value = res[option.root];
|
|
5018
|
+
if (remoteData.value && typeof option?.item === "function") {
|
|
5019
|
+
options.value = option.item(res[option.root]);
|
|
5645
5020
|
}
|
|
5646
5021
|
};
|
|
5647
5022
|
if (typeof props.config.options === "function" && props.model && mForm) {
|
|
@@ -5667,12 +5042,10 @@
|
|
|
5667
5042
|
if (!tMagicCascader.value) return;
|
|
5668
5043
|
tMagicCascader.value.setQuery("");
|
|
5669
5044
|
tMagicCascader.value.setPreviousQuery(null);
|
|
5670
|
-
emit("change", props.model[props.name]);
|
|
5671
5045
|
};
|
|
5672
5046
|
return (_ctx, _cache) => {
|
|
5673
5047
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCascader), {
|
|
5674
|
-
|
|
5675
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
5048
|
+
"model-value": value.value,
|
|
5676
5049
|
ref_key: "tMagicCascader",
|
|
5677
5050
|
ref: tMagicCascader,
|
|
5678
5051
|
style: { "width": "100%" },
|
|
@@ -5688,13 +5061,14 @@
|
|
|
5688
5061
|
emitPath: __props.config.emitPath ?? true,
|
|
5689
5062
|
checkStrictly: checkStrictly.value ?? false
|
|
5690
5063
|
},
|
|
5064
|
+
"onUpdate:modelValue": updateModelValueHandler,
|
|
5691
5065
|
onChange: changeHandler
|
|
5692
|
-
}, null, 8, ["
|
|
5066
|
+
}, null, 8, ["model-value", "size", "placeholder", "disabled", "options", "popper-class", "props"]);
|
|
5693
5067
|
};
|
|
5694
5068
|
}
|
|
5695
5069
|
});
|
|
5696
5070
|
|
|
5697
|
-
const _sfc_main$
|
|
5071
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
5698
5072
|
...{
|
|
5699
5073
|
name: "MFormCheckbox"
|
|
5700
5074
|
},
|
|
@@ -5740,29 +5114,33 @@
|
|
|
5740
5114
|
};
|
|
5741
5115
|
return (_ctx, _cache) => {
|
|
5742
5116
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
|
|
5743
|
-
|
|
5744
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
5117
|
+
"model-value": __props.model[__props.name],
|
|
5745
5118
|
size: __props.size,
|
|
5746
5119
|
trueValue: activeValue.value,
|
|
5747
5120
|
falseValue: inactiveValue.value,
|
|
5748
5121
|
disabled: __props.disabled,
|
|
5749
|
-
|
|
5750
|
-
}, {
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
)
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5122
|
+
"onUpdate:modelValue": changeHandler
|
|
5123
|
+
}, vue.createSlots({
|
|
5124
|
+
_: 2
|
|
5125
|
+
/* DYNAMIC */
|
|
5126
|
+
}, [
|
|
5127
|
+
!__props.config.useLabel ? {
|
|
5128
|
+
name: "default",
|
|
5129
|
+
fn: vue.withCtx(() => [
|
|
5130
|
+
vue.createTextVNode(
|
|
5131
|
+
vue.toDisplayString(__props.config.text),
|
|
5132
|
+
1
|
|
5133
|
+
/* TEXT */
|
|
5134
|
+
)
|
|
5135
|
+
]),
|
|
5136
|
+
key: "0"
|
|
5137
|
+
} : void 0
|
|
5138
|
+
]), 1032, ["model-value", "size", "trueValue", "falseValue", "disabled"]);
|
|
5761
5139
|
};
|
|
5762
5140
|
}
|
|
5763
5141
|
});
|
|
5764
5142
|
|
|
5765
|
-
const _sfc_main$
|
|
5143
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
5766
5144
|
...{
|
|
5767
5145
|
name: "MFormCheckGroup"
|
|
5768
5146
|
},
|
|
@@ -5798,11 +5176,10 @@
|
|
|
5798
5176
|
});
|
|
5799
5177
|
return (_ctx, _cache) => {
|
|
5800
5178
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckboxGroup), {
|
|
5801
|
-
|
|
5802
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
5179
|
+
"model-value": __props.model[__props.name],
|
|
5803
5180
|
size: __props.size,
|
|
5804
5181
|
disabled: __props.disabled,
|
|
5805
|
-
|
|
5182
|
+
"onUpdate:modelValue": changeHandler
|
|
5806
5183
|
}, {
|
|
5807
5184
|
default: vue.withCtx(() => [
|
|
5808
5185
|
(vue.openBlock(true), vue.createElementBlock(
|
|
@@ -5831,12 +5208,12 @@
|
|
|
5831
5208
|
]),
|
|
5832
5209
|
_: 1
|
|
5833
5210
|
/* STABLE */
|
|
5834
|
-
}, 8, ["
|
|
5211
|
+
}, 8, ["model-value", "size", "disabled"]);
|
|
5835
5212
|
};
|
|
5836
5213
|
}
|
|
5837
5214
|
});
|
|
5838
5215
|
|
|
5839
|
-
const _sfc_main$
|
|
5216
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
5840
5217
|
...{
|
|
5841
5218
|
name: "MFormColorPicker"
|
|
5842
5219
|
},
|
|
@@ -5860,18 +5237,17 @@
|
|
|
5860
5237
|
const changeHandler = (value) => emit("change", value);
|
|
5861
5238
|
return (_ctx, _cache) => {
|
|
5862
5239
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicColorPicker), {
|
|
5863
|
-
|
|
5864
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
5240
|
+
"model-value": __props.model[__props.name],
|
|
5865
5241
|
size: __props.size,
|
|
5866
5242
|
disabled: __props.disabled,
|
|
5867
5243
|
showAlpha: true,
|
|
5868
|
-
|
|
5869
|
-
}, null, 8, ["
|
|
5244
|
+
"onUpdate:modelValue": changeHandler
|
|
5245
|
+
}, null, 8, ["model-value", "size", "disabled"]);
|
|
5870
5246
|
};
|
|
5871
5247
|
}
|
|
5872
5248
|
});
|
|
5873
5249
|
|
|
5874
|
-
const _sfc_main$
|
|
5250
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
5875
5251
|
...{
|
|
5876
5252
|
name: "MFormDate"
|
|
5877
5253
|
},
|
|
@@ -5898,21 +5274,20 @@
|
|
|
5898
5274
|
};
|
|
5899
5275
|
return (_ctx, _cache) => {
|
|
5900
5276
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDatePicker), {
|
|
5901
|
-
|
|
5902
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
5277
|
+
"model-value": __props.model[__props.name],
|
|
5903
5278
|
type: "date",
|
|
5904
5279
|
size: __props.size,
|
|
5905
5280
|
placeholder: __props.config.placeholder,
|
|
5906
5281
|
disabled: __props.disabled,
|
|
5907
5282
|
format: __props.config.format || "YYYY/MM/DD",
|
|
5908
5283
|
"value-format": __props.config.valueFormat || "YYYY/MM/DD",
|
|
5909
|
-
|
|
5910
|
-
}, null, 8, ["
|
|
5284
|
+
"onUpdate:modelValue": changeHandler
|
|
5285
|
+
}, null, 8, ["model-value", "size", "placeholder", "disabled", "format", "value-format"]);
|
|
5911
5286
|
};
|
|
5912
5287
|
}
|
|
5913
5288
|
});
|
|
5914
5289
|
|
|
5915
|
-
const _sfc_main$
|
|
5290
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
5916
5291
|
...{
|
|
5917
5292
|
name: "MFormDateRange"
|
|
5918
5293
|
},
|
|
@@ -5993,8 +5368,7 @@
|
|
|
5993
5368
|
};
|
|
5994
5369
|
return (_ctx, _cache) => {
|
|
5995
5370
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDatePicker), {
|
|
5996
|
-
|
|
5997
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
5371
|
+
"model-value": value.value,
|
|
5998
5372
|
type: "datetimerange",
|
|
5999
5373
|
"range-separator": "-",
|
|
6000
5374
|
"start-placeholder": "开始日期",
|
|
@@ -6006,13 +5380,13 @@
|
|
|
6006
5380
|
"value-format": __props.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
|
|
6007
5381
|
"date-format": __props.config.dateFormat || "YYYY/MM/DD",
|
|
6008
5382
|
"time-format": __props.config.timeFormat || "HH:mm:ss",
|
|
6009
|
-
|
|
6010
|
-
}, null, 8, ["
|
|
5383
|
+
"onUpdate:modelValue": changeHandler
|
|
5384
|
+
}, null, 8, ["model-value", "size", "disabled", "default-time", "value-format", "date-format", "time-format"]);
|
|
6011
5385
|
};
|
|
6012
5386
|
}
|
|
6013
5387
|
});
|
|
6014
5388
|
|
|
6015
|
-
const _sfc_main$
|
|
5389
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
6016
5390
|
...{
|
|
6017
5391
|
name: "MFormDateTime"
|
|
6018
5392
|
},
|
|
@@ -6050,8 +5424,7 @@
|
|
|
6050
5424
|
};
|
|
6051
5425
|
return (_ctx, _cache) => {
|
|
6052
5426
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDatePicker), {
|
|
6053
|
-
|
|
6054
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
5427
|
+
"model-value": __props.model[__props.name],
|
|
6055
5428
|
"popper-class": "magic-datetime-picker-popper",
|
|
6056
5429
|
type: "datetime",
|
|
6057
5430
|
size: __props.size,
|
|
@@ -6060,14 +5433,14 @@
|
|
|
6060
5433
|
format: __props.config.format || "YYYY/MM/DD HH:mm:ss",
|
|
6061
5434
|
"value-format": __props.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
|
|
6062
5435
|
"default-time": __props.config.defaultTime,
|
|
6063
|
-
|
|
6064
|
-
}, null, 8, ["
|
|
5436
|
+
"onUpdate:modelValue": changeHandler
|
|
5437
|
+
}, null, 8, ["model-value", "size", "placeholder", "disabled", "format", "value-format", "default-time"]);
|
|
6065
5438
|
};
|
|
6066
5439
|
}
|
|
6067
5440
|
});
|
|
6068
5441
|
|
|
6069
5442
|
const _hoisted_1$8 = { key: 0 };
|
|
6070
|
-
const _sfc_main$
|
|
5443
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
6071
5444
|
...{
|
|
6072
5445
|
name: "MFormDisplay"
|
|
6073
5446
|
},
|
|
@@ -6102,7 +5475,7 @@
|
|
|
6102
5475
|
});
|
|
6103
5476
|
|
|
6104
5477
|
const _hoisted_1$7 = { class: "m-fields-dynamic-field" };
|
|
6105
|
-
const _sfc_main$
|
|
5478
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
6106
5479
|
...{
|
|
6107
5480
|
name: "MFormDynamicField"
|
|
6108
5481
|
},
|
|
@@ -6203,7 +5576,7 @@
|
|
|
6203
5576
|
}
|
|
6204
5577
|
});
|
|
6205
5578
|
|
|
6206
|
-
const _sfc_main$
|
|
5579
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
6207
5580
|
...{
|
|
6208
5581
|
name: "MFormHidden"
|
|
6209
5582
|
},
|
|
@@ -6240,7 +5613,7 @@
|
|
|
6240
5613
|
}
|
|
6241
5614
|
});
|
|
6242
5615
|
|
|
6243
|
-
const _sfc_main$
|
|
5616
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
6244
5617
|
...{
|
|
6245
5618
|
name: "MForm"
|
|
6246
5619
|
},
|
|
@@ -6267,7 +5640,7 @@
|
|
|
6267
5640
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
6268
5641
|
const props = __props;
|
|
6269
5642
|
const emit = __emit;
|
|
6270
|
-
const
|
|
5643
|
+
const tMagicFormRef = vue.useTemplateRef("tMagicForm");
|
|
6271
5644
|
const initialized = vue.ref(false);
|
|
6272
5645
|
const values = vue.ref({});
|
|
6273
5646
|
const lastValuesProcessed = vue.ref({});
|
|
@@ -6344,7 +5717,17 @@
|
|
|
6344
5717
|
);
|
|
6345
5718
|
const changeHandler = (v, eventData) => {
|
|
6346
5719
|
if (eventData.changeRecords?.length) {
|
|
6347
|
-
|
|
5720
|
+
for (const record of eventData.changeRecords) {
|
|
5721
|
+
if (record.propPath) {
|
|
5722
|
+
const index = changeRecords.value.findIndex((item) => item.propPath === record.propPath);
|
|
5723
|
+
if (index > -1) {
|
|
5724
|
+
changeRecords.value[index] = record;
|
|
5725
|
+
} else {
|
|
5726
|
+
changeRecords.value.push(record);
|
|
5727
|
+
}
|
|
5728
|
+
utils.setValueByKeyPath(record.propPath, record.value, values.value);
|
|
5729
|
+
}
|
|
5730
|
+
}
|
|
6348
5731
|
}
|
|
6349
5732
|
emit("change", values.value, eventData);
|
|
6350
5733
|
};
|
|
@@ -6353,6 +5736,31 @@
|
|
|
6353
5736
|
e.preventDefault();
|
|
6354
5737
|
}
|
|
6355
5738
|
};
|
|
5739
|
+
const getTextByName = (name, config = props.config) => {
|
|
5740
|
+
if (!name || !Array.isArray(config)) return void 0;
|
|
5741
|
+
const nameParts = name.split(".");
|
|
5742
|
+
const findInConfig = (configs, parts) => {
|
|
5743
|
+
if (parts.length === 0) return void 0;
|
|
5744
|
+
const [currentPart, ...remainingParts] = parts;
|
|
5745
|
+
for (const item of configs) {
|
|
5746
|
+
if (item.name === currentPart) {
|
|
5747
|
+
if (remainingParts.length === 0) {
|
|
5748
|
+
return typeof item.text === "string" ? item.text : void 0;
|
|
5749
|
+
}
|
|
5750
|
+
if (item.items && Array.isArray(item.items)) {
|
|
5751
|
+
const result = findInConfig(item.items, remainingParts);
|
|
5752
|
+
if (result !== void 0) return result;
|
|
5753
|
+
}
|
|
5754
|
+
}
|
|
5755
|
+
if (item.items && Array.isArray(item.items)) {
|
|
5756
|
+
const result = findInConfig(item.items, parts);
|
|
5757
|
+
if (result !== void 0) return result;
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
return void 0;
|
|
5761
|
+
};
|
|
5762
|
+
return findInConfig(config, nameParts);
|
|
5763
|
+
};
|
|
6356
5764
|
__expose({
|
|
6357
5765
|
values,
|
|
6358
5766
|
lastValuesProcessed,
|
|
@@ -6361,32 +5769,36 @@
|
|
|
6361
5769
|
changeRecords,
|
|
6362
5770
|
changeHandler,
|
|
6363
5771
|
resetForm: () => {
|
|
6364
|
-
|
|
5772
|
+
tMagicFormRef.value?.resetFields();
|
|
6365
5773
|
changeRecords.value = [];
|
|
6366
5774
|
},
|
|
6367
5775
|
submitForm: async (native) => {
|
|
6368
5776
|
try {
|
|
6369
|
-
await
|
|
5777
|
+
const result = await tMagicFormRef.value?.validate();
|
|
5778
|
+
if (result !== true) {
|
|
5779
|
+
throw result;
|
|
5780
|
+
}
|
|
5781
|
+
changeRecords.value = [];
|
|
6370
5782
|
return native ? values.value : cloneDeep(vue.toRaw(values.value));
|
|
6371
5783
|
} catch (invalidFields) {
|
|
6372
5784
|
emit("error", invalidFields);
|
|
6373
5785
|
const error = [];
|
|
6374
|
-
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|
|
5786
|
+
Object.entries(invalidFields).forEach(([prop, ValidateError]) => {
|
|
6375
5787
|
ValidateError.forEach(({ field, message }) => {
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
5788
|
+
const name = field || prop;
|
|
5789
|
+
const text = getTextByName(name, props.config) || name;
|
|
5790
|
+
error.push(`${text} -> ${message}`);
|
|
6379
5791
|
});
|
|
6380
5792
|
});
|
|
6381
5793
|
throw new Error(error.join("<br>"));
|
|
6382
5794
|
}
|
|
6383
|
-
}
|
|
5795
|
+
},
|
|
5796
|
+
getTextByName
|
|
6384
5797
|
});
|
|
6385
5798
|
return (_ctx, _cache) => {
|
|
6386
5799
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicForm), {
|
|
6387
5800
|
class: "m-form",
|
|
6388
|
-
|
|
6389
|
-
ref: tMagicForm,
|
|
5801
|
+
ref: "tMagicForm",
|
|
6390
5802
|
model: values.value,
|
|
6391
5803
|
"label-width": __props.labelWidth,
|
|
6392
5804
|
style: vue.normalizeStyle(`height: ${__props.height}`),
|
|
@@ -6399,7 +5811,7 @@
|
|
|
6399
5811
|
vue.Fragment,
|
|
6400
5812
|
{ key: 0 },
|
|
6401
5813
|
vue.renderList(__props.config, (item, index) => {
|
|
6402
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5814
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
6403
5815
|
disabled: __props.disabled,
|
|
6404
5816
|
key: item[__props.keyProp] ?? index,
|
|
6405
5817
|
config: item,
|
|
@@ -6424,7 +5836,7 @@
|
|
|
6424
5836
|
});
|
|
6425
5837
|
|
|
6426
5838
|
const _hoisted_1$6 = { style: { "min-height": "1px" } };
|
|
6427
|
-
const _sfc_main$
|
|
5839
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
6428
5840
|
...{
|
|
6429
5841
|
name: "MFormDialog"
|
|
6430
5842
|
},
|
|
@@ -6625,7 +6037,7 @@
|
|
|
6625
6037
|
style: vue.normalizeStyle(`max-height: ${bodyHeight.value}; overflow-y: auto; overflow-x: hidden;`)
|
|
6626
6038
|
},
|
|
6627
6039
|
[
|
|
6628
|
-
vue.createVNode(_sfc_main$
|
|
6040
|
+
vue.createVNode(_sfc_main$g, {
|
|
6629
6041
|
modelValue: stepActive.value,
|
|
6630
6042
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => stepActive.value = $event),
|
|
6631
6043
|
ref_key: "form",
|
|
@@ -6655,11 +6067,11 @@
|
|
|
6655
6067
|
});
|
|
6656
6068
|
|
|
6657
6069
|
const _hoisted_1$5 = ["href"];
|
|
6658
|
-
const _hoisted_2$
|
|
6070
|
+
const _hoisted_2$2 = {
|
|
6659
6071
|
key: 2,
|
|
6660
6072
|
class: "m-fields-link"
|
|
6661
6073
|
};
|
|
6662
|
-
const _sfc_main$
|
|
6074
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
6663
6075
|
...{
|
|
6664
6076
|
name: "MFormLink"
|
|
6665
6077
|
},
|
|
@@ -6737,7 +6149,7 @@
|
|
|
6737
6149
|
vue.toDisplayString(displayText.value),
|
|
6738
6150
|
5
|
|
6739
6151
|
/* TEXT, STYLE */
|
|
6740
|
-
)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
6152
|
+
)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
|
|
6741
6153
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
6742
6154
|
link: "",
|
|
6743
6155
|
type: "primary",
|
|
@@ -6753,7 +6165,7 @@
|
|
|
6753
6165
|
_: 1
|
|
6754
6166
|
/* STABLE */
|
|
6755
6167
|
}),
|
|
6756
|
-
vue.createVNode(_sfc_main$
|
|
6168
|
+
vue.createVNode(_sfc_main$f, {
|
|
6757
6169
|
ref_key: "editor",
|
|
6758
6170
|
ref: editor,
|
|
6759
6171
|
title: __props.config.formTitle || "编辑扩展配置",
|
|
@@ -6769,7 +6181,7 @@
|
|
|
6769
6181
|
}
|
|
6770
6182
|
});
|
|
6771
6183
|
|
|
6772
|
-
const _sfc_main$
|
|
6184
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
6773
6185
|
...{
|
|
6774
6186
|
name: "MFormNumber"
|
|
6775
6187
|
},
|
|
@@ -6801,8 +6213,7 @@
|
|
|
6801
6213
|
return (_ctx, _cache) => {
|
|
6802
6214
|
return __props.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInputNumber), {
|
|
6803
6215
|
key: 0,
|
|
6804
|
-
|
|
6805
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
6216
|
+
"model-value": __props.model[__props.name],
|
|
6806
6217
|
clearable: "",
|
|
6807
6218
|
"controls-position": "right",
|
|
6808
6219
|
size: __props.size,
|
|
@@ -6811,15 +6222,15 @@
|
|
|
6811
6222
|
step: __props.config.step,
|
|
6812
6223
|
placeholder: __props.config.placeholder,
|
|
6813
6224
|
disabled: __props.disabled,
|
|
6814
|
-
|
|
6225
|
+
"onUpdate:modelValue": changeHandler,
|
|
6815
6226
|
onInput: inputHandler
|
|
6816
|
-
}, null, 8, ["
|
|
6227
|
+
}, null, 8, ["model-value", "size", "max", "min", "step", "placeholder", "disabled"])) : vue.createCommentVNode("v-if", true);
|
|
6817
6228
|
};
|
|
6818
6229
|
}
|
|
6819
6230
|
});
|
|
6820
6231
|
|
|
6821
6232
|
const _hoisted_1$4 = { class: "m-fields-number-range" };
|
|
6822
|
-
const _sfc_main$
|
|
6233
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
6823
6234
|
...{
|
|
6824
6235
|
name: "MFormNumberRange"
|
|
6825
6236
|
},
|
|
@@ -6852,14 +6263,13 @@
|
|
|
6852
6263
|
return (_ctx, _cache) => {
|
|
6853
6264
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
6854
6265
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
clearable: "",
|
|
6266
|
+
"model-value": __props.model[__props.name][0],
|
|
6267
|
+
clearable: __props.config.clearable ?? true,
|
|
6858
6268
|
size: __props.size,
|
|
6859
6269
|
disabled: __props.disabled,
|
|
6860
|
-
|
|
6861
|
-
}, null, 8, ["
|
|
6862
|
-
_cache[
|
|
6270
|
+
"onUpdate:modelValue": minChangeHandler
|
|
6271
|
+
}, null, 8, ["model-value", "clearable", "size", "disabled"]),
|
|
6272
|
+
_cache[0] || (_cache[0] = vue.createElementVNode(
|
|
6863
6273
|
"span",
|
|
6864
6274
|
{ class: "split-tag" },
|
|
6865
6275
|
"-",
|
|
@@ -6867,20 +6277,18 @@
|
|
|
6867
6277
|
/* CACHED */
|
|
6868
6278
|
)),
|
|
6869
6279
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
clearable: "",
|
|
6280
|
+
"model-value": __props.model[__props.name][1],
|
|
6281
|
+
clearable: __props.config.clearable ?? true,
|
|
6873
6282
|
size: __props.size,
|
|
6874
6283
|
disabled: __props.disabled,
|
|
6875
|
-
|
|
6876
|
-
}, null, 8, ["
|
|
6284
|
+
"onUpdate:modelValue": maxChangeHandler
|
|
6285
|
+
}, null, 8, ["model-value", "clearable", "size", "disabled"])
|
|
6877
6286
|
]);
|
|
6878
6287
|
};
|
|
6879
6288
|
}
|
|
6880
6289
|
});
|
|
6881
6290
|
|
|
6882
|
-
const
|
|
6883
|
-
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
6291
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
6884
6292
|
...{
|
|
6885
6293
|
name: "MFormRadioGroup"
|
|
6886
6294
|
},
|
|
@@ -6901,12 +6309,8 @@
|
|
|
6901
6309
|
const props = __props;
|
|
6902
6310
|
const itemComponent = vue.computed(() => props.config.childType === "button" ? design.TMagicRadioButton : design.TMagicRadio);
|
|
6903
6311
|
const emit = __emit;
|
|
6904
|
-
const changeHandler = (value) => {
|
|
6905
|
-
emit("change", value);
|
|
6906
|
-
};
|
|
6907
6312
|
const clickHandler = (item) => {
|
|
6908
|
-
|
|
6909
|
-
changeHandler(props.model[props.name]);
|
|
6313
|
+
emit("change", props.model[props.name] === item ? "" : item);
|
|
6910
6314
|
};
|
|
6911
6315
|
useAddField(props.prop);
|
|
6912
6316
|
const iconSize = vue.computed(() => {
|
|
@@ -6921,8 +6325,7 @@
|
|
|
6921
6325
|
return (_ctx, _cache) => {
|
|
6922
6326
|
return __props.model ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadioGroup), {
|
|
6923
6327
|
key: 0,
|
|
6924
|
-
|
|
6925
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
6328
|
+
"model-value": __props.model[__props.name],
|
|
6926
6329
|
size: __props.size,
|
|
6927
6330
|
disabled: __props.disabled
|
|
6928
6331
|
}, {
|
|
@@ -6934,11 +6337,11 @@
|
|
|
6934
6337
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(itemComponent.value), {
|
|
6935
6338
|
value: option.value,
|
|
6936
6339
|
key: `${option.value}`,
|
|
6937
|
-
onClick:
|
|
6340
|
+
onClick: ($event) => clickHandler(option.value)
|
|
6938
6341
|
}, {
|
|
6939
6342
|
default: vue.withCtx(() => [
|
|
6940
|
-
|
|
6941
|
-
|
|
6343
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
6344
|
+
disabled: !Boolean(option.tooltip),
|
|
6942
6345
|
placement: "top-start",
|
|
6943
6346
|
content: option.tooltip
|
|
6944
6347
|
}, {
|
|
@@ -6965,25 +6368,7 @@
|
|
|
6965
6368
|
]),
|
|
6966
6369
|
_: 2
|
|
6967
6370
|
/* DYNAMIC */
|
|
6968
|
-
}, 1032, ["
|
|
6969
|
-
option.icon ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
6970
|
-
key: 0,
|
|
6971
|
-
size: iconSize.value
|
|
6972
|
-
}, {
|
|
6973
|
-
default: vue.withCtx(() => [
|
|
6974
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(option.icon)))
|
|
6975
|
-
]),
|
|
6976
|
-
_: 2
|
|
6977
|
-
/* DYNAMIC */
|
|
6978
|
-
}, 1032, ["size"])) : vue.createCommentVNode("v-if", true),
|
|
6979
|
-
vue.createElementVNode(
|
|
6980
|
-
"span",
|
|
6981
|
-
null,
|
|
6982
|
-
vue.toDisplayString(option.text),
|
|
6983
|
-
1
|
|
6984
|
-
/* TEXT */
|
|
6985
|
-
)
|
|
6986
|
-
]))
|
|
6371
|
+
}, 1032, ["disabled", "content"])
|
|
6987
6372
|
]),
|
|
6988
6373
|
_: 2
|
|
6989
6374
|
/* DYNAMIC */
|
|
@@ -6995,13 +6380,13 @@
|
|
|
6995
6380
|
]),
|
|
6996
6381
|
_: 1
|
|
6997
6382
|
/* STABLE */
|
|
6998
|
-
}, 8, ["
|
|
6383
|
+
}, 8, ["model-value", "size", "disabled"])) : vue.createCommentVNode("v-if", true);
|
|
6999
6384
|
};
|
|
7000
6385
|
}
|
|
7001
6386
|
});
|
|
7002
6387
|
|
|
7003
|
-
const _hoisted_1$
|
|
7004
|
-
const _sfc_main$
|
|
6388
|
+
const _hoisted_1$3 = { key: 2 };
|
|
6389
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
7005
6390
|
...{
|
|
7006
6391
|
name: "MFormSelect"
|
|
7007
6392
|
},
|
|
@@ -7328,8 +6713,7 @@
|
|
|
7328
6713
|
const _directive_loading = vue.resolveDirective("loading");
|
|
7329
6714
|
return __props.model ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicSelect), {
|
|
7330
6715
|
key: 0,
|
|
7331
|
-
|
|
7332
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
6716
|
+
"model-value": __props.model[__props.name],
|
|
7333
6717
|
class: "m-select",
|
|
7334
6718
|
ref_key: "tMagicSelect",
|
|
7335
6719
|
ref: tMagicSelect,
|
|
@@ -7344,7 +6728,7 @@
|
|
|
7344
6728
|
"allow-create": __props.config.allowCreate,
|
|
7345
6729
|
disabled: __props.disabled,
|
|
7346
6730
|
"remote-method": __props.config.remote && remoteMethod,
|
|
7347
|
-
|
|
6731
|
+
"onUpdate:modelValue": changeHandler,
|
|
7348
6732
|
onVisibleChange: visibleHandler
|
|
7349
6733
|
}, {
|
|
7350
6734
|
default: vue.withCtx(() => [
|
|
@@ -7436,7 +6820,7 @@
|
|
|
7436
6820
|
)),
|
|
7437
6821
|
moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
|
7438
6822
|
"div",
|
|
7439
|
-
_hoisted_1$
|
|
6823
|
+
_hoisted_1$3,
|
|
7440
6824
|
null,
|
|
7441
6825
|
512
|
|
7442
6826
|
/* NEED_PATCH */
|
|
@@ -7446,14 +6830,14 @@
|
|
|
7446
6830
|
]),
|
|
7447
6831
|
_: 1
|
|
7448
6832
|
/* STABLE */
|
|
7449
|
-
}, 8, ["
|
|
6833
|
+
}, 8, ["model-value", "clearable", "filterable", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method"])), [
|
|
7450
6834
|
[_directive_loading, loading.value]
|
|
7451
6835
|
]) : vue.createCommentVNode("v-if", true);
|
|
7452
6836
|
};
|
|
7453
6837
|
}
|
|
7454
6838
|
});
|
|
7455
6839
|
|
|
7456
|
-
const _sfc_main$
|
|
6840
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
7457
6841
|
...{
|
|
7458
6842
|
name: "MFormSwitch"
|
|
7459
6843
|
},
|
|
@@ -7499,21 +6883,21 @@
|
|
|
7499
6883
|
});
|
|
7500
6884
|
return (_ctx, _cache) => {
|
|
7501
6885
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicSwitch), {
|
|
7502
|
-
|
|
7503
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
6886
|
+
"model-value": __props.model[__props.name],
|
|
7504
6887
|
size: __props.size,
|
|
7505
6888
|
activeValue: activeValue.value,
|
|
7506
6889
|
inactiveValue: inactiveValue.value,
|
|
7507
6890
|
disabled: __props.disabled,
|
|
7508
|
-
|
|
7509
|
-
}, null, 8, ["
|
|
6891
|
+
"onUpdate:modelValue": changeHandler
|
|
6892
|
+
}, null, 8, ["model-value", "size", "activeValue", "inactiveValue", "disabled"]);
|
|
7510
6893
|
};
|
|
7511
6894
|
}
|
|
7512
6895
|
});
|
|
7513
6896
|
|
|
7514
|
-
const _hoisted_1$
|
|
7515
|
-
const _hoisted_2 = {
|
|
7516
|
-
const
|
|
6897
|
+
const _hoisted_1$2 = { class: "m-fields-text" };
|
|
6898
|
+
const _hoisted_2$1 = { key: 1 };
|
|
6899
|
+
const _hoisted_3$1 = { style: { "display": "flex", "justify-content": "flex-end" } };
|
|
6900
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
7517
6901
|
...{
|
|
7518
6902
|
name: "MFormText"
|
|
7519
6903
|
},
|
|
@@ -7538,16 +6922,25 @@
|
|
|
7538
6922
|
const appendConfig = vue.computed(() => {
|
|
7539
6923
|
if (typeof props.config.append === "string") {
|
|
7540
6924
|
return {
|
|
6925
|
+
type: "text",
|
|
7541
6926
|
text: props.config.append,
|
|
7542
|
-
type: "button",
|
|
7543
6927
|
handler: void 0
|
|
7544
6928
|
};
|
|
7545
6929
|
}
|
|
7546
|
-
if (
|
|
7547
|
-
if (props.config.append
|
|
7548
|
-
return
|
|
6930
|
+
if (typeof props.config.append === "object") {
|
|
6931
|
+
if (typeof props.config.append?.handler === "function") {
|
|
6932
|
+
return {
|
|
6933
|
+
type: "button",
|
|
6934
|
+
text: props.config.append.text,
|
|
6935
|
+
handler: props.config.append.handler
|
|
6936
|
+
};
|
|
6937
|
+
}
|
|
6938
|
+
if (props.config.append) {
|
|
6939
|
+
if (props.config.append.value === 0) {
|
|
6940
|
+
return false;
|
|
6941
|
+
}
|
|
6942
|
+
return props.config.append;
|
|
7549
6943
|
}
|
|
7550
|
-
return props.config.append;
|
|
7551
6944
|
}
|
|
7552
6945
|
return false;
|
|
7553
6946
|
});
|
|
@@ -7652,23 +7045,35 @@
|
|
|
7652
7045
|
instanceRef.value = void 0;
|
|
7653
7046
|
};
|
|
7654
7047
|
return (_ctx, _cache) => {
|
|
7655
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
7048
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
|
|
7656
7049
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
7657
|
-
|
|
7658
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
7050
|
+
"model-value": __props.model[__props.name],
|
|
7659
7051
|
ref_key: "input",
|
|
7660
7052
|
ref: input,
|
|
7661
7053
|
clearable: "",
|
|
7662
7054
|
size: __props.size,
|
|
7663
7055
|
placeholder: __props.config.placeholder,
|
|
7664
7056
|
disabled: __props.disabled,
|
|
7665
|
-
|
|
7057
|
+
"onUpdate:modelValue": changeHandler,
|
|
7666
7058
|
onInput: inputHandler,
|
|
7667
|
-
onKeyup: _cache[
|
|
7059
|
+
onKeyup: _cache[0] || (_cache[0] = ($event) => keyUpHandler($event))
|
|
7668
7060
|
}, vue.createSlots({
|
|
7669
7061
|
_: 2
|
|
7670
7062
|
/* DYNAMIC */
|
|
7671
7063
|
}, [
|
|
7064
|
+
__props.config.prepend ? {
|
|
7065
|
+
name: "prepend",
|
|
7066
|
+
fn: vue.withCtx(() => [
|
|
7067
|
+
vue.createElementVNode(
|
|
7068
|
+
"span",
|
|
7069
|
+
null,
|
|
7070
|
+
vue.toDisplayString(__props.config.prepend),
|
|
7071
|
+
1
|
|
7072
|
+
/* TEXT */
|
|
7073
|
+
)
|
|
7074
|
+
]),
|
|
7075
|
+
key: "0"
|
|
7076
|
+
} : void 0,
|
|
7672
7077
|
appendConfig.value ? {
|
|
7673
7078
|
name: "append",
|
|
7674
7079
|
fn: vue.withCtx(() => [
|
|
@@ -7687,11 +7092,17 @@
|
|
|
7687
7092
|
]),
|
|
7688
7093
|
_: 1
|
|
7689
7094
|
/* STABLE */
|
|
7690
|
-
}, 8, ["size"])) : vue.
|
|
7095
|
+
}, 8, ["size"])) : (vue.openBlock(), vue.createElementBlock(
|
|
7096
|
+
"span",
|
|
7097
|
+
_hoisted_2$1,
|
|
7098
|
+
vue.toDisplayString(appendConfig.value.text),
|
|
7099
|
+
1
|
|
7100
|
+
/* TEXT */
|
|
7101
|
+
))
|
|
7691
7102
|
]),
|
|
7692
|
-
key: "
|
|
7103
|
+
key: "1"
|
|
7693
7104
|
} : void 0
|
|
7694
|
-
]), 1032, ["
|
|
7105
|
+
]), 1032, ["model-value", "size", "placeholder", "disabled"]),
|
|
7695
7106
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
7696
7107
|
popoverVisible.value ? (vue.openBlock(), vue.createElementBlock(
|
|
7697
7108
|
"div",
|
|
@@ -7702,20 +7113,20 @@
|
|
|
7702
7113
|
ref: popoverEl
|
|
7703
7114
|
},
|
|
7704
7115
|
[
|
|
7705
|
-
_cache[
|
|
7116
|
+
_cache[4] || (_cache[4] = vue.createElementVNode(
|
|
7706
7117
|
"div",
|
|
7707
7118
|
{ class: "m-form-validate__warning" },
|
|
7708
7119
|
"输入内容前后有空格,是否移除空格?",
|
|
7709
7120
|
-1
|
|
7710
7121
|
/* CACHED */
|
|
7711
7122
|
)),
|
|
7712
|
-
vue.createElementVNode("div",
|
|
7123
|
+
vue.createElementVNode("div", _hoisted_3$1, [
|
|
7713
7124
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
7714
7125
|
link: "",
|
|
7715
7126
|
size: "small",
|
|
7716
|
-
onClick: _cache[
|
|
7127
|
+
onClick: _cache[1] || (_cache[1] = ($event) => popoverVisible.value = false)
|
|
7717
7128
|
}, {
|
|
7718
|
-
default: vue.withCtx(() => [..._cache[
|
|
7129
|
+
default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
7719
7130
|
vue.createTextVNode(
|
|
7720
7131
|
"保持原样",
|
|
7721
7132
|
-1
|
|
@@ -7730,7 +7141,7 @@
|
|
|
7730
7141
|
size: "small",
|
|
7731
7142
|
onClick: confirmTrimHandler
|
|
7732
7143
|
}, {
|
|
7733
|
-
default: vue.withCtx(() => [..._cache[
|
|
7144
|
+
default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
7734
7145
|
vue.createTextVNode(
|
|
7735
7146
|
"移除空格",
|
|
7736
7147
|
-1
|
|
@@ -7741,7 +7152,7 @@
|
|
|
7741
7152
|
/* STABLE */
|
|
7742
7153
|
})
|
|
7743
7154
|
]),
|
|
7744
|
-
_cache[
|
|
7155
|
+
_cache[5] || (_cache[5] = vue.createElementVNode(
|
|
7745
7156
|
"span",
|
|
7746
7157
|
{
|
|
7747
7158
|
class: "tmagic-form-text-popper-arrow",
|
|
@@ -7761,162 +7172,990 @@
|
|
|
7761
7172
|
}
|
|
7762
7173
|
});
|
|
7763
7174
|
|
|
7175
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
7176
|
+
...{
|
|
7177
|
+
name: "MFormTextarea"
|
|
7178
|
+
},
|
|
7179
|
+
__name: "Textarea",
|
|
7180
|
+
props: {
|
|
7181
|
+
config: {},
|
|
7182
|
+
model: {},
|
|
7183
|
+
initValues: {},
|
|
7184
|
+
values: {},
|
|
7185
|
+
name: {},
|
|
7186
|
+
prop: {},
|
|
7187
|
+
disabled: { type: Boolean },
|
|
7188
|
+
size: {},
|
|
7189
|
+
lastValues: {}
|
|
7190
|
+
},
|
|
7191
|
+
emits: ["change", "input"],
|
|
7192
|
+
setup(__props, { emit: __emit }) {
|
|
7193
|
+
const props = __props;
|
|
7194
|
+
const emit = __emit;
|
|
7195
|
+
useAddField(props.prop);
|
|
7196
|
+
const mForm = vue.inject("mForm");
|
|
7197
|
+
const changeHandler = (value) => {
|
|
7198
|
+
emit("change", value);
|
|
7199
|
+
};
|
|
7200
|
+
const inputHandler = (v) => {
|
|
7201
|
+
emit("input", v);
|
|
7202
|
+
mForm?.$emit("field-input", props.prop, v);
|
|
7203
|
+
};
|
|
7204
|
+
return (_ctx, _cache) => {
|
|
7205
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
|
|
7206
|
+
"model-value": __props.model[__props.name],
|
|
7207
|
+
type: "textarea",
|
|
7208
|
+
size: __props.size,
|
|
7209
|
+
clearable: "",
|
|
7210
|
+
placeholder: __props.config.placeholder,
|
|
7211
|
+
disabled: __props.disabled,
|
|
7212
|
+
rows: __props.config.rows,
|
|
7213
|
+
"onUpdate:modelValue": changeHandler,
|
|
7214
|
+
onInput: inputHandler
|
|
7215
|
+
}, null, 8, ["model-value", "size", "placeholder", "disabled", "rows"]);
|
|
7216
|
+
};
|
|
7217
|
+
}
|
|
7218
|
+
});
|
|
7219
|
+
|
|
7220
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
7221
|
+
...{
|
|
7222
|
+
name: "MFormTime"
|
|
7223
|
+
},
|
|
7224
|
+
__name: "Time",
|
|
7225
|
+
props: {
|
|
7226
|
+
config: {},
|
|
7227
|
+
model: {},
|
|
7228
|
+
initValues: {},
|
|
7229
|
+
values: {},
|
|
7230
|
+
name: {},
|
|
7231
|
+
prop: {},
|
|
7232
|
+
disabled: { type: Boolean },
|
|
7233
|
+
size: {},
|
|
7234
|
+
lastValues: {}
|
|
7235
|
+
},
|
|
7236
|
+
emits: ["change"],
|
|
7237
|
+
setup(__props, { emit: __emit }) {
|
|
7238
|
+
const props = __props;
|
|
7239
|
+
const emit = __emit;
|
|
7240
|
+
useAddField(props.prop);
|
|
7241
|
+
const changeHandler = (v) => {
|
|
7242
|
+
emit("change", v);
|
|
7243
|
+
};
|
|
7244
|
+
return (_ctx, _cache) => {
|
|
7245
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTimePicker), {
|
|
7246
|
+
"model-value": __props.model[__props.name],
|
|
7247
|
+
"value-format": __props.config.valueFormat || "HH:mm:ss",
|
|
7248
|
+
format: __props.config.format || "HH:mm:ss",
|
|
7249
|
+
size: __props.size,
|
|
7250
|
+
placeholder: __props.config.placeholder,
|
|
7251
|
+
disabled: __props.disabled,
|
|
7252
|
+
"onUpdate:modelValue": changeHandler
|
|
7253
|
+
}, null, 8, ["model-value", "value-format", "format", "size", "placeholder", "disabled"]);
|
|
7254
|
+
};
|
|
7255
|
+
}
|
|
7256
|
+
});
|
|
7257
|
+
|
|
7258
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
7259
|
+
...{
|
|
7260
|
+
name: "MFormTimeRange"
|
|
7261
|
+
},
|
|
7262
|
+
__name: "Timerange",
|
|
7263
|
+
props: {
|
|
7264
|
+
config: {},
|
|
7265
|
+
model: {},
|
|
7266
|
+
initValues: {},
|
|
7267
|
+
values: {},
|
|
7268
|
+
name: {},
|
|
7269
|
+
prop: {},
|
|
7270
|
+
disabled: { type: Boolean },
|
|
7271
|
+
size: {},
|
|
7272
|
+
lastValues: {}
|
|
7273
|
+
},
|
|
7274
|
+
emits: ["change"],
|
|
7275
|
+
setup(__props, { emit: __emit }) {
|
|
7276
|
+
const props = __props;
|
|
7277
|
+
const emit = __emit;
|
|
7278
|
+
useAddField(props.prop);
|
|
7279
|
+
const { names } = props.config;
|
|
7280
|
+
const value = vue.ref([]);
|
|
7281
|
+
if (props.model !== void 0 && names?.length) {
|
|
7282
|
+
vue.watch(
|
|
7283
|
+
[() => props.model[names[0]], () => props.model[names[1]]],
|
|
7284
|
+
([start, end], [preStart, preEnd]) => {
|
|
7285
|
+
if (!value.value) {
|
|
7286
|
+
value.value = [];
|
|
7287
|
+
}
|
|
7288
|
+
if (!start || !end) value.value = [];
|
|
7289
|
+
if (start !== preStart) value.value[0] = start;
|
|
7290
|
+
if (end !== preEnd) value.value[1] = end;
|
|
7291
|
+
},
|
|
7292
|
+
{
|
|
7293
|
+
immediate: true
|
|
7294
|
+
}
|
|
7295
|
+
);
|
|
7296
|
+
}
|
|
7297
|
+
const setValue = (v) => {
|
|
7298
|
+
names?.forEach((item, index) => {
|
|
7299
|
+
if (!props.model) {
|
|
7300
|
+
return;
|
|
7301
|
+
}
|
|
7302
|
+
if (Array.isArray(v)) {
|
|
7303
|
+
props.model[item] = v[index];
|
|
7304
|
+
} else {
|
|
7305
|
+
props.model[item] = void 0;
|
|
7306
|
+
}
|
|
7307
|
+
});
|
|
7308
|
+
};
|
|
7309
|
+
const changeHandler = (v) => {
|
|
7310
|
+
const value2 = v || [];
|
|
7311
|
+
if (names?.length) {
|
|
7312
|
+
setValue(value2);
|
|
7313
|
+
}
|
|
7314
|
+
emit("change", value2);
|
|
7315
|
+
};
|
|
7316
|
+
return (_ctx, _cache) => {
|
|
7317
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTimePicker), {
|
|
7318
|
+
"model-value": value.value,
|
|
7319
|
+
"is-range": "",
|
|
7320
|
+
"range-separator": "-",
|
|
7321
|
+
"start-placeholder": "开始时间",
|
|
7322
|
+
"end-placeholder": "结束时间",
|
|
7323
|
+
size: __props.size,
|
|
7324
|
+
"unlink-panels": true,
|
|
7325
|
+
disabled: __props.disabled,
|
|
7326
|
+
"default-time": __props.config.defaultTime,
|
|
7327
|
+
"onUpdate:modelValue": changeHandler
|
|
7328
|
+
}, null, 8, ["model-value", "size", "disabled", "default-time"]);
|
|
7329
|
+
};
|
|
7330
|
+
}
|
|
7331
|
+
});
|
|
7332
|
+
|
|
7333
|
+
const useAdd = (props, emit) => {
|
|
7334
|
+
const mForm = vue.inject("mForm");
|
|
7335
|
+
const addable = vue.computed(() => {
|
|
7336
|
+
const modelName = props.name || props.config.name || "";
|
|
7337
|
+
if (!props.model[modelName].length) {
|
|
7338
|
+
return true;
|
|
7339
|
+
}
|
|
7340
|
+
if (typeof props.config.addable === "function") {
|
|
7341
|
+
return props.config.addable(mForm, {
|
|
7342
|
+
model: props.model[modelName],
|
|
7343
|
+
formValue: mForm?.values,
|
|
7344
|
+
prop: props.prop
|
|
7345
|
+
});
|
|
7346
|
+
}
|
|
7347
|
+
return typeof props.config.addable === "undefined" ? true : props.config.addable;
|
|
7348
|
+
});
|
|
7349
|
+
const newHandler = async (row) => {
|
|
7350
|
+
const modelName = props.name || props.config.name || "";
|
|
7351
|
+
if (props.config.max && props.model[modelName].length >= props.config.max) {
|
|
7352
|
+
design.tMagicMessage.error(`最多新增配置不能超过${props.config.max}条`);
|
|
7353
|
+
return;
|
|
7354
|
+
}
|
|
7355
|
+
if (typeof props.config.beforeAddRow === "function") {
|
|
7356
|
+
const beforeCheckRes = props.config.beforeAddRow(mForm, {
|
|
7357
|
+
model: props.model[modelName],
|
|
7358
|
+
formValue: mForm?.values,
|
|
7359
|
+
prop: props.prop
|
|
7360
|
+
});
|
|
7361
|
+
if (!beforeCheckRes) return;
|
|
7362
|
+
}
|
|
7363
|
+
const columns = props.config.items;
|
|
7364
|
+
const enumValues = props.config.enum || [];
|
|
7365
|
+
let enumV = [];
|
|
7366
|
+
const { length } = props.model[modelName];
|
|
7367
|
+
const key = props.config.key || "id";
|
|
7368
|
+
let inputs = {};
|
|
7369
|
+
if (enumValues.length) {
|
|
7370
|
+
if (length >= enumValues.length) {
|
|
7371
|
+
return;
|
|
7372
|
+
}
|
|
7373
|
+
enumV = enumValues.filter((item) => {
|
|
7374
|
+
let i = 0;
|
|
7375
|
+
for (; i < length; i++) {
|
|
7376
|
+
if (item[key] === props.model[modelName][i][key]) {
|
|
7377
|
+
break;
|
|
7378
|
+
}
|
|
7379
|
+
}
|
|
7380
|
+
return i === length;
|
|
7381
|
+
});
|
|
7382
|
+
if (enumV.length > 0) {
|
|
7383
|
+
inputs = enumV[0];
|
|
7384
|
+
}
|
|
7385
|
+
} else if (Array.isArray(row)) {
|
|
7386
|
+
columns.forEach((column, index) => {
|
|
7387
|
+
column.name && (inputs[column.name] = row[index]);
|
|
7388
|
+
});
|
|
7389
|
+
} else {
|
|
7390
|
+
if (typeof props.config.defaultAdd === "function") {
|
|
7391
|
+
inputs = await props.config.defaultAdd(mForm, {
|
|
7392
|
+
model: props.model[modelName],
|
|
7393
|
+
formValue: mForm?.values
|
|
7394
|
+
});
|
|
7395
|
+
} else if (props.config.defaultAdd) {
|
|
7396
|
+
inputs = props.config.defaultAdd;
|
|
7397
|
+
}
|
|
7398
|
+
inputs = await initValue(mForm, {
|
|
7399
|
+
config: columns,
|
|
7400
|
+
initValues: inputs
|
|
7401
|
+
});
|
|
7402
|
+
}
|
|
7403
|
+
if (props.sortKey && length) {
|
|
7404
|
+
inputs[props.sortKey] = props.model[modelName][length - 1][props.sortKey] - 1;
|
|
7405
|
+
}
|
|
7406
|
+
emit("change", [...props.model[modelName], inputs], {
|
|
7407
|
+
changeRecords: [
|
|
7408
|
+
{
|
|
7409
|
+
propPath: `${props.prop}.${props.model[modelName].length}`,
|
|
7410
|
+
value: inputs
|
|
7411
|
+
}
|
|
7412
|
+
]
|
|
7413
|
+
});
|
|
7414
|
+
};
|
|
7415
|
+
return {
|
|
7416
|
+
addable,
|
|
7417
|
+
newHandler
|
|
7418
|
+
};
|
|
7419
|
+
};
|
|
7420
|
+
|
|
7421
|
+
const useFullscreen = () => {
|
|
7422
|
+
const isFullscreen = vue.ref(false);
|
|
7423
|
+
const mTableEl = vue.useTemplateRef("mTable");
|
|
7424
|
+
const { nextZIndex } = design.useZIndex();
|
|
7425
|
+
const toggleFullscreen = () => {
|
|
7426
|
+
if (!mTableEl.value) return;
|
|
7427
|
+
if (isFullscreen.value) {
|
|
7428
|
+
mTableEl.value.classList.remove("fixed");
|
|
7429
|
+
isFullscreen.value = false;
|
|
7430
|
+
} else {
|
|
7431
|
+
mTableEl.value.classList.add("fixed");
|
|
7432
|
+
mTableEl.value.style.zIndex = `${nextZIndex()}`;
|
|
7433
|
+
isFullscreen.value = true;
|
|
7434
|
+
}
|
|
7435
|
+
};
|
|
7436
|
+
return {
|
|
7437
|
+
isFullscreen,
|
|
7438
|
+
toggleFullscreen
|
|
7439
|
+
};
|
|
7440
|
+
};
|
|
7441
|
+
|
|
7442
|
+
const useImport = (props, emit, newHandler) => {
|
|
7443
|
+
const mForm = vue.inject("mForm");
|
|
7444
|
+
const modelName = vue.computed(() => props.name || props.config.name || "");
|
|
7445
|
+
const importable = vue.computed(() => {
|
|
7446
|
+
if (typeof props.config.importable === "function") {
|
|
7447
|
+
return props.config.importable(mForm, {
|
|
7448
|
+
formValue: mForm?.values,
|
|
7449
|
+
model: props.model[modelName.value]
|
|
7450
|
+
});
|
|
7451
|
+
}
|
|
7452
|
+
return typeof props.config.importable === "undefined" ? false : props.config.importable;
|
|
7453
|
+
});
|
|
7454
|
+
const excelBtn = vue.useTemplateRef("excelBtn");
|
|
7455
|
+
const excelHandler = async (file) => {
|
|
7456
|
+
if (!file?.raw) {
|
|
7457
|
+
return false;
|
|
7458
|
+
}
|
|
7459
|
+
if (!globalThis.XLSX) {
|
|
7460
|
+
await utils.asyncLoadJs("https://cdn.bootcdn.net/ajax/libs/xlsx/0.17.0/xlsx.full.min.js");
|
|
7461
|
+
}
|
|
7462
|
+
const reader = new FileReader();
|
|
7463
|
+
reader.onload = () => {
|
|
7464
|
+
const data = reader.result;
|
|
7465
|
+
const pdata = globalThis.XLSX.read(data, { type: "array" });
|
|
7466
|
+
pdata.SheetNames.forEach((sheetName) => {
|
|
7467
|
+
const arr = globalThis.XLSX.utils.sheet_to_json(pdata.Sheets[sheetName], { header: 1 });
|
|
7468
|
+
if (arr?.[0]) {
|
|
7469
|
+
arr.forEach((row) => {
|
|
7470
|
+
newHandler(row);
|
|
7471
|
+
});
|
|
7472
|
+
}
|
|
7473
|
+
setTimeout(() => {
|
|
7474
|
+
excelBtn.value?.clearFiles();
|
|
7475
|
+
}, 300);
|
|
7476
|
+
});
|
|
7477
|
+
};
|
|
7478
|
+
reader.readAsArrayBuffer(file.raw);
|
|
7479
|
+
return false;
|
|
7480
|
+
};
|
|
7481
|
+
const clearHandler = () => {
|
|
7482
|
+
emit("change", []);
|
|
7483
|
+
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
7484
|
+
};
|
|
7485
|
+
return {
|
|
7486
|
+
importable,
|
|
7487
|
+
excelHandler,
|
|
7488
|
+
clearHandler
|
|
7489
|
+
};
|
|
7490
|
+
};
|
|
7491
|
+
|
|
7492
|
+
const usePagination = (props, modelName) => {
|
|
7493
|
+
const pageSize = vue.ref(10);
|
|
7494
|
+
const currentPage = vue.ref(0);
|
|
7495
|
+
const paginationData = vue.computed(() => getDataByPage(props.model[modelName.value], currentPage.value, pageSize.value));
|
|
7496
|
+
const handleSizeChange = (val) => {
|
|
7497
|
+
pageSize.value = val;
|
|
7498
|
+
};
|
|
7499
|
+
const handleCurrentChange = (val) => {
|
|
7500
|
+
currentPage.value = val - 1;
|
|
7501
|
+
};
|
|
7502
|
+
return {
|
|
7503
|
+
pageSize,
|
|
7504
|
+
currentPage,
|
|
7505
|
+
paginationData,
|
|
7506
|
+
handleSizeChange,
|
|
7507
|
+
handleCurrentChange
|
|
7508
|
+
};
|
|
7509
|
+
};
|
|
7510
|
+
|
|
7511
|
+
const useSelection = (props, emit, tMagicTableRef) => {
|
|
7512
|
+
const mForm = vue.inject("mForm");
|
|
7513
|
+
const selectHandle = (selection, row) => {
|
|
7514
|
+
if (typeof props.config.selection === "string" && props.config.selection === "single") {
|
|
7515
|
+
tMagicTableRef.value?.clearSelection();
|
|
7516
|
+
tMagicTableRef.value?.toggleRowSelection(row, true);
|
|
7517
|
+
}
|
|
7518
|
+
emit("select", selection, row);
|
|
7519
|
+
if (typeof props.config.onSelect === "function") {
|
|
7520
|
+
props.config.onSelect(mForm, { selection, row, config: props.config });
|
|
7521
|
+
}
|
|
7522
|
+
};
|
|
7523
|
+
const toggleRowSelection = (row, selected) => {
|
|
7524
|
+
tMagicTableRef.value?.toggleRowSelection.call(tMagicTableRef.value?.getTableRef(), row, selected);
|
|
7525
|
+
};
|
|
7526
|
+
return {
|
|
7527
|
+
selectHandle,
|
|
7528
|
+
toggleRowSelection
|
|
7529
|
+
};
|
|
7530
|
+
};
|
|
7531
|
+
|
|
7532
|
+
const useSortable = (props, emit, tMagicTableRef, modelName) => {
|
|
7533
|
+
const mForm = vue.inject("mForm");
|
|
7534
|
+
let sortable;
|
|
7535
|
+
const rowDrop = () => {
|
|
7536
|
+
sortable?.destroy();
|
|
7537
|
+
const tableEl = tMagicTableRef.value?.getEl();
|
|
7538
|
+
const tBodyEl = tableEl?.querySelector(".el-table__body > tbody");
|
|
7539
|
+
if (!tBodyEl) {
|
|
7540
|
+
return;
|
|
7541
|
+
}
|
|
7542
|
+
sortable = Sortable.create(tBodyEl, {
|
|
7543
|
+
draggable: ".tmagic-design-table-row",
|
|
7544
|
+
filter: "input",
|
|
7545
|
+
// 表单组件选字操作和触发拖拽会冲突,优先保证选字操作
|
|
7546
|
+
preventOnFilter: false,
|
|
7547
|
+
// 允许选字
|
|
7548
|
+
direction: "vertical",
|
|
7549
|
+
onEnd: ({ newIndex, oldIndex }) => {
|
|
7550
|
+
if (typeof newIndex === "undefined") return;
|
|
7551
|
+
if (typeof oldIndex === "undefined") return;
|
|
7552
|
+
const newData = sortArray(props.model[modelName.value], newIndex, oldIndex, props.sortKey);
|
|
7553
|
+
emit("change", newData);
|
|
7554
|
+
mForm?.$emit("field-change", newData);
|
|
7555
|
+
}
|
|
7556
|
+
});
|
|
7557
|
+
};
|
|
7558
|
+
vue.watchEffect(() => {
|
|
7559
|
+
if (props.config.dropSort) {
|
|
7560
|
+
rowDrop();
|
|
7561
|
+
}
|
|
7562
|
+
});
|
|
7563
|
+
};
|
|
7564
|
+
|
|
7764
7565
|
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
7765
|
-
|
|
7766
|
-
name: "MFormTextarea"
|
|
7767
|
-
},
|
|
7768
|
-
__name: "Textarea",
|
|
7566
|
+
__name: "ActionsColumn",
|
|
7769
7567
|
props: {
|
|
7770
7568
|
config: {},
|
|
7771
7569
|
model: {},
|
|
7772
|
-
initValues: {},
|
|
7773
|
-
values: {},
|
|
7774
7570
|
name: {},
|
|
7775
|
-
prop: {},
|
|
7776
7571
|
disabled: { type: Boolean },
|
|
7777
|
-
|
|
7778
|
-
|
|
7572
|
+
currentPage: {},
|
|
7573
|
+
pageSize: {},
|
|
7574
|
+
index: {},
|
|
7575
|
+
row: {},
|
|
7576
|
+
prop: {},
|
|
7577
|
+
sortKey: {}
|
|
7779
7578
|
},
|
|
7780
|
-
emits: ["change"
|
|
7579
|
+
emits: ["change"],
|
|
7781
7580
|
setup(__props, { emit: __emit }) {
|
|
7782
|
-
const props = __props;
|
|
7783
7581
|
const emit = __emit;
|
|
7784
|
-
|
|
7582
|
+
const props = __props;
|
|
7785
7583
|
const mForm = vue.inject("mForm");
|
|
7786
|
-
const
|
|
7787
|
-
|
|
7584
|
+
const removeHandler = (index) => {
|
|
7585
|
+
if (props.disabled) return;
|
|
7586
|
+
emit("change", props.model[props.name].toSpliced(index, 1));
|
|
7788
7587
|
};
|
|
7789
|
-
const
|
|
7790
|
-
|
|
7791
|
-
|
|
7588
|
+
const copyHandler = (index) => {
|
|
7589
|
+
const inputs = cloneDeep(props.model[props.name][index]);
|
|
7590
|
+
const { length } = props.model[props.name];
|
|
7591
|
+
if (props.sortKey && length) {
|
|
7592
|
+
inputs[props.sortKey] = props.model[props.name][length - 1][props.sortKey] - 1;
|
|
7593
|
+
}
|
|
7594
|
+
emit("change", [...props.model[props.name], inputs], {
|
|
7595
|
+
changeRecords: [
|
|
7596
|
+
{
|
|
7597
|
+
propPath: `${props.prop}.${props.model[props.name].length}`,
|
|
7598
|
+
value: inputs
|
|
7599
|
+
}
|
|
7600
|
+
]
|
|
7601
|
+
});
|
|
7602
|
+
};
|
|
7603
|
+
const showDelete = (index) => {
|
|
7604
|
+
const deleteFunc = props.config.delete;
|
|
7605
|
+
if (deleteFunc && typeof deleteFunc === "function") {
|
|
7606
|
+
return deleteFunc(props.model[props.name], index, mForm?.values);
|
|
7607
|
+
}
|
|
7608
|
+
return props.config.delete ?? true;
|
|
7609
|
+
};
|
|
7610
|
+
const copyable = (index) => {
|
|
7611
|
+
const copyableFunc = props.config.copyable;
|
|
7612
|
+
if (copyableFunc && typeof copyableFunc === "function") {
|
|
7613
|
+
return copyableFunc(mForm, {
|
|
7614
|
+
values: mForm?.initValues || {},
|
|
7615
|
+
model: props.model,
|
|
7616
|
+
parent: mForm?.parentValues || {},
|
|
7617
|
+
formValue: mForm?.values || props.model,
|
|
7618
|
+
prop: props.prop,
|
|
7619
|
+
config: props.config,
|
|
7620
|
+
index
|
|
7621
|
+
});
|
|
7622
|
+
}
|
|
7623
|
+
return props.config.copyable ?? true;
|
|
7792
7624
|
};
|
|
7793
7625
|
return (_ctx, _cache) => {
|
|
7794
|
-
return vue.openBlock(), vue.
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7626
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
7627
|
+
vue.Fragment,
|
|
7628
|
+
null,
|
|
7629
|
+
[
|
|
7630
|
+
vue.renderSlot(_ctx.$slots, "operateCol", {
|
|
7631
|
+
scope: { $index: __props.index, row: __props.row }
|
|
7632
|
+
}),
|
|
7633
|
+
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
7634
|
+
size: "small",
|
|
7635
|
+
type: "danger",
|
|
7636
|
+
link: "",
|
|
7637
|
+
title: "删除",
|
|
7638
|
+
icon: vue.unref(iconsVue.Delete),
|
|
7639
|
+
onClick: _cache[0] || (_cache[0] = ($event) => removeHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
7640
|
+
}, null, 8, ["icon"]), [
|
|
7641
|
+
[vue.vShow, showDelete(__props.index + 1 + __props.currentPage * __props.pageSize - 1)]
|
|
7642
|
+
]),
|
|
7643
|
+
copyable(__props.index + 1 + __props.currentPage * __props.pageSize - 1) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
7644
|
+
key: 0,
|
|
7645
|
+
link: "",
|
|
7646
|
+
size: "small",
|
|
7647
|
+
type: "primary",
|
|
7648
|
+
title: "复制",
|
|
7649
|
+
icon: vue.unref(iconsVue.DocumentCopy),
|
|
7650
|
+
disabled: __props.disabled,
|
|
7651
|
+
onClick: _cache[1] || (_cache[1] = ($event) => copyHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
7652
|
+
}, null, 8, ["icon", "disabled"])) : vue.createCommentVNode("v-if", true)
|
|
7653
|
+
],
|
|
7654
|
+
64
|
|
7655
|
+
/* STABLE_FRAGMENT */
|
|
7656
|
+
);
|
|
7805
7657
|
};
|
|
7806
7658
|
}
|
|
7807
7659
|
});
|
|
7808
7660
|
|
|
7809
7661
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
7810
|
-
|
|
7811
|
-
name: "MFormTime"
|
|
7812
|
-
},
|
|
7813
|
-
__name: "Time",
|
|
7662
|
+
__name: "SortColumn",
|
|
7814
7663
|
props: {
|
|
7815
|
-
|
|
7816
|
-
model: {},
|
|
7817
|
-
initValues: {},
|
|
7818
|
-
values: {},
|
|
7819
|
-
name: {},
|
|
7820
|
-
prop: {},
|
|
7664
|
+
index: {},
|
|
7821
7665
|
disabled: { type: Boolean },
|
|
7822
|
-
|
|
7823
|
-
|
|
7666
|
+
currentPage: {},
|
|
7667
|
+
pageSize: {},
|
|
7668
|
+
name: {},
|
|
7669
|
+
model: {}
|
|
7824
7670
|
},
|
|
7825
|
-
emits: ["
|
|
7671
|
+
emits: ["swap"],
|
|
7826
7672
|
setup(__props, { emit: __emit }) {
|
|
7827
7673
|
const props = __props;
|
|
7828
7674
|
const emit = __emit;
|
|
7829
|
-
|
|
7830
|
-
const
|
|
7831
|
-
|
|
7675
|
+
let timer = null;
|
|
7676
|
+
const upHandler = (index) => {
|
|
7677
|
+
if (timer) {
|
|
7678
|
+
clearTimeout(timer);
|
|
7679
|
+
}
|
|
7680
|
+
timer = setTimeout(() => {
|
|
7681
|
+
emit("swap", index, index - 1);
|
|
7682
|
+
timer = null;
|
|
7683
|
+
}, 300);
|
|
7684
|
+
};
|
|
7685
|
+
const topHandler = (index) => {
|
|
7686
|
+
if (timer) {
|
|
7687
|
+
clearTimeout(timer);
|
|
7688
|
+
}
|
|
7689
|
+
const moveNum = index;
|
|
7690
|
+
for (let i = 0; i < moveNum; i++) {
|
|
7691
|
+
emit("swap", index, index - 1);
|
|
7692
|
+
index -= 1;
|
|
7693
|
+
}
|
|
7694
|
+
};
|
|
7695
|
+
const downHandler = (index) => {
|
|
7696
|
+
if (timer) {
|
|
7697
|
+
clearTimeout(timer);
|
|
7698
|
+
}
|
|
7699
|
+
timer = setTimeout(() => {
|
|
7700
|
+
emit("swap", index, index + 1);
|
|
7701
|
+
timer = null;
|
|
7702
|
+
}, 300);
|
|
7703
|
+
};
|
|
7704
|
+
const bottomHandler = (index) => {
|
|
7705
|
+
if (timer) {
|
|
7706
|
+
clearTimeout(timer);
|
|
7707
|
+
}
|
|
7708
|
+
const moveNum = props.model[props.name].length - 1 - index;
|
|
7709
|
+
for (let i = 0; i < moveNum; i++) {
|
|
7710
|
+
emit("swap", index, index + 1);
|
|
7711
|
+
index += 1;
|
|
7712
|
+
}
|
|
7832
7713
|
};
|
|
7833
7714
|
return (_ctx, _cache) => {
|
|
7834
|
-
return vue.openBlock(), vue.
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7715
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
7716
|
+
vue.Fragment,
|
|
7717
|
+
null,
|
|
7718
|
+
[
|
|
7719
|
+
__props.index + 1 + __props.currentPage * __props.pageSize - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
7720
|
+
key: 0,
|
|
7721
|
+
content: "点击上移,双击置顶",
|
|
7722
|
+
placement: "top"
|
|
7723
|
+
}, {
|
|
7724
|
+
default: vue.withCtx(() => [
|
|
7725
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
7726
|
+
plain: "",
|
|
7727
|
+
size: "small",
|
|
7728
|
+
type: "primary",
|
|
7729
|
+
icon: vue.unref(iconsVue.ArrowUp),
|
|
7730
|
+
disabled: __props.disabled,
|
|
7731
|
+
link: "",
|
|
7732
|
+
onClick: _cache[0] || (_cache[0] = ($event) => upHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1)),
|
|
7733
|
+
onDblclick: _cache[1] || (_cache[1] = ($event) => topHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
7734
|
+
}, null, 8, ["icon", "disabled"])
|
|
7735
|
+
]),
|
|
7736
|
+
_: 1
|
|
7737
|
+
/* STABLE */
|
|
7738
|
+
})) : vue.createCommentVNode("v-if", true),
|
|
7739
|
+
__props.index + 1 + __props.currentPage * __props.pageSize - 1 !== __props.model[__props.name].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
7740
|
+
key: 1,
|
|
7741
|
+
content: "点击下移,双击置底",
|
|
7742
|
+
placement: "top"
|
|
7743
|
+
}, {
|
|
7744
|
+
default: vue.withCtx(() => [
|
|
7745
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
7746
|
+
plain: "",
|
|
7747
|
+
size: "small",
|
|
7748
|
+
type: "primary",
|
|
7749
|
+
icon: vue.unref(iconsVue.ArrowDown),
|
|
7750
|
+
disabled: __props.disabled,
|
|
7751
|
+
link: "",
|
|
7752
|
+
onClick: _cache[2] || (_cache[2] = ($event) => downHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1)),
|
|
7753
|
+
onDblclick: _cache[3] || (_cache[3] = ($event) => bottomHandler(__props.index + 1 + __props.currentPage * __props.pageSize - 1))
|
|
7754
|
+
}, null, 8, ["icon", "disabled"])
|
|
7755
|
+
]),
|
|
7756
|
+
_: 1
|
|
7757
|
+
/* STABLE */
|
|
7758
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
7759
|
+
],
|
|
7760
|
+
64
|
|
7761
|
+
/* STABLE_FRAGMENT */
|
|
7762
|
+
);
|
|
7844
7763
|
};
|
|
7845
7764
|
}
|
|
7846
7765
|
});
|
|
7847
7766
|
|
|
7767
|
+
const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
7768
|
+
const mForm = vue.inject("mForm");
|
|
7769
|
+
const display$1 = (fuc) => display(mForm, fuc, props);
|
|
7770
|
+
const lastData = vue.computed(
|
|
7771
|
+
() => props.config.pagination ? getDataByPage(props.lastValues[modelName.value], currentPage.value, pageSize.value) : props.lastValues[modelName.value] || []
|
|
7772
|
+
);
|
|
7773
|
+
const itemExtra = (fuc, index) => {
|
|
7774
|
+
if (typeof fuc === "function") {
|
|
7775
|
+
return fuc(mForm, {
|
|
7776
|
+
values: mForm?.initValues,
|
|
7777
|
+
model: props.model,
|
|
7778
|
+
formValue: mForm ? mForm.values : props.model,
|
|
7779
|
+
prop: props.prop,
|
|
7780
|
+
index
|
|
7781
|
+
});
|
|
7782
|
+
}
|
|
7783
|
+
return fuc;
|
|
7784
|
+
};
|
|
7785
|
+
const selection = vue.computed(() => {
|
|
7786
|
+
if (typeof props.config.selection === "function") {
|
|
7787
|
+
return props.config.selection(mForm, { model: props.model[modelName.value] });
|
|
7788
|
+
}
|
|
7789
|
+
return props.config.selection;
|
|
7790
|
+
});
|
|
7791
|
+
const getProp = (index) => {
|
|
7792
|
+
return `${props.prop}${props.prop ? "." : ""}${index + 1 + currentPage.value * pageSize.value - 1}`;
|
|
7793
|
+
};
|
|
7794
|
+
const makeConfig = (config, row) => {
|
|
7795
|
+
const newConfig = cloneDeep(config);
|
|
7796
|
+
if (typeof config.itemsFunction === "function") {
|
|
7797
|
+
newConfig.items = config.itemsFunction(row);
|
|
7798
|
+
}
|
|
7799
|
+
delete newConfig.display;
|
|
7800
|
+
return newConfig;
|
|
7801
|
+
};
|
|
7802
|
+
const changeHandler = (v, eventData) => {
|
|
7803
|
+
emit("change", props.model, eventData);
|
|
7804
|
+
};
|
|
7805
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
7806
|
+
const columns = vue.computed(() => {
|
|
7807
|
+
const columns2 = [];
|
|
7808
|
+
if (props.config.itemExtra && !props.config.dropSort) {
|
|
7809
|
+
columns2.push({
|
|
7810
|
+
props: {
|
|
7811
|
+
fixed: "left",
|
|
7812
|
+
width: 30,
|
|
7813
|
+
type: "expand"
|
|
7814
|
+
},
|
|
7815
|
+
cell: ({ $index }) => vue.h("span", {
|
|
7816
|
+
innerHTML: itemExtra(props.config.itemExtra, $index),
|
|
7817
|
+
class: "m-form-tip"
|
|
7818
|
+
})
|
|
7819
|
+
});
|
|
7820
|
+
}
|
|
7821
|
+
columns2.push({
|
|
7822
|
+
props: {
|
|
7823
|
+
label: "操作",
|
|
7824
|
+
fixed: props.config.fixed === false ? void 0 : "left",
|
|
7825
|
+
width: props.config.operateColWidth || 112,
|
|
7826
|
+
align: "center"
|
|
7827
|
+
},
|
|
7828
|
+
cell: ({ row, $index }) => vue.h(_sfc_main$4, {
|
|
7829
|
+
row,
|
|
7830
|
+
index: $index,
|
|
7831
|
+
model: props.model,
|
|
7832
|
+
config: props.config,
|
|
7833
|
+
prop: props.prop,
|
|
7834
|
+
disabled: props.disabled,
|
|
7835
|
+
sortKey: props.sortKey,
|
|
7836
|
+
name: modelName.value,
|
|
7837
|
+
currentPage: currentPage.value,
|
|
7838
|
+
pageSize: pageSize.value,
|
|
7839
|
+
onChange: (v) => {
|
|
7840
|
+
emit("change", v);
|
|
7841
|
+
}
|
|
7842
|
+
})
|
|
7843
|
+
});
|
|
7844
|
+
if (props.sort && props.model[modelName.value] && props.model[modelName.value].length > 1) {
|
|
7845
|
+
columns2.push({
|
|
7846
|
+
props: {
|
|
7847
|
+
label: "排序",
|
|
7848
|
+
width: 80
|
|
7849
|
+
},
|
|
7850
|
+
cell: ({ $index }) => vue.h(_sfc_main$3, {
|
|
7851
|
+
index: $index,
|
|
7852
|
+
model: props.model,
|
|
7853
|
+
disabled: props.disabled,
|
|
7854
|
+
name: modelName.value,
|
|
7855
|
+
currentPage: currentPage.value,
|
|
7856
|
+
pageSize: pageSize.value,
|
|
7857
|
+
onSwap: (index1, index2) => {
|
|
7858
|
+
const newData = sortArray(props.model[modelName.value], index1, index2, props.sortKey);
|
|
7859
|
+
emit("change", newData);
|
|
7860
|
+
mForm?.$emit("field-change", newData);
|
|
7861
|
+
}
|
|
7862
|
+
})
|
|
7863
|
+
});
|
|
7864
|
+
}
|
|
7865
|
+
if (selection.value) {
|
|
7866
|
+
columns2.push({
|
|
7867
|
+
props: {
|
|
7868
|
+
align: "center",
|
|
7869
|
+
headerAlign: "center",
|
|
7870
|
+
type: "selection",
|
|
7871
|
+
width: 45
|
|
7872
|
+
}
|
|
7873
|
+
});
|
|
7874
|
+
}
|
|
7875
|
+
if (props.showIndex && props.config.showIndex) {
|
|
7876
|
+
columns2.push({
|
|
7877
|
+
props: {
|
|
7878
|
+
label: "序号",
|
|
7879
|
+
width: 60
|
|
7880
|
+
},
|
|
7881
|
+
cell: ({ $index }) => vue.h("span", $index + 1 + currentPage.value * pageSize.value)
|
|
7882
|
+
});
|
|
7883
|
+
}
|
|
7884
|
+
for (const column of props.config.items) {
|
|
7885
|
+
if (column.type !== "hidden" && display$1(column.display)) {
|
|
7886
|
+
columns2.push({
|
|
7887
|
+
props: {
|
|
7888
|
+
prop: column.name,
|
|
7889
|
+
label: column.label,
|
|
7890
|
+
width: column.width,
|
|
7891
|
+
sortable: column.sortable,
|
|
7892
|
+
sortOrders: ["ascending", "descending"],
|
|
7893
|
+
class: props.config.dropSort === true ? "el-table__column--dropable" : ""
|
|
7894
|
+
},
|
|
7895
|
+
cell: ({ row, $index }) => vue.h(_sfc_main$A, {
|
|
7896
|
+
labelWidth: "0",
|
|
7897
|
+
disabled: props.disabled,
|
|
7898
|
+
prop: getProp($index),
|
|
7899
|
+
rules: column.rules,
|
|
7900
|
+
config: makeConfig(column, row),
|
|
7901
|
+
model: row,
|
|
7902
|
+
lastValues: lastData.value[$index],
|
|
7903
|
+
isCompare: props.isCompare,
|
|
7904
|
+
size: props.size,
|
|
7905
|
+
onChange: changeHandler,
|
|
7906
|
+
onAddDiffCount
|
|
7907
|
+
})
|
|
7908
|
+
});
|
|
7909
|
+
}
|
|
7910
|
+
}
|
|
7911
|
+
return columns2;
|
|
7912
|
+
});
|
|
7913
|
+
return {
|
|
7914
|
+
columns
|
|
7915
|
+
};
|
|
7916
|
+
};
|
|
7917
|
+
|
|
7918
|
+
const _hoisted_1$1 = { class: "m-fields-table-wrap" };
|
|
7919
|
+
const _hoisted_2 = ["innerHTML"];
|
|
7920
|
+
const _hoisted_3 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
|
|
7921
|
+
const _hoisted_4 = { style: { "display": "flex" } };
|
|
7922
|
+
const _hoisted_5 = {
|
|
7923
|
+
key: 1,
|
|
7924
|
+
class: "bottom",
|
|
7925
|
+
style: { "text-align": "right" }
|
|
7926
|
+
};
|
|
7848
7927
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
7849
7928
|
...{
|
|
7850
|
-
name: "
|
|
7929
|
+
name: "MFormTable"
|
|
7851
7930
|
},
|
|
7852
|
-
__name: "
|
|
7931
|
+
__name: "Table",
|
|
7853
7932
|
props: {
|
|
7854
|
-
config: {},
|
|
7855
7933
|
model: {},
|
|
7856
|
-
|
|
7857
|
-
|
|
7934
|
+
lastValues: { default: () => ({}) },
|
|
7935
|
+
isCompare: { type: Boolean, default: false },
|
|
7936
|
+
config: {},
|
|
7858
7937
|
name: {},
|
|
7859
|
-
prop: {},
|
|
7938
|
+
prop: { default: "" },
|
|
7939
|
+
labelWidth: {},
|
|
7940
|
+
sort: { type: Boolean },
|
|
7860
7941
|
disabled: { type: Boolean },
|
|
7942
|
+
sortKey: { default: "" },
|
|
7943
|
+
text: {},
|
|
7861
7944
|
size: {},
|
|
7862
|
-
|
|
7945
|
+
enableToggleMode: { type: Boolean, default: true },
|
|
7946
|
+
showIndex: { type: Boolean, default: true }
|
|
7863
7947
|
},
|
|
7864
|
-
emits: ["change"],
|
|
7865
|
-
setup(__props, { emit: __emit }) {
|
|
7948
|
+
emits: ["change", "select", "addDiffCount"],
|
|
7949
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7866
7950
|
const props = __props;
|
|
7867
7951
|
const emit = __emit;
|
|
7868
|
-
|
|
7869
|
-
const
|
|
7870
|
-
const
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7952
|
+
const modelName = vue.computed(() => props.name || props.config.name || "");
|
|
7953
|
+
const tMagicTableRef = vue.useTemplateRef("tMagicTable");
|
|
7954
|
+
const { pageSize, currentPage, paginationData, handleSizeChange, handleCurrentChange } = usePagination(
|
|
7955
|
+
props,
|
|
7956
|
+
modelName
|
|
7957
|
+
);
|
|
7958
|
+
const { addable, newHandler } = useAdd(props, emit);
|
|
7959
|
+
const { columns } = useTableColumns(props, emit, currentPage, pageSize, modelName);
|
|
7960
|
+
useSortable(props, emit, tMagicTableRef, modelName);
|
|
7961
|
+
const { isFullscreen, toggleFullscreen } = useFullscreen();
|
|
7962
|
+
const { importable, excelHandler, clearHandler } = useImport(props, emit, newHandler);
|
|
7963
|
+
const { selectHandle, toggleRowSelection } = useSelection(props, emit, tMagicTableRef);
|
|
7964
|
+
const updateKey = vue.ref(1);
|
|
7965
|
+
const data = vue.computed(() => props.config.pagination ? paginationData.value : props.model[modelName.value]);
|
|
7966
|
+
const toggleMode = () => {
|
|
7967
|
+
const calcLabelWidth = (label) => {
|
|
7968
|
+
if (!label) return "0px";
|
|
7969
|
+
const zhLength = label.match(/[^\x00-\xff]/g)?.length || 0;
|
|
7970
|
+
const chLength = label.length - zhLength;
|
|
7971
|
+
return `${Math.max(chLength * 8 + zhLength * 20, 80)}px`;
|
|
7972
|
+
};
|
|
7973
|
+
props.config.type = "groupList";
|
|
7974
|
+
props.config.enableToggleMode = true;
|
|
7975
|
+
props.config.tableItems = props.config.items;
|
|
7976
|
+
props.config.items = props.config.groupItems || props.config.items.map((item) => {
|
|
7977
|
+
const text = item.text || item.label;
|
|
7978
|
+
const labelWidth = calcLabelWidth(text);
|
|
7979
|
+
return {
|
|
7980
|
+
...item,
|
|
7981
|
+
text,
|
|
7982
|
+
labelWidth,
|
|
7983
|
+
span: item.span || 12
|
|
7984
|
+
};
|
|
7897
7985
|
});
|
|
7898
7986
|
};
|
|
7899
|
-
const
|
|
7900
|
-
const
|
|
7901
|
-
|
|
7902
|
-
setValue(value2);
|
|
7903
|
-
}
|
|
7904
|
-
emit("change", value2);
|
|
7987
|
+
const sortChangeHandler = (sortOptions) => {
|
|
7988
|
+
const modelName2 = props.name || props.config.name || "";
|
|
7989
|
+
sortChange(props.model[modelName2], sortOptions);
|
|
7905
7990
|
};
|
|
7991
|
+
__expose({
|
|
7992
|
+
toggleRowSelection
|
|
7993
|
+
});
|
|
7906
7994
|
return (_ctx, _cache) => {
|
|
7907
|
-
return vue.openBlock(), vue.
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7995
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
|
|
7996
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
7997
|
+
to: "body",
|
|
7998
|
+
disabled: !vue.unref(isFullscreen)
|
|
7999
|
+
}, [
|
|
8000
|
+
vue.createElementVNode(
|
|
8001
|
+
"div",
|
|
8002
|
+
{
|
|
8003
|
+
ref: "mTable",
|
|
8004
|
+
class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": __props.config.itemExtra }])
|
|
8005
|
+
},
|
|
8006
|
+
[
|
|
8007
|
+
__props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
8008
|
+
key: 0,
|
|
8009
|
+
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
8010
|
+
innerHTML: __props.config.extra
|
|
8011
|
+
}, null, 8, _hoisted_2)) : vue.createCommentVNode("v-if", true),
|
|
8012
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
8013
|
+
content: "拖拽可排序",
|
|
8014
|
+
placement: "left-start",
|
|
8015
|
+
disabled: __props.config.dropSort !== true
|
|
8016
|
+
}, {
|
|
8017
|
+
default: vue.withCtx(() => [
|
|
8018
|
+
__props.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
|
|
8019
|
+
ref: "tMagicTable",
|
|
8020
|
+
style: { "width": "100%" },
|
|
8021
|
+
"show-header": "",
|
|
8022
|
+
"row-key": __props.config.rowKey || "id",
|
|
8023
|
+
columns: vue.unref(columns),
|
|
8024
|
+
data: data.value,
|
|
8025
|
+
border: __props.config.border,
|
|
8026
|
+
"max-height": __props.config.maxHeight,
|
|
8027
|
+
"default-expand-all": true,
|
|
8028
|
+
key: updateKey.value,
|
|
8029
|
+
onSelect: vue.unref(selectHandle),
|
|
8030
|
+
onSortChange: sortChangeHandler
|
|
8031
|
+
}, null, 8, ["row-key", "columns", "data", "border", "max-height", "onSelect"])) : vue.createCommentVNode("v-if", true)
|
|
8032
|
+
]),
|
|
8033
|
+
_: 1
|
|
8034
|
+
/* STABLE */
|
|
8035
|
+
}, 8, ["disabled"]),
|
|
8036
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
8037
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
8038
|
+
vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
8039
|
+
key: 0,
|
|
8040
|
+
size: "small",
|
|
8041
|
+
type: "primary",
|
|
8042
|
+
disabled: __props.disabled,
|
|
8043
|
+
plain: "",
|
|
8044
|
+
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(newHandler)())
|
|
8045
|
+
}, {
|
|
8046
|
+
default: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
8047
|
+
vue.createTextVNode(
|
|
8048
|
+
"新增一行",
|
|
8049
|
+
-1
|
|
8050
|
+
/* CACHED */
|
|
8051
|
+
)
|
|
8052
|
+
])]),
|
|
8053
|
+
_: 1
|
|
8054
|
+
/* STABLE */
|
|
8055
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("v-if", true),
|
|
8056
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
8057
|
+
__props.enableToggleMode && __props.config.enableToggleMode !== false && !vue.unref(isFullscreen) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
8058
|
+
key: 0,
|
|
8059
|
+
icon: vue.unref(iconsVue.Grid),
|
|
8060
|
+
size: "small",
|
|
8061
|
+
type: "primary",
|
|
8062
|
+
onClick: toggleMode
|
|
8063
|
+
}, {
|
|
8064
|
+
default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
8065
|
+
vue.createTextVNode(
|
|
8066
|
+
"展开配置",
|
|
8067
|
+
-1
|
|
8068
|
+
/* CACHED */
|
|
8069
|
+
)
|
|
8070
|
+
])]),
|
|
8071
|
+
_: 1
|
|
8072
|
+
/* STABLE */
|
|
8073
|
+
}, 8, ["icon"])) : vue.createCommentVNode("v-if", true),
|
|
8074
|
+
__props.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
8075
|
+
key: 1,
|
|
8076
|
+
icon: vue.unref(iconsVue.FullScreen),
|
|
8077
|
+
size: "small",
|
|
8078
|
+
type: "primary",
|
|
8079
|
+
onClick: vue.unref(toggleFullscreen)
|
|
8080
|
+
}, {
|
|
8081
|
+
default: vue.withCtx(() => [
|
|
8082
|
+
vue.createTextVNode(
|
|
8083
|
+
vue.toDisplayString(vue.unref(isFullscreen) ? "退出全屏" : "全屏编辑"),
|
|
8084
|
+
1
|
|
8085
|
+
/* TEXT */
|
|
8086
|
+
)
|
|
8087
|
+
]),
|
|
8088
|
+
_: 1
|
|
8089
|
+
/* STABLE */
|
|
8090
|
+
}, 8, ["icon", "onClick"])) : vue.createCommentVNode("v-if", true),
|
|
8091
|
+
vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
|
|
8092
|
+
key: 2,
|
|
8093
|
+
style: { "display": "inline-block" },
|
|
8094
|
+
ref: "excelBtn",
|
|
8095
|
+
action: "/noop",
|
|
8096
|
+
disabled: __props.disabled,
|
|
8097
|
+
"on-change": vue.unref(excelHandler),
|
|
8098
|
+
"auto-upload": false
|
|
8099
|
+
}, {
|
|
8100
|
+
default: vue.withCtx(() => [
|
|
8101
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
8102
|
+
size: "small",
|
|
8103
|
+
type: "success",
|
|
8104
|
+
disabled: __props.disabled,
|
|
8105
|
+
plain: ""
|
|
8106
|
+
}, {
|
|
8107
|
+
default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
8108
|
+
vue.createTextVNode(
|
|
8109
|
+
"导入EXCEL",
|
|
8110
|
+
-1
|
|
8111
|
+
/* CACHED */
|
|
8112
|
+
)
|
|
8113
|
+
])]),
|
|
8114
|
+
_: 1
|
|
8115
|
+
/* STABLE */
|
|
8116
|
+
}, 8, ["disabled"])
|
|
8117
|
+
]),
|
|
8118
|
+
_: 1
|
|
8119
|
+
/* STABLE */
|
|
8120
|
+
}, 8, ["disabled", "on-change"])) : vue.createCommentVNode("v-if", true),
|
|
8121
|
+
vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
8122
|
+
key: 3,
|
|
8123
|
+
size: "small",
|
|
8124
|
+
type: "warning",
|
|
8125
|
+
disabled: __props.disabled,
|
|
8126
|
+
plain: "",
|
|
8127
|
+
onClick: vue.unref(clearHandler)
|
|
8128
|
+
}, {
|
|
8129
|
+
default: vue.withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
8130
|
+
vue.createTextVNode(
|
|
8131
|
+
"清空",
|
|
8132
|
+
-1
|
|
8133
|
+
/* CACHED */
|
|
8134
|
+
)
|
|
8135
|
+
])]),
|
|
8136
|
+
_: 1
|
|
8137
|
+
/* STABLE */
|
|
8138
|
+
}, 8, ["disabled", "onClick"])) : vue.createCommentVNode("v-if", true)
|
|
8139
|
+
])
|
|
8140
|
+
]),
|
|
8141
|
+
__props.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
8142
|
+
vue.createVNode(vue.unref(design.TMagicPagination), {
|
|
8143
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
8144
|
+
"hide-on-single-page": __props.model[modelName.value].length < vue.unref(pageSize),
|
|
8145
|
+
"current-page": vue.unref(currentPage) + 1,
|
|
8146
|
+
"page-sizes": [vue.unref(pageSize), 60, 120, 300],
|
|
8147
|
+
"page-size": vue.unref(pageSize),
|
|
8148
|
+
total: __props.model[modelName.value].length,
|
|
8149
|
+
onSizeChange: vue.unref(handleSizeChange),
|
|
8150
|
+
onCurrentChange: vue.unref(handleCurrentChange)
|
|
8151
|
+
}, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total", "onSizeChange", "onCurrentChange"])
|
|
8152
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
8153
|
+
],
|
|
8154
|
+
2
|
|
8155
|
+
/* CLASS */
|
|
8156
|
+
)
|
|
8157
|
+
], 8, ["disabled"]))
|
|
8158
|
+
]);
|
|
7920
8159
|
};
|
|
7921
8160
|
}
|
|
7922
8161
|
});
|
|
@@ -8083,7 +8322,7 @@
|
|
|
8083
8322
|
class: "m-drawer-body"
|
|
8084
8323
|
},
|
|
8085
8324
|
[
|
|
8086
|
-
vue.createVNode(_sfc_main$
|
|
8325
|
+
vue.createVNode(_sfc_main$g, {
|
|
8087
8326
|
ref_key: "form",
|
|
8088
8327
|
ref: form,
|
|
8089
8328
|
size: __props.size,
|
|
@@ -8191,7 +8430,7 @@
|
|
|
8191
8430
|
[
|
|
8192
8431
|
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
8193
8432
|
default: vue.withCtx(() => [
|
|
8194
|
-
vue.createVNode(_sfc_main$
|
|
8433
|
+
vue.createVNode(_sfc_main$g, {
|
|
8195
8434
|
ref_key: "form",
|
|
8196
8435
|
ref: form,
|
|
8197
8436
|
size: __props.size,
|
|
@@ -8264,79 +8503,84 @@
|
|
|
8264
8503
|
const option = Object.assign(defaultInstallOpt, opt);
|
|
8265
8504
|
app.config.globalProperties.$MAGIC_FORM = option;
|
|
8266
8505
|
setConfig(option);
|
|
8267
|
-
app.component("m-form", _sfc_main$
|
|
8268
|
-
app.component("m-form-dialog", _sfc_main$
|
|
8269
|
-
app.component("m-form-container", _sfc_main$
|
|
8270
|
-
app.component("m-form-fieldset", _sfc_main$
|
|
8271
|
-
app.component("m-form-group-list", _sfc_main$
|
|
8272
|
-
app.component("m-form-panel", _sfc_main$
|
|
8273
|
-
app.component("m-form-row", _sfc_main$
|
|
8274
|
-
app.component("m-form-step", _sfc_main$
|
|
8275
|
-
app.component("m-form-table", _sfc_main$
|
|
8276
|
-
app.component("m-form-tab", _sfc_main$
|
|
8277
|
-
app.component("m-
|
|
8278
|
-
app.component("m-fields-
|
|
8279
|
-
app.component("m-fields-
|
|
8280
|
-
app.component("m-fields-number
|
|
8281
|
-
app.component("m-fields-
|
|
8282
|
-
app.component("m-fields-
|
|
8283
|
-
app.component("m-fields-
|
|
8284
|
-
app.component("m-fields-
|
|
8285
|
-
app.component("m-fields-
|
|
8286
|
-
app.component("m-fields-
|
|
8287
|
-
app.component("m-fields-
|
|
8288
|
-
app.component("m-fields-
|
|
8289
|
-
app.component("m-fields-
|
|
8290
|
-
app.component("m-fields-
|
|
8291
|
-
app.component("m-fields-
|
|
8292
|
-
app.component("m-fields-
|
|
8293
|
-
app.component("m-fields-
|
|
8294
|
-
app.component("m-fields-
|
|
8295
|
-
app.component("m-fields-
|
|
8296
|
-
app.component("m-fields-
|
|
8297
|
-
app.component("m-fields-
|
|
8506
|
+
app.component("m-form", _sfc_main$g);
|
|
8507
|
+
app.component("m-form-dialog", _sfc_main$f);
|
|
8508
|
+
app.component("m-form-container", _sfc_main$A);
|
|
8509
|
+
app.component("m-form-fieldset", _sfc_main$z);
|
|
8510
|
+
app.component("m-form-group-list", _sfc_main$w);
|
|
8511
|
+
app.component("m-form-panel", _sfc_main$v);
|
|
8512
|
+
app.component("m-form-row", _sfc_main$t);
|
|
8513
|
+
app.component("m-form-step", _sfc_main$s);
|
|
8514
|
+
app.component("m-form-table", _sfc_main$2);
|
|
8515
|
+
app.component("m-form-tab", _sfc_main$r);
|
|
8516
|
+
app.component("m-form-flex-layout", _sfc_main$y);
|
|
8517
|
+
app.component("m-fields-text", _sfc_main$8);
|
|
8518
|
+
app.component("m-fields-img-upload", _sfc_main$8);
|
|
8519
|
+
app.component("m-fields-number", _sfc_main$d);
|
|
8520
|
+
app.component("m-fields-number-range", _sfc_main$c);
|
|
8521
|
+
app.component("m-fields-textarea", _sfc_main$7);
|
|
8522
|
+
app.component("m-fields-hidden", _sfc_main$h);
|
|
8523
|
+
app.component("m-fields-date", _sfc_main$m);
|
|
8524
|
+
app.component("m-fields-datetime", _sfc_main$k);
|
|
8525
|
+
app.component("m-fields-daterange", _sfc_main$l);
|
|
8526
|
+
app.component("m-fields-timerange", _sfc_main$5);
|
|
8527
|
+
app.component("m-fields-time", _sfc_main$6);
|
|
8528
|
+
app.component("m-fields-checkbox", _sfc_main$p);
|
|
8529
|
+
app.component("m-fields-switch", _sfc_main$9);
|
|
8530
|
+
app.component("m-fields-color-picker", _sfc_main$n);
|
|
8531
|
+
app.component("m-fields-checkbox-group", _sfc_main$o);
|
|
8532
|
+
app.component("m-fields-radio-group", _sfc_main$b);
|
|
8533
|
+
app.component("m-fields-display", _sfc_main$j);
|
|
8534
|
+
app.component("m-fields-link", _sfc_main$e);
|
|
8535
|
+
app.component("m-fields-select", _sfc_main$a);
|
|
8536
|
+
app.component("m-fields-cascader", _sfc_main$q);
|
|
8537
|
+
app.component("m-fields-dynamic-field", _sfc_main$i);
|
|
8298
8538
|
}
|
|
8299
8539
|
};
|
|
8300
8540
|
|
|
8301
|
-
exports.MCascader = _sfc_main$
|
|
8302
|
-
exports.MCheckbox = _sfc_main$
|
|
8303
|
-
exports.MCheckboxGroup = _sfc_main$
|
|
8304
|
-
exports.MColorPicker = _sfc_main$
|
|
8305
|
-
exports.MContainer = _sfc_main$
|
|
8306
|
-
exports.MDate = _sfc_main$
|
|
8307
|
-
exports.MDateTime = _sfc_main$
|
|
8308
|
-
exports.MDaterange = _sfc_main$
|
|
8309
|
-
exports.MDisplay = _sfc_main$
|
|
8310
|
-
exports.MDynamicField = _sfc_main$
|
|
8311
|
-
exports.MFieldset = _sfc_main$
|
|
8312
|
-
exports.
|
|
8541
|
+
exports.MCascader = _sfc_main$q;
|
|
8542
|
+
exports.MCheckbox = _sfc_main$p;
|
|
8543
|
+
exports.MCheckboxGroup = _sfc_main$o;
|
|
8544
|
+
exports.MColorPicker = _sfc_main$n;
|
|
8545
|
+
exports.MContainer = _sfc_main$A;
|
|
8546
|
+
exports.MDate = _sfc_main$m;
|
|
8547
|
+
exports.MDateTime = _sfc_main$k;
|
|
8548
|
+
exports.MDaterange = _sfc_main$l;
|
|
8549
|
+
exports.MDisplay = _sfc_main$j;
|
|
8550
|
+
exports.MDynamicField = _sfc_main$i;
|
|
8551
|
+
exports.MFieldset = _sfc_main$z;
|
|
8552
|
+
exports.MFlexLayout = _sfc_main$y;
|
|
8553
|
+
exports.MForm = _sfc_main$g;
|
|
8313
8554
|
exports.MFormBox = _sfc_main;
|
|
8314
|
-
exports.MFormDialog = _sfc_main$
|
|
8555
|
+
exports.MFormDialog = _sfc_main$f;
|
|
8315
8556
|
exports.MFormDrawer = _sfc_main$1;
|
|
8316
|
-
exports.MGroupList = _sfc_main$
|
|
8317
|
-
exports.MHidden = _sfc_main$
|
|
8318
|
-
exports.MLink = _sfc_main$
|
|
8319
|
-
exports.MNumber = _sfc_main$
|
|
8320
|
-
exports.MNumberRange = _sfc_main$
|
|
8321
|
-
exports.MPanel = _sfc_main$
|
|
8322
|
-
exports.MRadioGroup = _sfc_main$
|
|
8323
|
-
exports.MRow = _sfc_main$
|
|
8324
|
-
exports.MSelect = _sfc_main$
|
|
8325
|
-
exports.MSwitch = _sfc_main$
|
|
8326
|
-
exports.MTable = _sfc_main$
|
|
8327
|
-
exports.MTabs = _sfc_main$
|
|
8328
|
-
exports.MText = _sfc_main$
|
|
8329
|
-
exports.MTextarea = _sfc_main$
|
|
8330
|
-
exports.MTime = _sfc_main$
|
|
8331
|
-
exports.MTimerange = _sfc_main$
|
|
8557
|
+
exports.MGroupList = _sfc_main$w;
|
|
8558
|
+
exports.MHidden = _sfc_main$h;
|
|
8559
|
+
exports.MLink = _sfc_main$e;
|
|
8560
|
+
exports.MNumber = _sfc_main$d;
|
|
8561
|
+
exports.MNumberRange = _sfc_main$c;
|
|
8562
|
+
exports.MPanel = _sfc_main$v;
|
|
8563
|
+
exports.MRadioGroup = _sfc_main$b;
|
|
8564
|
+
exports.MRow = _sfc_main$t;
|
|
8565
|
+
exports.MSelect = _sfc_main$a;
|
|
8566
|
+
exports.MSwitch = _sfc_main$9;
|
|
8567
|
+
exports.MTable = _sfc_main$2;
|
|
8568
|
+
exports.MTabs = _sfc_main$r;
|
|
8569
|
+
exports.MText = _sfc_main$8;
|
|
8570
|
+
exports.MTextarea = _sfc_main$7;
|
|
8571
|
+
exports.MTime = _sfc_main$6;
|
|
8572
|
+
exports.MTimerange = _sfc_main$5;
|
|
8332
8573
|
exports.createForm = createForm;
|
|
8333
8574
|
exports.createValues = createValues;
|
|
8334
8575
|
exports.datetimeFormatter = datetimeFormatter;
|
|
8335
8576
|
exports.default = index;
|
|
8336
8577
|
exports.display = display;
|
|
8337
8578
|
exports.filterFunction = filterFunction;
|
|
8579
|
+
exports.getDataByPage = getDataByPage;
|
|
8338
8580
|
exports.getRules = getRules;
|
|
8339
8581
|
exports.initValue = initValue;
|
|
8582
|
+
exports.sortArray = sortArray;
|
|
8583
|
+
exports.sortChange = sortChange;
|
|
8340
8584
|
exports.useAddField = useAddField;
|
|
8341
8585
|
Object.keys(formSchema).forEach(k => {
|
|
8342
8586
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|