@tmagic/editor 1.7.0-beta.2 → 1.7.0-beta.4
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 +20 -7
- package/dist/tmagic-editor.js +170 -135
- package/dist/tmagic-editor.umd.cjs +169 -134
- package/package.json +13 -14
- package/src/fields/CodeSelectCol.vue +29 -36
- package/src/fields/CondOpSelect.vue +1 -1
- package/src/fields/DataSourceInput.vue +23 -4
- package/src/fields/DataSourceMethodSelect.vue +38 -30
- package/src/fields/EventSelect.vue +0 -1
- package/src/fields/PageFragmentSelect.vue +11 -8
- package/src/fields/UISelect.vue +0 -2
- package/src/layouts/workspace/viewer/Stage.vue +1 -1
- package/types/index.d.ts +2 -2
package/dist/style.css
CHANGED
|
@@ -305,6 +305,17 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
305
305
|
.m-fields-group-list .m-fields-group-list-item:last-of-type {
|
|
306
306
|
border-bottom: 0;
|
|
307
307
|
}
|
|
308
|
+
.m-fields-group-list .tmagic-design-card .el-card__header {
|
|
309
|
+
padding: 5px 20px;
|
|
310
|
+
}
|
|
311
|
+
.m-fields-group-list .tmagic-design-card .t-card__header {
|
|
312
|
+
padding: 5px 0;
|
|
313
|
+
}
|
|
314
|
+
.m-fields-group-list .m-fields-group-list-footer {
|
|
315
|
+
display: flex;
|
|
316
|
+
justify-content: space-between;
|
|
317
|
+
margin-top: 10px;
|
|
318
|
+
}
|
|
308
319
|
|
|
309
320
|
.m-form-panel .el-card__header:hover {
|
|
310
321
|
background: #f2f6fc;
|
|
@@ -326,11 +337,7 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
326
337
|
.m-fields-table-wrap {
|
|
327
338
|
width: 100%;
|
|
328
339
|
}
|
|
329
|
-
|
|
330
|
-
.m-fields-table {
|
|
331
|
-
width: 100%;
|
|
332
|
-
}
|
|
333
|
-
.m-fields-table.fixed {
|
|
340
|
+
.m-fields-table-wrap.fixed {
|
|
334
341
|
position: fixed;
|
|
335
342
|
height: 100%;
|
|
336
343
|
overflow: auto;
|
|
@@ -340,16 +347,22 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
340
347
|
bottom: 0;
|
|
341
348
|
z-index: 100;
|
|
342
349
|
background: rgba(0, 0, 0, 0.5);
|
|
350
|
+
align-items: center;
|
|
351
|
+
display: flex;
|
|
343
352
|
}
|
|
344
|
-
.m-fields-table.fixed > .el-form-item__content {
|
|
353
|
+
.m-fields-table-wrap.fixed > .el-form-item__content {
|
|
345
354
|
z-index: 101;
|
|
346
355
|
position: relative;
|
|
347
356
|
margin: 10vh auto;
|
|
348
357
|
max-width: fit-content;
|
|
349
358
|
}
|
|
350
|
-
.m-fields-table.fixed table {
|
|
359
|
+
.m-fields-table-wrap.fixed table {
|
|
351
360
|
width: 95vw !important;
|
|
352
361
|
}
|
|
362
|
+
|
|
363
|
+
.m-fields-table {
|
|
364
|
+
width: 100%;
|
|
365
|
+
}
|
|
353
366
|
.m-fields-table th {
|
|
354
367
|
background-color: #f2f2f2 !important;
|
|
355
368
|
color: #333 !important;
|
package/dist/tmagic-editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import designPlugin__default, { TMagicIcon, TMagicButton, TMagicCard, tMagicMessage, getDesignConfig, TMagicSelect, useZIndex, tMagicMessageBox, TMagicCascader, TMagicTooltip, TMagicInput, TMagicTag, TMagicDialog, TMagicSwitch, TMagicCollapse, TMagicCollapseItem, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, TMagicPopover, TMagicScrollbar } from '@tmagic/design';
|
|
2
2
|
export * from '@tmagic/design';
|
|
3
3
|
export { default as designPlugin } from '@tmagic/design';
|
|
4
|
-
import formPlugin__default, { MContainer, defineFormConfig, MForm, filterFunction, createValues, MFormBox,
|
|
4
|
+
import formPlugin__default, { MContainer, defineFormConfig, MForm, filterFunction, MSelect, createValues, MFormBox, MCascader, MGroupList, MPanel, createForm } from '@tmagic/form';
|
|
5
5
|
export * from '@tmagic/form';
|
|
6
6
|
export { default as formPlugin } from '@tmagic/form';
|
|
7
7
|
import tablePlugin__default, { MagicTable } from '@tmagic/table';
|
|
@@ -343,7 +343,8 @@ const _sfc_main$1p = /* @__PURE__ */ defineComponent({
|
|
|
343
343
|
prop: {},
|
|
344
344
|
disabled: { type: Boolean, default: false },
|
|
345
345
|
size: {},
|
|
346
|
-
lastValues: {}
|
|
346
|
+
lastValues: {},
|
|
347
|
+
isCompare: { type: Boolean }
|
|
347
348
|
},
|
|
348
349
|
emits: ["change"],
|
|
349
350
|
setup(__props, { emit: __emit }) {
|
|
@@ -381,7 +382,8 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
|
381
382
|
prop: {},
|
|
382
383
|
disabled: { type: Boolean },
|
|
383
384
|
size: {},
|
|
384
|
-
lastValues: {}
|
|
385
|
+
lastValues: {},
|
|
386
|
+
isCompare: { type: Boolean }
|
|
385
387
|
},
|
|
386
388
|
emits: ["change"],
|
|
387
389
|
setup(__props, { emit: __emit }) {
|
|
@@ -468,7 +470,8 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
|
468
470
|
prop: {},
|
|
469
471
|
disabled: { type: Boolean },
|
|
470
472
|
size: {},
|
|
471
|
-
lastValues: {}
|
|
473
|
+
lastValues: {},
|
|
474
|
+
isCompare: { type: Boolean }
|
|
472
475
|
},
|
|
473
476
|
emits: ["change"],
|
|
474
477
|
setup(__props, { emit: __emit }) {
|
|
@@ -3278,7 +3281,8 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
3278
3281
|
prop: {},
|
|
3279
3282
|
disabled: { type: Boolean, default: false },
|
|
3280
3283
|
size: {},
|
|
3281
|
-
lastValues: {}
|
|
3284
|
+
lastValues: {},
|
|
3285
|
+
isCompare: { type: Boolean }
|
|
3282
3286
|
},
|
|
3283
3287
|
emits: ["change"],
|
|
3284
3288
|
setup(__props, { emit: __emit }) {
|
|
@@ -3324,40 +3328,29 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
3324
3328
|
}));
|
|
3325
3329
|
}
|
|
3326
3330
|
return [];
|
|
3327
|
-
},
|
|
3328
|
-
onChange: (formState, codeId, { setModel, model }) => {
|
|
3329
|
-
paramsConfig.value = getParamItemsConfig(codeId);
|
|
3330
|
-
if (paramsConfig.value.length) {
|
|
3331
|
-
setModel("params", createValues(formState, paramsConfig.value, {}, model.params));
|
|
3332
|
-
} else {
|
|
3333
|
-
setModel("params", {});
|
|
3334
|
-
}
|
|
3335
|
-
return codeId;
|
|
3336
3331
|
}
|
|
3337
3332
|
};
|
|
3338
|
-
const onCodeIdChangeHandler = (value
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
value
|
|
3344
|
-
}
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3333
|
+
const onCodeIdChangeHandler = (value) => {
|
|
3334
|
+
paramsConfig.value = getParamItemsConfig(value);
|
|
3335
|
+
const changeRecords = [
|
|
3336
|
+
{
|
|
3337
|
+
propPath: props.prop,
|
|
3338
|
+
value
|
|
3339
|
+
}
|
|
3340
|
+
];
|
|
3341
|
+
changeRecords.push({
|
|
3342
|
+
propPath: props.prop.replace(`${props.name}`, "params"),
|
|
3343
|
+
value: paramsConfig.value.length ? createValues(mForm, paramsConfig.value, {}, props.model.params) : {}
|
|
3344
|
+
});
|
|
3345
|
+
emit("change", value, {
|
|
3346
|
+
changeRecords
|
|
3350
3347
|
});
|
|
3351
3348
|
};
|
|
3352
3349
|
const onParamsChangeHandler = (value, eventData) => {
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
...eventData,
|
|
3356
|
-
changeRecords: (eventData.changeRecords || []).map((item) => ({
|
|
3357
|
-
prop: `${props.prop.replace(props.name, "")}${item.propPath}`,
|
|
3358
|
-
value: item.value
|
|
3359
|
-
}))
|
|
3350
|
+
eventData.changeRecords?.forEach((record) => {
|
|
3351
|
+
record.propPath = `${props.prop.replace(`${props.name}`, "")}${record.propPath}`;
|
|
3360
3352
|
});
|
|
3353
|
+
emit("change", props.model[props.name], eventData);
|
|
3361
3354
|
};
|
|
3362
3355
|
const editCode = (id) => {
|
|
3363
3356
|
eventBus?.emit("edit-code", id);
|
|
@@ -3366,13 +3359,15 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
3366
3359
|
return openBlock(), createElementBlock("div", _hoisted_1$Z, [
|
|
3367
3360
|
createElementVNode("div", _hoisted_2$n, [
|
|
3368
3361
|
createCommentVNode(" 代码块下拉框 "),
|
|
3369
|
-
createVNode(unref(
|
|
3362
|
+
createVNode(unref(MSelect), {
|
|
3370
3363
|
class: "select",
|
|
3371
3364
|
config: selectConfig,
|
|
3365
|
+
name: __props.name,
|
|
3372
3366
|
model: __props.model,
|
|
3373
3367
|
size: __props.size,
|
|
3368
|
+
prop: __props.prop,
|
|
3374
3369
|
onChange: onCodeIdChangeHandler
|
|
3375
|
-
}, null, 8, ["model", "size"]),
|
|
3370
|
+
}, null, 8, ["name", "model", "size", "prop"]),
|
|
3376
3371
|
createCommentVNode(" 查看/编辑按钮 "),
|
|
3377
3372
|
__props.model[__props.name] && hasCodeBlockSidePanel.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
3378
3373
|
key: 0,
|
|
@@ -3395,9 +3390,10 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
3395
3390
|
key: __props.model[__props.name],
|
|
3396
3391
|
model: __props.model,
|
|
3397
3392
|
size: __props.size,
|
|
3393
|
+
disabled: __props.disabled,
|
|
3398
3394
|
"params-config": paramsConfig.value,
|
|
3399
3395
|
onChange: onParamsChangeHandler
|
|
3400
|
-
}, null, 8, ["model", "size", "params-config"])) : createCommentVNode("v-if", true)
|
|
3396
|
+
}, null, 8, ["model", "size", "disabled", "params-config"])) : createCommentVNode("v-if", true)
|
|
3401
3397
|
]);
|
|
3402
3398
|
};
|
|
3403
3399
|
}
|
|
@@ -3417,7 +3413,8 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3417
3413
|
prop: {},
|
|
3418
3414
|
disabled: { type: Boolean },
|
|
3419
3415
|
size: {},
|
|
3420
|
-
lastValues: {}
|
|
3416
|
+
lastValues: {},
|
|
3417
|
+
isCompare: { type: Boolean }
|
|
3421
3418
|
},
|
|
3422
3419
|
emits: ["change"],
|
|
3423
3420
|
setup(__props, { emit: __emit }) {
|
|
@@ -3457,8 +3454,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3457
3454
|
};
|
|
3458
3455
|
return (_ctx, _cache) => {
|
|
3459
3456
|
return openBlock(), createBlock(unref(TMagicSelect), {
|
|
3460
|
-
|
|
3461
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
3457
|
+
"model-value": __props.model[__props.name],
|
|
3462
3458
|
clearable: "",
|
|
3463
3459
|
filterable: "",
|
|
3464
3460
|
size: __props.size,
|
|
@@ -3497,7 +3493,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3497
3493
|
]),
|
|
3498
3494
|
_: 1
|
|
3499
3495
|
/* STABLE */
|
|
3500
|
-
}, 8, ["
|
|
3496
|
+
}, 8, ["model-value", "size", "disabled"]);
|
|
3501
3497
|
};
|
|
3502
3498
|
}
|
|
3503
3499
|
});
|
|
@@ -4215,7 +4211,8 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
4215
4211
|
prop: {},
|
|
4216
4212
|
disabled: { type: Boolean, default: false },
|
|
4217
4213
|
size: {},
|
|
4218
|
-
lastValues: {}
|
|
4214
|
+
lastValues: {},
|
|
4215
|
+
isCompare: { type: Boolean }
|
|
4219
4216
|
}, {
|
|
4220
4217
|
"width": { default: 670 },
|
|
4221
4218
|
"widthModifiers": {},
|
|
@@ -4757,7 +4754,8 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
4757
4754
|
prop: {},
|
|
4758
4755
|
disabled: { type: Boolean, default: false },
|
|
4759
4756
|
size: {},
|
|
4760
|
-
lastValues: {}
|
|
4757
|
+
lastValues: {},
|
|
4758
|
+
isCompare: { type: Boolean }
|
|
4761
4759
|
},
|
|
4762
4760
|
emits: ["change"],
|
|
4763
4761
|
setup(__props, { emit: __emit }) {
|
|
@@ -4896,7 +4894,6 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
4896
4894
|
|
|
4897
4895
|
const _hoisted_1$U = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
4898
4896
|
const _hoisted_2$l = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
4899
|
-
const _hoisted_3$8 = { class: "el-input__inner t-input__inner" };
|
|
4900
4897
|
const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
4901
4898
|
...{
|
|
4902
4899
|
name: "MFieldsDataSourceInput"
|
|
@@ -4911,12 +4908,14 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
4911
4908
|
prop: {},
|
|
4912
4909
|
disabled: { type: Boolean, default: false },
|
|
4913
4910
|
size: {},
|
|
4914
|
-
lastValues: {}
|
|
4911
|
+
lastValues: {},
|
|
4912
|
+
isCompare: { type: Boolean }
|
|
4915
4913
|
},
|
|
4916
4914
|
emits: ["change"],
|
|
4917
4915
|
setup(__props, { emit: __emit }) {
|
|
4918
4916
|
const props = __props;
|
|
4919
4917
|
const emit = __emit;
|
|
4918
|
+
const adapterType = getDesignConfig("adapterType");
|
|
4920
4919
|
const { dataSourceService, propsService } = useServices();
|
|
4921
4920
|
const autocompleteRef = useTemplateRef("autocomplete");
|
|
4922
4921
|
const isFocused = ref(false);
|
|
@@ -5131,62 +5130,83 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
5131
5130
|
"div",
|
|
5132
5131
|
{
|
|
5133
5132
|
key: 2,
|
|
5134
|
-
class: normalizeClass(
|
|
5133
|
+
class: normalizeClass({
|
|
5134
|
+
"tmagic-data-source-input-text": true,
|
|
5135
|
+
"el-input": unref(adapterType) === "element-plus",
|
|
5136
|
+
[`el-input--${__props.size}`]: unref(adapterType) === "element-plus",
|
|
5137
|
+
"t-input": unref(adapterType) === "tdesign-vue-next",
|
|
5138
|
+
[`t-size-${__props.size?.[0]}`]: unref(adapterType) === "tdesign-vue-next"
|
|
5139
|
+
}),
|
|
5135
5140
|
onMouseup: mouseupHandler
|
|
5136
5141
|
},
|
|
5137
5142
|
[
|
|
5138
5143
|
createElementVNode(
|
|
5139
5144
|
"div",
|
|
5140
5145
|
{
|
|
5141
|
-
class: normalizeClass(
|
|
5146
|
+
class: normalizeClass({
|
|
5147
|
+
"tmagic-data-source-input-text-wrapper": true,
|
|
5148
|
+
"el-input__wrapper": unref(adapterType) === "element-plus",
|
|
5149
|
+
"is-focus": isFocused.value
|
|
5150
|
+
})
|
|
5142
5151
|
},
|
|
5143
5152
|
[
|
|
5144
|
-
createElementVNode(
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5153
|
+
createElementVNode(
|
|
5154
|
+
"div",
|
|
5155
|
+
{
|
|
5156
|
+
class: normalizeClass({
|
|
5157
|
+
"el-input__inner": unref(adapterType) === "element-plus",
|
|
5158
|
+
input__inner: unref(adapterType) === "tdesign-vue-next"
|
|
5159
|
+
})
|
|
5160
|
+
},
|
|
5161
|
+
[
|
|
5162
|
+
(openBlock(true), createElementBlock(
|
|
5163
|
+
Fragment,
|
|
5164
|
+
null,
|
|
5165
|
+
renderList(displayState.value, (item, index) => {
|
|
5166
|
+
return openBlock(), createElementBlock(
|
|
5167
|
+
Fragment,
|
|
5168
|
+
null,
|
|
5169
|
+
[
|
|
5170
|
+
item.type === "text" ? (openBlock(), createElementBlock(
|
|
5171
|
+
"span",
|
|
5172
|
+
{
|
|
5173
|
+
key: index,
|
|
5174
|
+
style: { "margin-right": "2px" }
|
|
5175
|
+
},
|
|
5176
|
+
toDisplayString(item.value),
|
|
5177
|
+
1
|
|
5178
|
+
/* TEXT */
|
|
5179
|
+
)) : createCommentVNode("v-if", true),
|
|
5180
|
+
item.type === "var" ? (openBlock(), createBlock(unref(TMagicTag), {
|
|
5156
5181
|
key: index,
|
|
5157
|
-
|
|
5158
|
-
},
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
createVNode(_sfc_main$1r, {
|
|
5186
|
-
class: "tmagic-data-source-input-icon",
|
|
5187
|
-
icon: unref(Coin)
|
|
5188
|
-
}, null, 8, ["icon"])
|
|
5189
|
-
])
|
|
5182
|
+
size: __props.size
|
|
5183
|
+
}, {
|
|
5184
|
+
default: withCtx(() => [
|
|
5185
|
+
createTextVNode(
|
|
5186
|
+
toDisplayString(item.value),
|
|
5187
|
+
1
|
|
5188
|
+
/* TEXT */
|
|
5189
|
+
)
|
|
5190
|
+
]),
|
|
5191
|
+
_: 2
|
|
5192
|
+
/* DYNAMIC */
|
|
5193
|
+
}, 1032, ["size"])) : createCommentVNode("v-if", true)
|
|
5194
|
+
],
|
|
5195
|
+
64
|
|
5196
|
+
/* STABLE_FRAGMENT */
|
|
5197
|
+
);
|
|
5198
|
+
}),
|
|
5199
|
+
256
|
|
5200
|
+
/* UNKEYED_FRAGMENT */
|
|
5201
|
+
)),
|
|
5202
|
+
createVNode(_sfc_main$1r, {
|
|
5203
|
+
class: "tmagic-data-source-input-icon",
|
|
5204
|
+
icon: unref(Coin)
|
|
5205
|
+
}, null, 8, ["icon"])
|
|
5206
|
+
],
|
|
5207
|
+
2
|
|
5208
|
+
/* CLASS */
|
|
5209
|
+
)
|
|
5190
5210
|
],
|
|
5191
5211
|
2
|
|
5192
5212
|
/* CLASS */
|
|
@@ -5556,7 +5576,8 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
5556
5576
|
prop: {},
|
|
5557
5577
|
disabled: { type: Boolean, default: false },
|
|
5558
5578
|
size: {},
|
|
5559
|
-
lastValues: {}
|
|
5579
|
+
lastValues: {},
|
|
5580
|
+
isCompare: { type: Boolean }
|
|
5560
5581
|
},
|
|
5561
5582
|
emits: ["change"],
|
|
5562
5583
|
setup(__props, { emit: __emit }) {
|
|
@@ -5714,7 +5735,8 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
5714
5735
|
prop: {},
|
|
5715
5736
|
disabled: { type: Boolean, default: false },
|
|
5716
5737
|
size: {},
|
|
5717
|
-
lastValues: {}
|
|
5738
|
+
lastValues: {},
|
|
5739
|
+
isCompare: { type: Boolean }
|
|
5718
5740
|
},
|
|
5719
5741
|
emits: ["change"],
|
|
5720
5742
|
setup(__props, { emit: __emit }) {
|
|
@@ -5743,14 +5765,6 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
5743
5765
|
}));
|
|
5744
5766
|
};
|
|
5745
5767
|
const paramsConfig = ref(getParamItemsConfig(props.model[props.name || "dataSourceMethod"]));
|
|
5746
|
-
const setParamsConfig = (dataSourceMethod, formState = {}, setModel) => {
|
|
5747
|
-
paramsConfig.value = dataSourceMethod ? getParamItemsConfig(dataSourceMethod) : [];
|
|
5748
|
-
if (paramsConfig.value.length) {
|
|
5749
|
-
setModel("params", createValues(formState, paramsConfig.value, {}, props.model.params));
|
|
5750
|
-
} else {
|
|
5751
|
-
setModel("params", {});
|
|
5752
|
-
}
|
|
5753
|
-
};
|
|
5754
5768
|
const methodsOptions = computed(
|
|
5755
5769
|
() => dataSources.value?.filter((ds) => ds.methods?.length || dataSourceService.getFormMethod(ds.type).length)?.map((ds) => ({
|
|
5756
5770
|
label: ds.title || ds.id,
|
|
@@ -5766,17 +5780,29 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
5766
5780
|
);
|
|
5767
5781
|
const cascaderConfig = computed(() => ({
|
|
5768
5782
|
type: "cascader",
|
|
5769
|
-
|
|
5770
|
-
options: methodsOptions.value,
|
|
5771
|
-
disable: props.disabled,
|
|
5772
|
-
onChange: (formState, dataSourceMethod, { setModel }) => {
|
|
5773
|
-
setParamsConfig(dataSourceMethod, formState, setModel);
|
|
5774
|
-
return dataSourceMethod;
|
|
5775
|
-
}
|
|
5783
|
+
options: methodsOptions.value
|
|
5776
5784
|
}));
|
|
5777
5785
|
const onChangeHandler = (value) => {
|
|
5778
|
-
|
|
5779
|
-
|
|
5786
|
+
paramsConfig.value = getParamItemsConfig(value);
|
|
5787
|
+
const changeRecords = [
|
|
5788
|
+
{
|
|
5789
|
+
propPath: props.prop,
|
|
5790
|
+
value
|
|
5791
|
+
}
|
|
5792
|
+
];
|
|
5793
|
+
changeRecords.push({
|
|
5794
|
+
propPath: props.prop.replace(`${props.name}`, "params"),
|
|
5795
|
+
value: paramsConfig.value.length ? createValues(mForm, paramsConfig.value, {}, props.model.params) : {}
|
|
5796
|
+
});
|
|
5797
|
+
emit("change", value, {
|
|
5798
|
+
changeRecords
|
|
5799
|
+
});
|
|
5800
|
+
};
|
|
5801
|
+
const onParamsChangeHandler = (value, eventData) => {
|
|
5802
|
+
eventData.changeRecords?.forEach((record) => {
|
|
5803
|
+
record.propPath = `${props.prop.replace(`${props.name}`, "")}${record.propPath}`;
|
|
5804
|
+
});
|
|
5805
|
+
emit("change", props.model[props.name], eventData);
|
|
5780
5806
|
};
|
|
5781
5807
|
const editCodeHandler = () => {
|
|
5782
5808
|
const [id] = props.model[props.name];
|
|
@@ -5787,13 +5813,16 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
5787
5813
|
return (_ctx, _cache) => {
|
|
5788
5814
|
return openBlock(), createElementBlock("div", _hoisted_1$R, [
|
|
5789
5815
|
createElementVNode("div", _hoisted_2$i, [
|
|
5790
|
-
createVNode(unref(
|
|
5816
|
+
createVNode(unref(MCascader), {
|
|
5791
5817
|
class: "select",
|
|
5792
5818
|
config: cascaderConfig.value,
|
|
5793
5819
|
model: __props.model,
|
|
5820
|
+
name: __props.name,
|
|
5794
5821
|
size: __props.size,
|
|
5822
|
+
disabled: __props.disabled,
|
|
5823
|
+
prop: __props.prop,
|
|
5795
5824
|
onChange: onChangeHandler
|
|
5796
|
-
}, null, 8, ["config", "model", "size"]),
|
|
5825
|
+
}, null, 8, ["config", "model", "name", "size", "disabled", "prop"]),
|
|
5797
5826
|
__props.model[__props.name] && isCustomMethod.value && hasDataSourceSidePanel.value ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
5798
5827
|
key: 0,
|
|
5799
5828
|
content: notEditable.value ? "查看" : "编辑"
|
|
@@ -5818,13 +5847,13 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
5818
5847
|
}, 8, ["content"])) : createCommentVNode("v-if", true)
|
|
5819
5848
|
]),
|
|
5820
5849
|
paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$1m, {
|
|
5821
|
-
key: 0,
|
|
5822
5850
|
name: "params",
|
|
5851
|
+
key: __props.model[__props.name],
|
|
5823
5852
|
model: __props.model,
|
|
5824
5853
|
size: __props.size,
|
|
5825
5854
|
disabled: __props.disabled,
|
|
5826
5855
|
"params-config": paramsConfig.value,
|
|
5827
|
-
onChange:
|
|
5856
|
+
onChange: onParamsChangeHandler
|
|
5828
5857
|
}, null, 8, ["model", "size", "disabled", "params-config"])) : createCommentVNode("v-if", true)
|
|
5829
5858
|
]);
|
|
5830
5859
|
};
|
|
@@ -5847,7 +5876,8 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
5847
5876
|
prop: {},
|
|
5848
5877
|
disabled: { type: Boolean, default: false },
|
|
5849
5878
|
size: {},
|
|
5850
|
-
lastValues: {}
|
|
5879
|
+
lastValues: {},
|
|
5880
|
+
isCompare: { type: Boolean }
|
|
5851
5881
|
}, {
|
|
5852
5882
|
"width": { default: 670 },
|
|
5853
5883
|
"widthModifiers": {},
|
|
@@ -6104,7 +6134,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
6104
6134
|
prop: {},
|
|
6105
6135
|
disabled: { type: Boolean, default: false },
|
|
6106
6136
|
size: {},
|
|
6107
|
-
lastValues: {}
|
|
6137
|
+
lastValues: {},
|
|
6138
|
+
isCompare: { type: Boolean }
|
|
6108
6139
|
},
|
|
6109
6140
|
emits: ["change"],
|
|
6110
6141
|
setup(__props, { emit: __emit }) {
|
|
@@ -6199,7 +6230,8 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
6199
6230
|
prop: {},
|
|
6200
6231
|
disabled: { type: Boolean, default: false },
|
|
6201
6232
|
size: {},
|
|
6202
|
-
lastValues: {}
|
|
6233
|
+
lastValues: {},
|
|
6234
|
+
isCompare: { type: Boolean }
|
|
6203
6235
|
},
|
|
6204
6236
|
emits: ["change"],
|
|
6205
6237
|
setup(__props, { emit: __emit }) {
|
|
@@ -6336,7 +6368,8 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
6336
6368
|
prop: {},
|
|
6337
6369
|
disabled: { type: Boolean },
|
|
6338
6370
|
size: {},
|
|
6339
|
-
lastValues: {}
|
|
6371
|
+
lastValues: {},
|
|
6372
|
+
isCompare: { type: Boolean }
|
|
6340
6373
|
},
|
|
6341
6374
|
emits: ["change"],
|
|
6342
6375
|
setup(__props, { emit: __emit }) {
|
|
@@ -6450,7 +6483,6 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
6450
6483
|
display: (mForm, { model }) => model.actionType === ActionType.COMP,
|
|
6451
6484
|
onChange: (MForm, v, { setModel }) => {
|
|
6452
6485
|
setModel("method", "");
|
|
6453
|
-
return v;
|
|
6454
6486
|
}
|
|
6455
6487
|
};
|
|
6456
6488
|
return { ...defaultTargetCompConfig, ...props.config.targetCompConfig };
|
|
@@ -6708,7 +6740,8 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
6708
6740
|
prop: {},
|
|
6709
6741
|
disabled: { type: Boolean, default: false },
|
|
6710
6742
|
size: {},
|
|
6711
|
-
lastValues: {}
|
|
6743
|
+
lastValues: {},
|
|
6744
|
+
isCompare: { type: Boolean }
|
|
6712
6745
|
},
|
|
6713
6746
|
emits: ["change"],
|
|
6714
6747
|
setup(__props, { emit: __emit }) {
|
|
@@ -6863,19 +6896,18 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
6863
6896
|
prop: {},
|
|
6864
6897
|
disabled: { type: Boolean, default: false },
|
|
6865
6898
|
size: {},
|
|
6866
|
-
lastValues: {}
|
|
6899
|
+
lastValues: {},
|
|
6900
|
+
isCompare: { type: Boolean }
|
|
6867
6901
|
},
|
|
6868
6902
|
emits: ["change"],
|
|
6869
6903
|
setup(__props, { emit: __emit }) {
|
|
6870
6904
|
const { editorService } = useServices();
|
|
6871
6905
|
const emit = __emit;
|
|
6872
|
-
const props = __props;
|
|
6873
6906
|
const pageList = computed(
|
|
6874
6907
|
() => editorService.get("root")?.items.filter((item) => item.type === NodeType.PAGE_FRAGMENT)
|
|
6875
6908
|
);
|
|
6876
6909
|
const selectConfig = {
|
|
6877
6910
|
type: "select",
|
|
6878
|
-
name: props.name,
|
|
6879
6911
|
options: () => {
|
|
6880
6912
|
if (pageList.value) {
|
|
6881
6913
|
return pageList.value.map((item) => ({
|
|
@@ -6887,24 +6919,26 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
6887
6919
|
return [];
|
|
6888
6920
|
}
|
|
6889
6921
|
};
|
|
6890
|
-
const changeHandler =
|
|
6891
|
-
emit("change",
|
|
6922
|
+
const changeHandler = (v) => {
|
|
6923
|
+
emit("change", v);
|
|
6892
6924
|
};
|
|
6893
6925
|
const editPageFragment = (id) => {
|
|
6894
6926
|
editorService.select(id);
|
|
6895
6927
|
};
|
|
6896
6928
|
return (_ctx, _cache) => {
|
|
6897
|
-
const _component_m_form_container = resolveComponent("m-form-container");
|
|
6898
6929
|
return openBlock(), createElementBlock("div", _hoisted_1$L, [
|
|
6899
6930
|
createElementVNode("div", _hoisted_2$e, [
|
|
6900
6931
|
createCommentVNode(" 页面片下拉框 "),
|
|
6901
|
-
createVNode(
|
|
6932
|
+
createVNode(unref(MSelect), {
|
|
6902
6933
|
class: "select",
|
|
6903
6934
|
config: selectConfig,
|
|
6904
6935
|
model: __props.model,
|
|
6936
|
+
name: __props.name,
|
|
6905
6937
|
size: __props.size,
|
|
6938
|
+
prop: __props.prop,
|
|
6939
|
+
disabled: __props.disabled,
|
|
6906
6940
|
onChange: changeHandler
|
|
6907
|
-
}, null, 8, ["model", "size"]),
|
|
6941
|
+
}, null, 8, ["model", "name", "size", "prop", "disabled"]),
|
|
6908
6942
|
createCommentVNode(" 编辑按钮 "),
|
|
6909
6943
|
__props.model[__props.name] ? (openBlock(), createBlock(_sfc_main$1r, {
|
|
6910
6944
|
key: 0,
|
|
@@ -6932,7 +6966,8 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
6932
6966
|
prop: {},
|
|
6933
6967
|
disabled: { type: Boolean },
|
|
6934
6968
|
size: {},
|
|
6935
|
-
lastValues: {}
|
|
6969
|
+
lastValues: {},
|
|
6970
|
+
isCompare: { type: Boolean }
|
|
6936
6971
|
},
|
|
6937
6972
|
emits: ["change"],
|
|
6938
6973
|
setup(__props, { emit: __emit }) {
|
|
@@ -8087,7 +8122,8 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
8087
8122
|
prop: {},
|
|
8088
8123
|
disabled: { type: Boolean },
|
|
8089
8124
|
size: {},
|
|
8090
|
-
lastValues: {}
|
|
8125
|
+
lastValues: {},
|
|
8126
|
+
isCompare: { type: Boolean }
|
|
8091
8127
|
},
|
|
8092
8128
|
emits: ["change"],
|
|
8093
8129
|
setup(__props, { emit: __emit }) {
|
|
@@ -8191,7 +8227,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
8191
8227
|
prop: {},
|
|
8192
8228
|
disabled: { type: Boolean },
|
|
8193
8229
|
size: {},
|
|
8194
|
-
lastValues: {}
|
|
8230
|
+
lastValues: {},
|
|
8231
|
+
isCompare: { type: Boolean }
|
|
8195
8232
|
},
|
|
8196
8233
|
emits: ["change"],
|
|
8197
8234
|
setup(__props, { emit: __emit }) {
|
|
@@ -8212,7 +8249,6 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
8212
8249
|
id = getIdFromEl()(detail) || id;
|
|
8213
8250
|
}
|
|
8214
8251
|
if (id) {
|
|
8215
|
-
props.model[props.name] = id;
|
|
8216
8252
|
emit("change", id);
|
|
8217
8253
|
mForm?.$emit("field-change", props.prop, id);
|
|
8218
8254
|
}
|
|
@@ -8231,7 +8267,6 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
8231
8267
|
};
|
|
8232
8268
|
const deleteHandler = () => {
|
|
8233
8269
|
if (props.model) {
|
|
8234
|
-
props.model[props.name] = "";
|
|
8235
8270
|
emit("change", "");
|
|
8236
8271
|
mForm?.$emit("field-change", props.prop, "");
|
|
8237
8272
|
}
|
|
@@ -13591,7 +13626,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
13591
13626
|
);
|
|
13592
13627
|
}
|
|
13593
13628
|
});
|
|
13594
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
13629
|
+
const resizeObserver = new globalThis.ResizeObserver((entries) => {
|
|
13595
13630
|
for (const { contentRect } of entries) {
|
|
13596
13631
|
uiService.set("stageContainerRect", {
|
|
13597
13632
|
width: contentRect.width,
|
|
@@ -14906,7 +14941,7 @@ const jsContent = `(function () {
|
|
|
14906
14941
|
return keys.some((key, index) => {
|
|
14907
14942
|
const field = f.find(({ name }) => name === key);
|
|
14908
14943
|
f = field?.fields || [];
|
|
14909
|
-
return field
|
|
14944
|
+
return field?.type === "array" && // 不是整数
|
|
14910
14945
|
/^(?!\\d+$).*$/.test(\`\${keys[index + 1]}\`) && index < keys.length - 1;
|
|
14911
14946
|
});
|
|
14912
14947
|
};
|