@tmagic/editor 1.3.0-beta.6 → 1.3.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +57 -56
- package/dist/tmagic-editor.js +549 -436
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +567 -454
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/Editor.vue +8 -0
- package/src/components/ContentMenu.vue +2 -6
- package/src/components/SplitView.vue +22 -6
- package/src/components/Tree.vue +66 -0
- package/src/components/TreeNode.vue +142 -0
- package/src/layouts/Framework.vue +11 -21
- package/src/layouts/sidebar/Sidebar.vue +13 -0
- package/src/layouts/sidebar/data-source/DataSourceList.vue +28 -17
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +8 -2
- package/src/layouts/sidebar/layer/LayerPanel.vue +40 -31
- package/src/layouts/sidebar/layer/use-click.ts +105 -0
- package/src/layouts/sidebar/layer/use-drag.ts +1 -1
- package/src/layouts/sidebar/layer/use-filter.ts +1 -12
- package/src/layouts/sidebar/layer/use-keybinding.ts +6 -2
- package/src/layouts/sidebar/layer/use-node-status.ts +4 -2
- package/src/layouts/workspace/viewer/NodeListMenu.vue +11 -2
- package/src/services/dep.ts +1 -1
- package/src/theme/layer-panel.scss +2 -74
- package/src/theme/theme.scss +1 -0
- package/src/theme/tree.scss +72 -0
- package/src/type.ts +16 -1
- package/src/utils/dep.ts +7 -2
- package/src/utils/tree.ts +15 -0
- package/types/components/ContentMenu.vue.d.ts +4 -1
- package/types/components/SplitView.vue.d.ts +3 -1
- package/types/{layouts/sidebar/layer/LayerNode.vue.d.ts → components/Tree.vue.d.ts} +19 -17
- package/types/components/TreeNode.vue.d.ts +47 -0
- package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +2 -6
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +7 -1
- package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/layer/use-click.d.ts +106 -0
- package/types/layouts/sidebar/layer/use-filter.d.ts +0 -1
- package/types/layouts/sidebar/layer/use-keybinding.d.ts +2 -1
- package/types/type.d.ts +20 -1
- package/types/utils/tree.d.ts +3 -0
- package/src/layouts/sidebar/layer/LayerNode.vue +0 -208
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
};
|
|
30
30
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
31
31
|
|
|
32
|
-
const _hoisted_1$
|
|
32
|
+
const _hoisted_1$x = {
|
|
33
33
|
class: /* @__PURE__ */ vue.normalizeClass(`magic-code-editor`)
|
|
34
34
|
};
|
|
35
|
-
const _sfc_main$
|
|
35
|
+
const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
|
|
36
36
|
...{
|
|
37
37
|
name: "MEditorCodeEditor"
|
|
38
38
|
},
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
return (_ctx, _cache) => {
|
|
192
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
192
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$x, [
|
|
193
193
|
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
194
194
|
to: "body",
|
|
195
195
|
disabled: !fullScreen.value
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
219
|
|
|
220
|
-
const _sfc_main$
|
|
220
|
+
const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
221
221
|
...{
|
|
222
222
|
name: "MEditorCode"
|
|
223
223
|
},
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
emit("change", v);
|
|
242
242
|
};
|
|
243
243
|
return (_ctx, _cache) => {
|
|
244
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
244
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
245
245
|
height: _ctx.config.height,
|
|
246
246
|
"init-values": _ctx.model[_ctx.name],
|
|
247
247
|
language: _ctx.config.language,
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
|
|
259
|
-
const _sfc_main$
|
|
259
|
+
const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
260
260
|
...{
|
|
261
261
|
name: "MEditorCodeLink"
|
|
262
262
|
},
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
|
|
338
|
-
const _sfc_main$
|
|
338
|
+
const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
339
339
|
...{
|
|
340
340
|
name: "MEditorCodeSelect"
|
|
341
341
|
},
|
|
@@ -407,11 +407,11 @@
|
|
|
407
407
|
}
|
|
408
408
|
});
|
|
409
409
|
|
|
410
|
-
const _hoisted_1$
|
|
410
|
+
const _hoisted_1$w = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
411
411
|
const _hoisted_2$p = { style: { "flex": "1" } };
|
|
412
412
|
const _hoisted_3$b = { style: { "flex": "1" } };
|
|
413
413
|
const _hoisted_4$7 = { class: "dialog-footer" };
|
|
414
|
-
const _sfc_main$
|
|
414
|
+
const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
415
415
|
...{
|
|
416
416
|
name: "MEditorCodeBlockEditor"
|
|
417
417
|
},
|
|
@@ -653,7 +653,7 @@
|
|
|
653
653
|
])
|
|
654
654
|
]),
|
|
655
655
|
default: vue.withCtx(() => [
|
|
656
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
656
|
+
vue.createElementVNode("div", _hoisted_1$w, [
|
|
657
657
|
vue.createElementVNode("div", _hoisted_2$p, [
|
|
658
658
|
vue.createVNode(vue.unref(design.TMagicTag), {
|
|
659
659
|
size: "small",
|
|
@@ -677,7 +677,7 @@
|
|
|
677
677
|
})
|
|
678
678
|
])
|
|
679
679
|
]),
|
|
680
|
-
difVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
680
|
+
difVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
681
681
|
key: 0,
|
|
682
682
|
ref_key: "magicVsEditor",
|
|
683
683
|
ref: magicVsEditor,
|
|
@@ -2964,7 +2964,7 @@
|
|
|
2964
2964
|
return newNode;
|
|
2965
2965
|
};
|
|
2966
2966
|
|
|
2967
|
-
const _sfc_main$
|
|
2967
|
+
const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
|
|
2968
2968
|
...{
|
|
2969
2969
|
name: "MEditorCodeParams"
|
|
2970
2970
|
},
|
|
@@ -3013,8 +3013,8 @@
|
|
|
3013
3013
|
}
|
|
3014
3014
|
});
|
|
3015
3015
|
|
|
3016
|
-
const _hoisted_1$
|
|
3017
|
-
const _sfc_main$
|
|
3016
|
+
const _hoisted_1$v = ["src"];
|
|
3017
|
+
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
3018
3018
|
...{
|
|
3019
3019
|
name: "MEditorIcon"
|
|
3020
3020
|
},
|
|
@@ -3038,7 +3038,7 @@
|
|
|
3038
3038
|
class: "magic-editor-icon"
|
|
3039
3039
|
}, {
|
|
3040
3040
|
default: vue.withCtx(() => [
|
|
3041
|
-
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
3041
|
+
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$v)
|
|
3042
3042
|
]),
|
|
3043
3043
|
_: 1
|
|
3044
3044
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -3115,9 +3115,9 @@
|
|
|
3115
3115
|
};
|
|
3116
3116
|
};
|
|
3117
3117
|
|
|
3118
|
-
const _hoisted_1$
|
|
3118
|
+
const _hoisted_1$u = { class: "m-fields-code-select-col" };
|
|
3119
3119
|
const _hoisted_2$o = { class: "code-select-container" };
|
|
3120
|
-
const _sfc_main$
|
|
3120
|
+
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
3121
3121
|
...{
|
|
3122
3122
|
name: "MEditorCodeSelectCol"
|
|
3123
3123
|
},
|
|
@@ -3189,7 +3189,7 @@
|
|
|
3189
3189
|
const { codeBlockEditor, codeConfig, editCode, submitCodeBlockHandler } = useCodeBlockEdit(services?.codeBlockService);
|
|
3190
3190
|
return (_ctx, _cache) => {
|
|
3191
3191
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
3192
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3192
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
|
|
3193
3193
|
vue.createElementVNode("div", _hoisted_2$o, [
|
|
3194
3194
|
vue.createVNode(_component_m_form_container, {
|
|
3195
3195
|
class: "select",
|
|
@@ -3198,14 +3198,14 @@
|
|
|
3198
3198
|
size: _ctx.size,
|
|
3199
3199
|
onChange: onParamsChangeHandler
|
|
3200
3200
|
}, null, 8, ["model", "size"]),
|
|
3201
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3201
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
3202
3202
|
key: 0,
|
|
3203
3203
|
class: "icon",
|
|
3204
3204
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
3205
3205
|
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(editCode)(_ctx.model[_ctx.name]))
|
|
3206
3206
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
3207
3207
|
]),
|
|
3208
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3208
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$O, {
|
|
3209
3209
|
key: 0,
|
|
3210
3210
|
name: "params",
|
|
3211
3211
|
model: _ctx.model,
|
|
@@ -3213,7 +3213,7 @@
|
|
|
3213
3213
|
"params-config": paramsConfig.value,
|
|
3214
3214
|
onChange: onParamsChangeHandler
|
|
3215
3215
|
}, null, 8, ["model", "size", "params-config"])) : vue.createCommentVNode("", true),
|
|
3216
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3216
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
3217
3217
|
key: 1,
|
|
3218
3218
|
ref_key: "codeBlockEditor",
|
|
3219
3219
|
ref: codeBlockEditor,
|
|
@@ -3226,9 +3226,9 @@
|
|
|
3226
3226
|
}
|
|
3227
3227
|
});
|
|
3228
3228
|
|
|
3229
|
-
const _hoisted_1$
|
|
3229
|
+
const _hoisted_1$t = { class: "m-editor-data-source-fields" };
|
|
3230
3230
|
const _hoisted_2$n = { class: "m-editor-data-source-fields-footer" };
|
|
3231
|
-
const _sfc_main$
|
|
3231
|
+
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
3232
3232
|
...{
|
|
3233
3233
|
name: "MEditorDataSourceFields"
|
|
3234
3234
|
},
|
|
@@ -3459,7 +3459,7 @@
|
|
|
3459
3459
|
}
|
|
3460
3460
|
};
|
|
3461
3461
|
return (_ctx, _cache) => {
|
|
3462
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3462
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, [
|
|
3463
3463
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
3464
3464
|
data: _ctx.model[_ctx.name],
|
|
3465
3465
|
columns: fieldColumns
|
|
@@ -3516,7 +3516,7 @@
|
|
|
3516
3516
|
}
|
|
3517
3517
|
});
|
|
3518
3518
|
|
|
3519
|
-
const _sfc_main$
|
|
3519
|
+
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
3520
3520
|
__name: "DataSourceFieldSelect",
|
|
3521
3521
|
props: {
|
|
3522
3522
|
config: {},
|
|
@@ -3570,10 +3570,10 @@
|
|
|
3570
3570
|
}
|
|
3571
3571
|
});
|
|
3572
3572
|
|
|
3573
|
-
const _hoisted_1$
|
|
3573
|
+
const _hoisted_1$s = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
3574
3574
|
const _hoisted_2$m = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
3575
3575
|
const _hoisted_3$a = { class: "el-input__inner" };
|
|
3576
|
-
const _sfc_main$
|
|
3576
|
+
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
3577
3577
|
...{
|
|
3578
3578
|
name: "MEditorDataSourceInput"
|
|
3579
3579
|
},
|
|
@@ -3762,10 +3762,10 @@
|
|
|
3762
3762
|
}
|
|
3763
3763
|
), {
|
|
3764
3764
|
suffix: vue.withCtx(() => [
|
|
3765
|
-
vue.createVNode(_sfc_main$
|
|
3765
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
3766
3766
|
]),
|
|
3767
3767
|
default: vue.withCtx(({ item }) => [
|
|
3768
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
3768
|
+
vue.createElementVNode("div", _hoisted_1$s, [
|
|
3769
3769
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
3770
3770
|
vue.createElementVNode("span", _hoisted_2$m, vue.toDisplayString(item.value), 1)
|
|
3771
3771
|
])
|
|
@@ -3797,7 +3797,7 @@
|
|
|
3797
3797
|
}, 1032, ["size"])) : vue.createCommentVNode("", true)
|
|
3798
3798
|
], 64);
|
|
3799
3799
|
}), 256)),
|
|
3800
|
-
vue.createVNode(_sfc_main$
|
|
3800
|
+
vue.createVNode(_sfc_main$N, {
|
|
3801
3801
|
class: "tmagic-data-source-input-icon",
|
|
3802
3802
|
icon: vue.unref(iconsVue.Coin)
|
|
3803
3803
|
}, null, 8, ["icon"])
|
|
@@ -3880,9 +3880,9 @@
|
|
|
3880
3880
|
};
|
|
3881
3881
|
};
|
|
3882
3882
|
|
|
3883
|
-
const _hoisted_1$
|
|
3883
|
+
const _hoisted_1$r = { class: "m-editor-data-source-methods" };
|
|
3884
3884
|
const _hoisted_2$l = { class: "m-editor-data-source-methods-footer" };
|
|
3885
|
-
const _sfc_main$
|
|
3885
|
+
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
3886
3886
|
...{
|
|
3887
3887
|
name: "MEditorDataSourceMethods"
|
|
3888
3888
|
},
|
|
@@ -3951,7 +3951,7 @@
|
|
|
3951
3951
|
emit("change", props.model[props.name]);
|
|
3952
3952
|
};
|
|
3953
3953
|
return (_ctx, _cache) => {
|
|
3954
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3954
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$r, [
|
|
3955
3955
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
3956
3956
|
data: _ctx.model[_ctx.name],
|
|
3957
3957
|
columns: methodColumns
|
|
@@ -3970,7 +3970,7 @@
|
|
|
3970
3970
|
_: 1
|
|
3971
3971
|
}, 8, ["disabled"])
|
|
3972
3972
|
]),
|
|
3973
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3973
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
3974
3974
|
key: 0,
|
|
3975
3975
|
ref_key: "codeBlockEditor",
|
|
3976
3976
|
ref: codeBlockEditor,
|
|
@@ -3985,9 +3985,9 @@
|
|
|
3985
3985
|
}
|
|
3986
3986
|
});
|
|
3987
3987
|
|
|
3988
|
-
const _hoisted_1$
|
|
3988
|
+
const _hoisted_1$q = { class: "m-fields-data-source-method-select" };
|
|
3989
3989
|
const _hoisted_2$k = { class: "data-source-method-select-container" };
|
|
3990
|
-
const _sfc_main$
|
|
3990
|
+
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
3991
3991
|
...{
|
|
3992
3992
|
name: "MEditorDataSourceMethodSelect"
|
|
3993
3993
|
},
|
|
@@ -4069,7 +4069,7 @@
|
|
|
4069
4069
|
};
|
|
4070
4070
|
return (_ctx, _cache) => {
|
|
4071
4071
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
4072
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4072
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$q, [
|
|
4073
4073
|
vue.createElementVNode("div", _hoisted_2$k, [
|
|
4074
4074
|
vue.createVNode(_component_m_form_container, {
|
|
4075
4075
|
class: "select",
|
|
@@ -4077,14 +4077,14 @@
|
|
|
4077
4077
|
model: _ctx.model,
|
|
4078
4078
|
onChange: onChangeHandler
|
|
4079
4079
|
}, null, 8, ["config", "model"]),
|
|
4080
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4080
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
4081
4081
|
key: 0,
|
|
4082
4082
|
class: "icon",
|
|
4083
4083
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
4084
4084
|
onClick: editCodeHandler
|
|
4085
4085
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
4086
4086
|
]),
|
|
4087
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4087
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$O, {
|
|
4088
4088
|
key: 0,
|
|
4089
4089
|
name: "params",
|
|
4090
4090
|
model: _ctx.model,
|
|
@@ -4093,7 +4093,7 @@
|
|
|
4093
4093
|
"params-config": paramsConfig.value,
|
|
4094
4094
|
onChange: onChangeHandler
|
|
4095
4095
|
}, null, 8, ["model", "size", "disabled", "params-config"])) : vue.createCommentVNode("", true),
|
|
4096
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4096
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
4097
4097
|
key: 1,
|
|
4098
4098
|
ref_key: "codeBlockEditor",
|
|
4099
4099
|
ref: codeBlockEditor,
|
|
@@ -4106,9 +4106,9 @@
|
|
|
4106
4106
|
}
|
|
4107
4107
|
});
|
|
4108
4108
|
|
|
4109
|
-
const _hoisted_1$
|
|
4109
|
+
const _hoisted_1$p = { class: "m-editor-data-source-fields" };
|
|
4110
4110
|
const _hoisted_2$j = { class: "m-editor-data-source-fields-footer" };
|
|
4111
|
-
const _sfc_main$
|
|
4111
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
4112
4112
|
...{
|
|
4113
4113
|
name: "MEditorDataSourceMocks"
|
|
4114
4114
|
},
|
|
@@ -4194,7 +4194,7 @@
|
|
|
4194
4194
|
const columns = [
|
|
4195
4195
|
{
|
|
4196
4196
|
type: "expand",
|
|
4197
|
-
component: _sfc_main$
|
|
4197
|
+
component: _sfc_main$T,
|
|
4198
4198
|
props: (row) => ({
|
|
4199
4199
|
initValues: row.data,
|
|
4200
4200
|
language: "json",
|
|
@@ -4303,7 +4303,7 @@
|
|
|
4303
4303
|
});
|
|
4304
4304
|
};
|
|
4305
4305
|
return (_ctx, _cache) => {
|
|
4306
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4306
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
|
|
4307
4307
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
4308
4308
|
data: _ctx.model[_ctx.name],
|
|
4309
4309
|
columns
|
|
@@ -4339,7 +4339,7 @@
|
|
|
4339
4339
|
}
|
|
4340
4340
|
});
|
|
4341
4341
|
|
|
4342
|
-
const _sfc_main$
|
|
4342
|
+
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
4343
4343
|
...{
|
|
4344
4344
|
name: "MEditorDataSourceSelect"
|
|
4345
4345
|
},
|
|
@@ -4394,12 +4394,12 @@
|
|
|
4394
4394
|
}
|
|
4395
4395
|
});
|
|
4396
4396
|
|
|
4397
|
-
const _hoisted_1$
|
|
4397
|
+
const _hoisted_1$o = { class: "m-fields-event-select" };
|
|
4398
4398
|
const _hoisted_2$i = {
|
|
4399
4399
|
key: 1,
|
|
4400
4400
|
class: "fullWidth"
|
|
4401
4401
|
};
|
|
4402
|
-
const _sfc_main$
|
|
4402
|
+
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
4403
4403
|
...{
|
|
4404
4404
|
name: "MEditorEventSelect"
|
|
4405
4405
|
},
|
|
@@ -4601,7 +4601,7 @@
|
|
|
4601
4601
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
4602
4602
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
4603
4603
|
const _component_m_form_panel = vue.resolveComponent("m-form-panel");
|
|
4604
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4604
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
|
|
4605
4605
|
isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
|
|
4606
4606
|
key: 0,
|
|
4607
4607
|
ref: "eventForm",
|
|
@@ -4661,9 +4661,9 @@
|
|
|
4661
4661
|
}
|
|
4662
4662
|
});
|
|
4663
4663
|
|
|
4664
|
-
const _hoisted_1$
|
|
4664
|
+
const _hoisted_1$n = { class: "m-fields-key-value" };
|
|
4665
4665
|
const _hoisted_2$h = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
4666
|
-
const _sfc_main$
|
|
4666
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
4667
4667
|
...{
|
|
4668
4668
|
name: "MEditorKeyValue"
|
|
4669
4669
|
},
|
|
@@ -4709,7 +4709,7 @@
|
|
|
4709
4709
|
emit("change", getValue());
|
|
4710
4710
|
};
|
|
4711
4711
|
return (_ctx, _cache) => {
|
|
4712
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4712
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
4713
4713
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
4714
4714
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4715
4715
|
class: "m-fields-key-value-item",
|
|
@@ -4762,12 +4762,12 @@
|
|
|
4762
4762
|
}
|
|
4763
4763
|
});
|
|
4764
4764
|
|
|
4765
|
-
const _hoisted_1$
|
|
4765
|
+
const _hoisted_1$m = {
|
|
4766
4766
|
key: 1,
|
|
4767
4767
|
class: "m-fields-ui-select",
|
|
4768
4768
|
style: { "display": "flex" }
|
|
4769
4769
|
};
|
|
4770
|
-
const _sfc_main$
|
|
4770
|
+
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
4771
4771
|
...{
|
|
4772
4772
|
name: "MEditorUISelect"
|
|
4773
4773
|
},
|
|
@@ -4856,7 +4856,7 @@
|
|
|
4856
4856
|
]),
|
|
4857
4857
|
_: 1
|
|
4858
4858
|
}, 8, ["icon", "disabled", "size"])
|
|
4859
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4859
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
4860
4860
|
val.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
4861
4861
|
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
4862
4862
|
content: "清除",
|
|
@@ -4953,7 +4953,7 @@
|
|
|
4953
4953
|
};
|
|
4954
4954
|
};
|
|
4955
4955
|
|
|
4956
|
-
const _sfc_main$
|
|
4956
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
4957
4957
|
...{
|
|
4958
4958
|
name: "MEditorResizer"
|
|
4959
4959
|
},
|
|
@@ -4974,7 +4974,7 @@
|
|
|
4974
4974
|
}
|
|
4975
4975
|
});
|
|
4976
4976
|
|
|
4977
|
-
const _sfc_main$
|
|
4977
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
4978
4978
|
...{
|
|
4979
4979
|
name: "MEditorLayout"
|
|
4980
4980
|
},
|
|
@@ -4990,19 +4990,22 @@
|
|
|
4990
4990
|
centerClass: {}
|
|
4991
4991
|
},
|
|
4992
4992
|
emits: ["update:left", "change", "update:right"],
|
|
4993
|
-
setup(__props, { emit }) {
|
|
4993
|
+
setup(__props, { expose: __expose, emit }) {
|
|
4994
4994
|
const props = __props;
|
|
4995
4995
|
const el = vue.ref();
|
|
4996
4996
|
const hasLeft = vue.computed(() => typeof props.left !== "undefined");
|
|
4997
4997
|
const hasRight = vue.computed(() => typeof props.right !== "undefined");
|
|
4998
|
-
const getCenterWidth = (clientWidth2,
|
|
4998
|
+
const getCenterWidth = (clientWidth2, l = 0, r = 0) => {
|
|
4999
|
+
let right = r > 0 ? r : 0;
|
|
5000
|
+
let left = l > 0 ? l : 0;
|
|
4999
5001
|
let center2 = clientWidth2 - left - right;
|
|
5000
5002
|
if (center2 < props.minCenter) {
|
|
5001
5003
|
center2 = props.minCenter;
|
|
5002
|
-
if (
|
|
5003
|
-
right = clientWidth2 - left -
|
|
5004
|
+
if (right > center2 + props.minRight) {
|
|
5005
|
+
right = clientWidth2 - left - center2;
|
|
5004
5006
|
} else {
|
|
5005
|
-
|
|
5007
|
+
right = props.minRight;
|
|
5008
|
+
left = clientWidth2 - right - center2;
|
|
5006
5009
|
}
|
|
5007
5010
|
}
|
|
5008
5011
|
return {
|
|
@@ -5065,7 +5068,7 @@
|
|
|
5065
5068
|
if (clientWidth - (props.left || 0) - right <= 0) {
|
|
5066
5069
|
right = props.right;
|
|
5067
5070
|
}
|
|
5068
|
-
const columnWidth = getCenterWidth(clientWidth, props.left
|
|
5071
|
+
const columnWidth = getCenterWidth(clientWidth, props.left, right);
|
|
5069
5072
|
center.value = columnWidth.center;
|
|
5070
5073
|
emit("change", {
|
|
5071
5074
|
left: columnWidth.left,
|
|
@@ -5073,11 +5076,22 @@
|
|
|
5073
5076
|
right: columnWidth.right
|
|
5074
5077
|
});
|
|
5075
5078
|
};
|
|
5079
|
+
__expose({
|
|
5080
|
+
updateWidth() {
|
|
5081
|
+
const columnWidth = getCenterWidth(el.value?.clientWidth || clientWidth, props.left, props.right);
|
|
5082
|
+
emit("change", {
|
|
5083
|
+
left: columnWidth.left,
|
|
5084
|
+
center: center.value,
|
|
5085
|
+
right: columnWidth.right
|
|
5086
|
+
});
|
|
5087
|
+
}
|
|
5088
|
+
});
|
|
5076
5089
|
return (_ctx, _cache) => {
|
|
5077
5090
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5078
5091
|
ref_key: "el",
|
|
5079
5092
|
ref: el,
|
|
5080
|
-
class: "m-editor-layout"
|
|
5093
|
+
class: "m-editor-layout",
|
|
5094
|
+
style: vue.normalizeStyle(`min-width: ${props.minCenter + props.minLeft + props.minRight}px`)
|
|
5081
5095
|
}, [
|
|
5082
5096
|
hasLeft.value && _ctx.$slots.left ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
5083
5097
|
vue.createElementVNode("div", {
|
|
@@ -5086,7 +5100,7 @@
|
|
|
5086
5100
|
}, [
|
|
5087
5101
|
vue.renderSlot(_ctx.$slots, "left")
|
|
5088
5102
|
], 6),
|
|
5089
|
-
vue.createVNode(_sfc_main$
|
|
5103
|
+
vue.createVNode(_sfc_main$B, { onChange: changeLeft })
|
|
5090
5104
|
], 64)) : vue.createCommentVNode("", true),
|
|
5091
5105
|
vue.createElementVNode("div", {
|
|
5092
5106
|
class: vue.normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
@@ -5095,7 +5109,7 @@
|
|
|
5095
5109
|
vue.renderSlot(_ctx.$slots, "center")
|
|
5096
5110
|
], 6),
|
|
5097
5111
|
hasRight.value && _ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
5098
|
-
vue.createVNode(_sfc_main$
|
|
5112
|
+
vue.createVNode(_sfc_main$B, { onChange: changeRight }),
|
|
5099
5113
|
vue.createElementVNode("div", {
|
|
5100
5114
|
class: vue.normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
5101
5115
|
style: vue.normalizeStyle(`width: ${_ctx.right}px`)
|
|
@@ -5103,15 +5117,15 @@
|
|
|
5103
5117
|
vue.renderSlot(_ctx.$slots, "right")
|
|
5104
5118
|
], 6)
|
|
5105
5119
|
], 64)) : vue.createCommentVNode("", true)
|
|
5106
|
-
],
|
|
5120
|
+
], 4);
|
|
5107
5121
|
};
|
|
5108
5122
|
}
|
|
5109
5123
|
});
|
|
5110
5124
|
|
|
5111
|
-
const _hoisted_1$
|
|
5125
|
+
const _hoisted_1$l = { class: "m-editor-empty-panel" };
|
|
5112
5126
|
const _hoisted_2$g = { class: "m-editor-empty-content" };
|
|
5113
5127
|
const _hoisted_3$9 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
5114
|
-
const _sfc_main$
|
|
5128
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
5115
5129
|
...{
|
|
5116
5130
|
name: "MEditorAddPageBox"
|
|
5117
5131
|
},
|
|
@@ -5131,14 +5145,14 @@
|
|
|
5131
5145
|
});
|
|
5132
5146
|
};
|
|
5133
5147
|
return (_ctx, _cache) => {
|
|
5134
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5148
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
5135
5149
|
vue.createElementVNode("div", _hoisted_2$g, [
|
|
5136
5150
|
vue.createElementVNode("div", {
|
|
5137
5151
|
class: "m-editor-empty-button",
|
|
5138
5152
|
onClick: clickHandler
|
|
5139
5153
|
}, [
|
|
5140
5154
|
vue.createElementVNode("div", null, [
|
|
5141
|
-
vue.createVNode(_sfc_main$
|
|
5155
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
5142
5156
|
]),
|
|
5143
5157
|
_hoisted_3$9
|
|
5144
5158
|
])
|
|
@@ -5152,7 +5166,7 @@
|
|
|
5152
5166
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
5153
5167
|
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
5154
5168
|
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
5155
|
-
const _sfc_main$
|
|
5169
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
5156
5170
|
...{
|
|
5157
5171
|
name: "MEditorFramework"
|
|
5158
5172
|
},
|
|
@@ -5161,31 +5175,21 @@
|
|
|
5161
5175
|
const codeOptions = vue.inject("codeOptions", {});
|
|
5162
5176
|
const { editorService, uiService } = vue.inject("services") || {};
|
|
5163
5177
|
const content = vue.ref();
|
|
5178
|
+
const splitView = vue.ref();
|
|
5164
5179
|
const root = vue.computed(() => editorService?.get("root"));
|
|
5165
5180
|
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
5166
5181
|
const showSrc = vue.computed(() => uiService?.get("showSrc"));
|
|
5167
|
-
const leftColumnWidthCacheData = Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY));
|
|
5168
|
-
const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY));
|
|
5182
|
+
const leftColumnWidthCacheData = Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_LEFT_COLUMN_WIDTH;
|
|
5183
|
+
const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_RIGHT_COLUMN_WIDTH;
|
|
5169
5184
|
const columnWidth = vue.ref({
|
|
5170
5185
|
left: leftColumnWidthCacheData,
|
|
5171
5186
|
center: 0,
|
|
5172
5187
|
right: RightColumnWidthCacheData
|
|
5173
5188
|
});
|
|
5174
5189
|
vue.watch(
|
|
5175
|
-
pageLength,
|
|
5176
|
-
(
|
|
5177
|
-
|
|
5178
|
-
columnWidth.value.left = left;
|
|
5179
|
-
const container = content.value || document.body;
|
|
5180
|
-
if (length <= 0) {
|
|
5181
|
-
columnWidth.value.right = void 0;
|
|
5182
|
-
columnWidth.value.center = container.clientWidth - left;
|
|
5183
|
-
} else {
|
|
5184
|
-
const right = columnWidth.value.right || RightColumnWidthCacheData || DEFAULT_RIGHT_COLUMN_WIDTH;
|
|
5185
|
-
columnWidth.value.right = right;
|
|
5186
|
-
columnWidth.value.center = container.clientWidth - left - right;
|
|
5187
|
-
}
|
|
5188
|
-
uiService?.set("columnWidth", columnWidth.value);
|
|
5190
|
+
[pageLength, splitView],
|
|
5191
|
+
() => {
|
|
5192
|
+
splitView.value?.updateWidth();
|
|
5189
5193
|
},
|
|
5190
5194
|
{
|
|
5191
5195
|
immediate: true
|
|
@@ -5223,20 +5227,23 @@
|
|
|
5223
5227
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5224
5228
|
class: "m-editor",
|
|
5225
5229
|
ref_key: "content",
|
|
5226
|
-
ref: content
|
|
5230
|
+
ref: content,
|
|
5231
|
+
style: { "min-width": "180px" }
|
|
5227
5232
|
}, [
|
|
5228
5233
|
vue.renderSlot(_ctx.$slots, "header"),
|
|
5229
5234
|
vue.renderSlot(_ctx.$slots, "nav"),
|
|
5230
5235
|
vue.renderSlot(_ctx.$slots, "content-before"),
|
|
5231
5236
|
showSrc.value ? vue.renderSlot(_ctx.$slots, "src-code", { key: 0 }, () => [
|
|
5232
|
-
vue.createVNode(_sfc_main$
|
|
5237
|
+
vue.createVNode(_sfc_main$T, {
|
|
5233
5238
|
class: "m-editor-content",
|
|
5234
5239
|
"init-values": root.value,
|
|
5235
5240
|
options: vue.unref(codeOptions),
|
|
5236
5241
|
onSave: saveCode
|
|
5237
5242
|
}, null, 8, ["init-values", "options"])
|
|
5238
|
-
]) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5243
|
+
]) : (vue.openBlock(), vue.createBlock(_sfc_main$A, {
|
|
5239
5244
|
key: 1,
|
|
5245
|
+
ref_key: "splitView",
|
|
5246
|
+
ref: splitView,
|
|
5240
5247
|
class: "m-editor-content",
|
|
5241
5248
|
"left-class": "m-editor-framework-left",
|
|
5242
5249
|
"center-class": "m-editor-framework-center",
|
|
@@ -5247,6 +5254,7 @@
|
|
|
5247
5254
|
"onUpdate:right": _cache[1] || (_cache[1] = ($event) => columnWidth.value.right = $event),
|
|
5248
5255
|
"min-left": 65,
|
|
5249
5256
|
"min-right": 20,
|
|
5257
|
+
"min-center": 100,
|
|
5250
5258
|
onChange: columnWidthChange
|
|
5251
5259
|
}, vue.createSlots({
|
|
5252
5260
|
left: vue.withCtx(() => [
|
|
@@ -5254,7 +5262,7 @@
|
|
|
5254
5262
|
]),
|
|
5255
5263
|
center: vue.withCtx(() => [
|
|
5256
5264
|
pageLength.value > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
5257
|
-
vue.createVNode(_sfc_main$
|
|
5265
|
+
vue.createVNode(_sfc_main$z)
|
|
5258
5266
|
])
|
|
5259
5267
|
]),
|
|
5260
5268
|
_: 2
|
|
@@ -5279,12 +5287,12 @@
|
|
|
5279
5287
|
}
|
|
5280
5288
|
});
|
|
5281
5289
|
|
|
5282
|
-
const _hoisted_1$
|
|
5290
|
+
const _hoisted_1$k = {
|
|
5283
5291
|
key: 1,
|
|
5284
5292
|
class: "menu-item-text"
|
|
5285
5293
|
};
|
|
5286
5294
|
const _hoisted_2$f = { class: "el-dropdown-link menubar-menu-button" };
|
|
5287
|
-
const _sfc_main$
|
|
5295
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
5288
5296
|
...{
|
|
5289
5297
|
name: "MEditorToolButton"
|
|
5290
5298
|
},
|
|
@@ -5363,7 +5371,7 @@
|
|
|
5363
5371
|
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
5364
5372
|
key: 0,
|
|
5365
5373
|
direction: _ctx.data.direction || "vertical"
|
|
5366
|
-
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5374
|
+
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
5367
5375
|
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
5368
5376
|
key: 0,
|
|
5369
5377
|
effect: "dark",
|
|
@@ -5377,7 +5385,7 @@
|
|
|
5377
5385
|
disabled: disabled.value
|
|
5378
5386
|
}, {
|
|
5379
5387
|
default: vue.withCtx(() => [
|
|
5380
|
-
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5388
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
5381
5389
|
key: 0,
|
|
5382
5390
|
icon: _ctx.data.icon
|
|
5383
5391
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -5395,7 +5403,7 @@
|
|
|
5395
5403
|
title: _ctx.data.text
|
|
5396
5404
|
}, {
|
|
5397
5405
|
default: vue.withCtx(() => [
|
|
5398
|
-
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5406
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
5399
5407
|
key: 0,
|
|
5400
5408
|
icon: _ctx.data.icon
|
|
5401
5409
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -5445,7 +5453,7 @@
|
|
|
5445
5453
|
}
|
|
5446
5454
|
});
|
|
5447
5455
|
|
|
5448
|
-
const _sfc_main$
|
|
5456
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
5449
5457
|
...{
|
|
5450
5458
|
name: "MEditorNavMenu"
|
|
5451
5459
|
},
|
|
@@ -5607,7 +5615,7 @@
|
|
|
5607
5615
|
style: vue.normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
5608
5616
|
}, [
|
|
5609
5617
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(buttons.value[key], (item, index) => {
|
|
5610
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5618
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
5611
5619
|
data: item,
|
|
5612
5620
|
key: index
|
|
5613
5621
|
}, null, 8, ["data"]);
|
|
@@ -5619,8 +5627,8 @@
|
|
|
5619
5627
|
}
|
|
5620
5628
|
});
|
|
5621
5629
|
|
|
5622
|
-
const _hoisted_1$
|
|
5623
|
-
const _sfc_main$
|
|
5630
|
+
const _hoisted_1$j = { class: "m-editor-props-panel" };
|
|
5631
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
5624
5632
|
...{
|
|
5625
5633
|
name: "MEditorPropsPanel"
|
|
5626
5634
|
},
|
|
@@ -5673,7 +5681,7 @@
|
|
|
5673
5681
|
};
|
|
5674
5682
|
__expose({ configForm, submit });
|
|
5675
5683
|
return (_ctx, _cache) => {
|
|
5676
|
-
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5684
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
|
|
5677
5685
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
5678
5686
|
vue.createVNode(vue.unref(form.MForm), {
|
|
5679
5687
|
ref_key: "configForm",
|
|
@@ -5693,7 +5701,7 @@
|
|
|
5693
5701
|
}
|
|
5694
5702
|
});
|
|
5695
5703
|
|
|
5696
|
-
const _sfc_main$
|
|
5704
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
5697
5705
|
...{
|
|
5698
5706
|
name: "MEditorSearchInput"
|
|
5699
5707
|
},
|
|
@@ -5732,7 +5740,7 @@
|
|
|
5732
5740
|
}
|
|
5733
5741
|
});
|
|
5734
5742
|
|
|
5735
|
-
const _hoisted_1$
|
|
5743
|
+
const _hoisted_1$i = { xmlns: "http://www.w3.org/2000/svg" };
|
|
5736
5744
|
const _hoisted_2$e = /* @__PURE__ */ vue.createElementVNode("g", {
|
|
5737
5745
|
fill: "#7C878E",
|
|
5738
5746
|
"fill-rule": "evenodd"
|
|
@@ -5746,19 +5754,19 @@
|
|
|
5746
5754
|
const _hoisted_3$8 = [
|
|
5747
5755
|
_hoisted_2$e
|
|
5748
5756
|
];
|
|
5749
|
-
const _sfc_main$
|
|
5757
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
5750
5758
|
...{
|
|
5751
5759
|
name: "MEditorAppManageIcon"
|
|
5752
5760
|
},
|
|
5753
5761
|
__name: "AppManageIcon",
|
|
5754
5762
|
setup(__props) {
|
|
5755
5763
|
return (_ctx, _cache) => {
|
|
5756
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
5764
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$i, _hoisted_3$8);
|
|
5757
5765
|
};
|
|
5758
5766
|
}
|
|
5759
5767
|
});
|
|
5760
5768
|
|
|
5761
|
-
const _hoisted_1$
|
|
5769
|
+
const _hoisted_1$h = {
|
|
5762
5770
|
viewBox: "0 0 32 32",
|
|
5763
5771
|
version: "1.1",
|
|
5764
5772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5768,25 +5776,25 @@
|
|
|
5768
5776
|
const _hoisted_4$6 = [
|
|
5769
5777
|
_hoisted_2$d
|
|
5770
5778
|
];
|
|
5771
|
-
const _sfc_main$
|
|
5779
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
5772
5780
|
...{
|
|
5773
5781
|
name: "MEditorCodeIcon"
|
|
5774
5782
|
},
|
|
5775
5783
|
__name: "CodeIcon",
|
|
5776
5784
|
setup(__props) {
|
|
5777
5785
|
return (_ctx, _cache) => {
|
|
5778
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
5786
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$h, _hoisted_4$6);
|
|
5779
5787
|
};
|
|
5780
5788
|
}
|
|
5781
5789
|
});
|
|
5782
5790
|
|
|
5783
|
-
const _hoisted_1$
|
|
5791
|
+
const _hoisted_1$g = ["id"];
|
|
5784
5792
|
const _hoisted_2$c = { class: "list-item" };
|
|
5785
5793
|
const _hoisted_3$7 = {
|
|
5786
5794
|
key: 2,
|
|
5787
5795
|
class: "right-tool"
|
|
5788
5796
|
};
|
|
5789
|
-
const _sfc_main$
|
|
5797
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
5790
5798
|
...{
|
|
5791
5799
|
name: "MEditorCodeBlockList"
|
|
5792
5800
|
},
|
|
@@ -5888,11 +5896,11 @@
|
|
|
5888
5896
|
class: "list-container"
|
|
5889
5897
|
}, [
|
|
5890
5898
|
vue.createElementVNode("div", _hoisted_2$c, [
|
|
5891
|
-
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5899
|
+
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$s, {
|
|
5892
5900
|
key: 0,
|
|
5893
5901
|
class: "codeIcon"
|
|
5894
5902
|
})) : vue.createCommentVNode("", true),
|
|
5895
|
-
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5903
|
+
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$t, {
|
|
5896
5904
|
key: 1,
|
|
5897
5905
|
class: "compIcon"
|
|
5898
5906
|
})) : vue.createCommentVNode("", true),
|
|
@@ -5906,7 +5914,7 @@
|
|
|
5906
5914
|
placement: "bottom"
|
|
5907
5915
|
}, {
|
|
5908
5916
|
default: vue.withCtx(() => [
|
|
5909
|
-
vue.createVNode(_sfc_main$
|
|
5917
|
+
vue.createVNode(_sfc_main$N, {
|
|
5910
5918
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
5911
5919
|
class: "edit-icon",
|
|
5912
5920
|
onClick: vue.withModifiers(($event) => editCode(data.id), ["stop"])
|
|
@@ -5921,7 +5929,7 @@
|
|
|
5921
5929
|
placement: "bottom"
|
|
5922
5930
|
}, {
|
|
5923
5931
|
default: vue.withCtx(() => [
|
|
5924
|
-
vue.createVNode(_sfc_main$
|
|
5932
|
+
vue.createVNode(_sfc_main$N, {
|
|
5925
5933
|
icon: vue.unref(iconsVue.Close),
|
|
5926
5934
|
class: "edit-icon",
|
|
5927
5935
|
onClick: vue.withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
|
|
@@ -5935,7 +5943,7 @@
|
|
|
5935
5943
|
})
|
|
5936
5944
|
])) : vue.createCommentVNode("", true)
|
|
5937
5945
|
])
|
|
5938
|
-
], 8, _hoisted_1$
|
|
5946
|
+
], 8, _hoisted_1$g)
|
|
5939
5947
|
]),
|
|
5940
5948
|
_: 3
|
|
5941
5949
|
}, 8, ["default-expanded-keys", "data"]);
|
|
@@ -5943,8 +5951,8 @@
|
|
|
5943
5951
|
}
|
|
5944
5952
|
});
|
|
5945
5953
|
|
|
5946
|
-
const _hoisted_1$
|
|
5947
|
-
const _sfc_main$
|
|
5954
|
+
const _hoisted_1$f = { class: "search-wrapper" };
|
|
5955
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
5948
5956
|
...{
|
|
5949
5957
|
name: "MEditorCodeBlockListPanel"
|
|
5950
5958
|
},
|
|
@@ -5964,8 +5972,8 @@
|
|
|
5964
5972
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
|
|
5965
5973
|
default: vue.withCtx(() => [
|
|
5966
5974
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
5967
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
5968
|
-
vue.createVNode(_sfc_main$
|
|
5975
|
+
vue.createElementVNode("div", _hoisted_1$f, [
|
|
5976
|
+
vue.createVNode(_sfc_main$u, { onSearch: filterTextChangeHandler }),
|
|
5969
5977
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5970
5978
|
key: 0,
|
|
5971
5979
|
class: "create-code-button",
|
|
@@ -5981,7 +5989,7 @@
|
|
|
5981
5989
|
vue.renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
5982
5990
|
])
|
|
5983
5991
|
]),
|
|
5984
|
-
vue.createVNode(_sfc_main$
|
|
5992
|
+
vue.createVNode(_sfc_main$r, {
|
|
5985
5993
|
ref_key: "codeBlockList",
|
|
5986
5994
|
ref: codeBlockList,
|
|
5987
5995
|
"custom-error": _ctx.customError,
|
|
@@ -5996,7 +6004,7 @@
|
|
|
5996
6004
|
]),
|
|
5997
6005
|
_: 3
|
|
5998
6006
|
}, 8, ["custom-error", "onEdit", "onRemove"]),
|
|
5999
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6007
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
6000
6008
|
key: 0,
|
|
6001
6009
|
ref_key: "codeBlockEditor",
|
|
6002
6010
|
ref: codeBlockEditor,
|
|
@@ -6011,7 +6019,7 @@
|
|
|
6011
6019
|
}
|
|
6012
6020
|
});
|
|
6013
6021
|
|
|
6014
|
-
const _sfc_main$
|
|
6022
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
6015
6023
|
...{
|
|
6016
6024
|
name: "MEditorDataSourceConfigPanel"
|
|
6017
6025
|
},
|
|
@@ -6065,13 +6073,13 @@
|
|
|
6065
6073
|
}
|
|
6066
6074
|
});
|
|
6067
6075
|
|
|
6068
|
-
const _hoisted_1$
|
|
6076
|
+
const _hoisted_1$e = ["id"];
|
|
6069
6077
|
const _hoisted_2$b = { class: "list-item" };
|
|
6070
6078
|
const _hoisted_3$6 = {
|
|
6071
6079
|
key: 2,
|
|
6072
6080
|
class: "right-tool"
|
|
6073
6081
|
};
|
|
6074
|
-
const _sfc_main$
|
|
6082
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
6075
6083
|
...{
|
|
6076
6084
|
name: "MEditorDataSourceList"
|
|
6077
6085
|
},
|
|
@@ -6091,25 +6099,25 @@
|
|
|
6091
6099
|
id,
|
|
6092
6100
|
children: getKeyTreeConfig(dep, type)
|
|
6093
6101
|
});
|
|
6102
|
+
const mergeChildren = (children, deps, type) => {
|
|
6103
|
+
Object.entries(deps).forEach(([id, dep]) => {
|
|
6104
|
+
const nodeItem = children.find((item) => item.id === id);
|
|
6105
|
+
if (nodeItem) {
|
|
6106
|
+
nodeItem.children = nodeItem.children.concat(getKeyTreeConfig(dep, type));
|
|
6107
|
+
} else {
|
|
6108
|
+
children.push(getNodeTreeConfig(id, dep, type));
|
|
6109
|
+
}
|
|
6110
|
+
});
|
|
6111
|
+
};
|
|
6094
6112
|
const list = vue.computed(
|
|
6095
6113
|
() => dataSources.value.map((ds) => {
|
|
6096
6114
|
const dsDeps = dsDep.value[ds.id].deps;
|
|
6097
6115
|
const dsMethodDeps = dsMethodDep.value[ds.id].deps;
|
|
6098
6116
|
const dsCondDeps = dsCondDep.value[ds.id].deps;
|
|
6099
6117
|
const children = [];
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
if (nodeItem) {
|
|
6104
|
-
nodeItem.children = nodeItem.children.concat(getKeyTreeConfig(dep, type));
|
|
6105
|
-
} else {
|
|
6106
|
-
children.push(getNodeTreeConfig(id, dep, type));
|
|
6107
|
-
}
|
|
6108
|
-
});
|
|
6109
|
-
};
|
|
6110
|
-
mergeChildren(dsDeps);
|
|
6111
|
-
mergeChildren(dsMethodDeps, "method");
|
|
6112
|
-
mergeChildren(dsCondDeps, "cond");
|
|
6118
|
+
mergeChildren(children, dsDeps);
|
|
6119
|
+
mergeChildren(children, dsMethodDeps, "method");
|
|
6120
|
+
mergeChildren(children, dsCondDeps, "cond");
|
|
6113
6121
|
return {
|
|
6114
6122
|
id: ds.id,
|
|
6115
6123
|
name: ds.title,
|
|
@@ -6167,12 +6175,12 @@
|
|
|
6167
6175
|
class: "list-container"
|
|
6168
6176
|
}, [
|
|
6169
6177
|
vue.createElementVNode("div", _hoisted_2$b, [
|
|
6170
|
-
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6178
|
+
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
6171
6179
|
key: 0,
|
|
6172
6180
|
class: "codeIcon",
|
|
6173
6181
|
icon: vue.unref(iconsVue.Coin)
|
|
6174
6182
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
6175
|
-
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6183
|
+
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
6176
6184
|
key: 1,
|
|
6177
6185
|
class: "compIcon",
|
|
6178
6186
|
icon: vue.unref(iconsVue.Aim)
|
|
@@ -6187,7 +6195,7 @@
|
|
|
6187
6195
|
placement: "bottom"
|
|
6188
6196
|
}, {
|
|
6189
6197
|
default: vue.withCtx(() => [
|
|
6190
|
-
vue.createVNode(_sfc_main$
|
|
6198
|
+
vue.createVNode(_sfc_main$N, {
|
|
6191
6199
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
6192
6200
|
class: "edit-icon",
|
|
6193
6201
|
onClick: vue.withModifiers(($event) => editHandler(`${data.id}`), ["stop"])
|
|
@@ -6202,7 +6210,7 @@
|
|
|
6202
6210
|
placement: "bottom"
|
|
6203
6211
|
}, {
|
|
6204
6212
|
default: vue.withCtx(() => [
|
|
6205
|
-
vue.createVNode(_sfc_main$
|
|
6213
|
+
vue.createVNode(_sfc_main$N, {
|
|
6206
6214
|
icon: vue.unref(iconsVue.Close),
|
|
6207
6215
|
class: "edit-icon",
|
|
6208
6216
|
onClick: vue.withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
|
|
@@ -6210,13 +6218,10 @@
|
|
|
6210
6218
|
]),
|
|
6211
6219
|
_: 2
|
|
6212
6220
|
}, 1024)) : vue.createCommentVNode("", true),
|
|
6213
|
-
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", {
|
|
6214
|
-
id: data.id,
|
|
6215
|
-
data: data.codeBlockContent
|
|
6216
|
-
})
|
|
6221
|
+
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
6217
6222
|
])) : vue.createCommentVNode("", true)
|
|
6218
6223
|
])
|
|
6219
|
-
], 8, _hoisted_1$
|
|
6224
|
+
], 8, _hoisted_1$e)
|
|
6220
6225
|
]),
|
|
6221
6226
|
_: 3
|
|
6222
6227
|
}, 8, ["data"]);
|
|
@@ -6224,9 +6229,9 @@
|
|
|
6224
6229
|
}
|
|
6225
6230
|
});
|
|
6226
6231
|
|
|
6227
|
-
const _hoisted_1$
|
|
6232
|
+
const _hoisted_1$d = { class: "search-wrapper" };
|
|
6228
6233
|
const _hoisted_2$a = { class: "data-source-list-panel-add-menu" };
|
|
6229
|
-
const _sfc_main$
|
|
6234
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
6230
6235
|
...{
|
|
6231
6236
|
name: "MEditorDataSourceListPanel"
|
|
6232
6237
|
},
|
|
@@ -6286,8 +6291,8 @@
|
|
|
6286
6291
|
return (_ctx, _cache) => {
|
|
6287
6292
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-dep-list-panel" }, {
|
|
6288
6293
|
default: vue.withCtx(() => [
|
|
6289
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6290
|
-
vue.createVNode(_sfc_main$
|
|
6294
|
+
vue.createElementVNode("div", _hoisted_1$d, [
|
|
6295
|
+
vue.createVNode(_sfc_main$u, { onSearch: filterTextChangeHandler }),
|
|
6291
6296
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
6292
6297
|
key: 0,
|
|
6293
6298
|
placement: "right"
|
|
@@ -6306,7 +6311,7 @@
|
|
|
6306
6311
|
default: vue.withCtx(() => [
|
|
6307
6312
|
vue.createElementVNode("div", _hoisted_2$a, [
|
|
6308
6313
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(datasourceTypeList.value, (item, index) => {
|
|
6309
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6314
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
6310
6315
|
data: {
|
|
6311
6316
|
type: "button",
|
|
6312
6317
|
text: item.text,
|
|
@@ -6322,11 +6327,16 @@
|
|
|
6322
6327
|
_: 1
|
|
6323
6328
|
})) : vue.createCommentVNode("", true)
|
|
6324
6329
|
]),
|
|
6325
|
-
vue.createVNode(_sfc_main$
|
|
6330
|
+
vue.createVNode(_sfc_main$o, {
|
|
6326
6331
|
onEdit: editHandler,
|
|
6327
6332
|
onRemove: removeHandler
|
|
6333
|
+
}, {
|
|
6334
|
+
"data-source-panel-tool": vue.withCtx(({ data }) => [
|
|
6335
|
+
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
6336
|
+
]),
|
|
6337
|
+
_: 3
|
|
6328
6338
|
}),
|
|
6329
|
-
vue.createVNode(_sfc_main$
|
|
6339
|
+
vue.createVNode(_sfc_main$p, {
|
|
6330
6340
|
ref_key: "editDialog",
|
|
6331
6341
|
ref: editDialog,
|
|
6332
6342
|
disabled: !editable.value,
|
|
@@ -6335,13 +6345,187 @@
|
|
|
6335
6345
|
onSubmit: submitDataSourceHandler
|
|
6336
6346
|
}, null, 8, ["disabled", "values", "title"])
|
|
6337
6347
|
]),
|
|
6338
|
-
_:
|
|
6348
|
+
_: 3
|
|
6349
|
+
});
|
|
6350
|
+
};
|
|
6351
|
+
}
|
|
6352
|
+
});
|
|
6353
|
+
|
|
6354
|
+
const updateStatus = (nodeStatusMap, id, status) => {
|
|
6355
|
+
const nodeStatus = nodeStatusMap.get(id);
|
|
6356
|
+
if (!nodeStatus)
|
|
6357
|
+
return;
|
|
6358
|
+
utils.getKeys(status).forEach((key) => {
|
|
6359
|
+
if (nodeStatus[key] !== void 0 && status[key] !== void 0) {
|
|
6360
|
+
nodeStatus[key] = Boolean(status[key]);
|
|
6361
|
+
}
|
|
6362
|
+
});
|
|
6363
|
+
};
|
|
6364
|
+
|
|
6365
|
+
const _hoisted_1$c = ["draggable", "data-node-id", "data-is-container"];
|
|
6366
|
+
const _hoisted_2$9 = { class: "tree-node-label" };
|
|
6367
|
+
const _hoisted_3$5 = { class: "tree-node-tool" };
|
|
6368
|
+
const _hoisted_4$5 = {
|
|
6369
|
+
key: 0,
|
|
6370
|
+
class: "m-editor-tree-node-children"
|
|
6371
|
+
};
|
|
6372
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
6373
|
+
...{
|
|
6374
|
+
name: "MEditorTreeNode"
|
|
6375
|
+
},
|
|
6376
|
+
__name: "TreeNode",
|
|
6377
|
+
props: {
|
|
6378
|
+
data: {},
|
|
6379
|
+
nodeStatusMap: {},
|
|
6380
|
+
indent: { default: 0 }
|
|
6381
|
+
},
|
|
6382
|
+
emits: ["node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
6383
|
+
setup(__props, { emit }) {
|
|
6384
|
+
const props = __props;
|
|
6385
|
+
const treeEmit = vue.inject("treeEmit");
|
|
6386
|
+
const nodeStatus = vue.computed(
|
|
6387
|
+
() => props.nodeStatusMap?.get(props.data.id) || {
|
|
6388
|
+
selected: false,
|
|
6389
|
+
expand: false,
|
|
6390
|
+
visible: false,
|
|
6391
|
+
draggable: false
|
|
6392
|
+
}
|
|
6393
|
+
);
|
|
6394
|
+
const expanded = vue.computed(() => nodeStatus.value.expand);
|
|
6395
|
+
const selected = vue.computed(() => nodeStatus.value.selected);
|
|
6396
|
+
const visible = vue.computed(() => nodeStatus.value.visible);
|
|
6397
|
+
const draggable = vue.computed(() => nodeStatus.value.draggable);
|
|
6398
|
+
const hasChilren = vue.computed(() => props.data.items && props.data.items.length > 0);
|
|
6399
|
+
const handleDragStart = (event) => {
|
|
6400
|
+
treeEmit?.("node-dragstart", event, props.data);
|
|
6401
|
+
};
|
|
6402
|
+
const handleDragLeave = (event) => {
|
|
6403
|
+
treeEmit?.("node-dragleave", event, props.data);
|
|
6404
|
+
};
|
|
6405
|
+
const handleDragEnd = (event) => {
|
|
6406
|
+
treeEmit?.("node-dragend", event, props.data);
|
|
6407
|
+
};
|
|
6408
|
+
const nodeContentmenuHandler = (event) => {
|
|
6409
|
+
treeEmit?.("node-contextmenu", event, props.data);
|
|
6410
|
+
};
|
|
6411
|
+
const mouseenterHandler = (event) => {
|
|
6412
|
+
treeEmit?.("node-mouseenter", event, props.data);
|
|
6413
|
+
};
|
|
6414
|
+
const expandHandler = () => {
|
|
6415
|
+
updateStatus(props.nodeStatusMap, props.data.id, {
|
|
6416
|
+
expand: !expanded.value
|
|
6339
6417
|
});
|
|
6340
6418
|
};
|
|
6419
|
+
const nodeClickHandler = (event) => {
|
|
6420
|
+
treeEmit?.("node-click", event, props.data);
|
|
6421
|
+
};
|
|
6422
|
+
return (_ctx, _cache) => {
|
|
6423
|
+
const _component_TreeNode = vue.resolveComponent("TreeNode", true);
|
|
6424
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
6425
|
+
class: "m-editor-tree-node",
|
|
6426
|
+
draggable: draggable.value,
|
|
6427
|
+
"data-node-id": _ctx.data.id,
|
|
6428
|
+
"data-is-container": Array.isArray(_ctx.data.items),
|
|
6429
|
+
onDragstart: handleDragStart,
|
|
6430
|
+
onDragleave: handleDragLeave,
|
|
6431
|
+
onDragend: handleDragEnd
|
|
6432
|
+
}, [
|
|
6433
|
+
vue.createElementVNode("div", {
|
|
6434
|
+
class: vue.normalizeClass(["tree-node", { selected: selected.value, expanded: expanded.value }]),
|
|
6435
|
+
style: vue.normalizeStyle(`padding-left: ${_ctx.indent}px`),
|
|
6436
|
+
onContextmenu: nodeContentmenuHandler,
|
|
6437
|
+
onMouseenter: mouseenterHandler
|
|
6438
|
+
}, [
|
|
6439
|
+
vue.createVNode(_sfc_main$N, {
|
|
6440
|
+
class: "expand-icon",
|
|
6441
|
+
style: vue.normalizeStyle(hasChilren.value ? "" : "color: transparent; cursor: default"),
|
|
6442
|
+
icon: expanded.value ? vue.unref(iconsVue.ArrowDown) : vue.unref(iconsVue.ArrowRight),
|
|
6443
|
+
onClick: expandHandler
|
|
6444
|
+
}, null, 8, ["style", "icon"]),
|
|
6445
|
+
vue.createElementVNode("div", {
|
|
6446
|
+
class: "tree-node-content",
|
|
6447
|
+
onClick: nodeClickHandler
|
|
6448
|
+
}, [
|
|
6449
|
+
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
6450
|
+
vue.createElementVNode("div", _hoisted_2$9, vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1),
|
|
6451
|
+
vue.createElementVNode("div", _hoisted_3$5, [
|
|
6452
|
+
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: _ctx.data })
|
|
6453
|
+
])
|
|
6454
|
+
])
|
|
6455
|
+
])
|
|
6456
|
+
], 38),
|
|
6457
|
+
hasChilren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [
|
|
6458
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (item) => {
|
|
6459
|
+
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
6460
|
+
key: item.id,
|
|
6461
|
+
data: item,
|
|
6462
|
+
"node-status-map": _ctx.nodeStatusMap,
|
|
6463
|
+
indent: _ctx.indent + 11
|
|
6464
|
+
}, {
|
|
6465
|
+
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
6466
|
+
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
6467
|
+
]),
|
|
6468
|
+
"tree-node-tool": vue.withCtx(({ data: nodeData }) => [
|
|
6469
|
+
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
6470
|
+
]),
|
|
6471
|
+
_: 2
|
|
6472
|
+
}, 1032, ["data", "node-status-map", "indent"]);
|
|
6473
|
+
}), 128))
|
|
6474
|
+
])) : vue.createCommentVNode("", true)
|
|
6475
|
+
], 40, _hoisted_1$c)), [
|
|
6476
|
+
[vue.vShow, visible.value]
|
|
6477
|
+
]);
|
|
6478
|
+
};
|
|
6341
6479
|
}
|
|
6342
6480
|
});
|
|
6343
6481
|
|
|
6482
|
+
const _hoisted_1$b = { key: 1 };
|
|
6344
6483
|
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
6484
|
+
...{
|
|
6485
|
+
name: "MEditorTree"
|
|
6486
|
+
},
|
|
6487
|
+
__name: "Tree",
|
|
6488
|
+
props: {
|
|
6489
|
+
data: {},
|
|
6490
|
+
nodeStatusMap: {},
|
|
6491
|
+
indent: { default: 0 },
|
|
6492
|
+
emptyText: { default: "暂无数据" }
|
|
6493
|
+
},
|
|
6494
|
+
emits: ["node-dragover", "node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
6495
|
+
setup(__props, { emit }) {
|
|
6496
|
+
vue.provide("treeEmit", emit);
|
|
6497
|
+
const handleDragOver = (event) => {
|
|
6498
|
+
emit("node-dragover", event);
|
|
6499
|
+
};
|
|
6500
|
+
return (_ctx, _cache) => {
|
|
6501
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6502
|
+
class: "m-editor-tree",
|
|
6503
|
+
onDragover: handleDragOver
|
|
6504
|
+
}, [
|
|
6505
|
+
_ctx.data?.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.data, (item) => {
|
|
6506
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
6507
|
+
key: item.id,
|
|
6508
|
+
data: item,
|
|
6509
|
+
indent: _ctx.indent,
|
|
6510
|
+
"node-status-map": _ctx.nodeStatusMap
|
|
6511
|
+
}, {
|
|
6512
|
+
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
6513
|
+
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
6514
|
+
]),
|
|
6515
|
+
"tree-node-tool": vue.withCtx(({ data: nodeData }) => [
|
|
6516
|
+
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
6517
|
+
]),
|
|
6518
|
+
_: 2
|
|
6519
|
+
}, 1032, ["data", "indent", "node-status-map"]);
|
|
6520
|
+
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
6521
|
+
vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
6522
|
+
]))
|
|
6523
|
+
], 32);
|
|
6524
|
+
};
|
|
6525
|
+
}
|
|
6526
|
+
});
|
|
6527
|
+
|
|
6528
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
6345
6529
|
...{
|
|
6346
6530
|
name: "MEditorContentMenu"
|
|
6347
6531
|
},
|
|
@@ -6407,11 +6591,8 @@
|
|
|
6407
6591
|
const show = (e) => {
|
|
6408
6592
|
setTimeout(() => {
|
|
6409
6593
|
visible.value = true;
|
|
6410
|
-
if (!e) {
|
|
6411
|
-
return;
|
|
6412
|
-
}
|
|
6413
6594
|
vue.nextTick(() => {
|
|
6414
|
-
setPosition(e);
|
|
6595
|
+
e && setPosition(e);
|
|
6415
6596
|
emit("show");
|
|
6416
6597
|
});
|
|
6417
6598
|
}, 300);
|
|
@@ -6474,7 +6655,7 @@
|
|
|
6474
6655
|
vue.renderSlot(_ctx.$slots, "title"),
|
|
6475
6656
|
vue.createElementVNode("div", null, [
|
|
6476
6657
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuData, (item, index) => {
|
|
6477
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6658
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
6478
6659
|
"event-type": "mouseup",
|
|
6479
6660
|
ref_for: true,
|
|
6480
6661
|
ref_key: "buttons",
|
|
@@ -6509,7 +6690,7 @@
|
|
|
6509
6690
|
}
|
|
6510
6691
|
});
|
|
6511
6692
|
|
|
6512
|
-
const _hoisted_1$
|
|
6693
|
+
const _hoisted_1$a = {
|
|
6513
6694
|
width: "1em",
|
|
6514
6695
|
height: "1em",
|
|
6515
6696
|
viewBox: "0 0 16 16",
|
|
@@ -6517,26 +6698,26 @@
|
|
|
6517
6698
|
fill: "currentColor",
|
|
6518
6699
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6519
6700
|
};
|
|
6520
|
-
const _hoisted_2$
|
|
6701
|
+
const _hoisted_2$8 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
6521
6702
|
"fill-rule": "evenodd",
|
|
6522
6703
|
d: "M9.828 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H9.828zm-2.95-1.707L7.587 3H2.19c-.24 0-.47.042-.684.12L1.5 2.98a1 1 0 0 1 1-.98h3.672a1 1 0 0 1 .707.293z"
|
|
6523
6704
|
}, null, -1);
|
|
6524
|
-
const _hoisted_3$
|
|
6705
|
+
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
6525
6706
|
"fill-rule": "evenodd",
|
|
6526
6707
|
d: "M11 11.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5z"
|
|
6527
6708
|
}, null, -1);
|
|
6528
|
-
const _hoisted_4$
|
|
6529
|
-
_hoisted_2$
|
|
6530
|
-
_hoisted_3$
|
|
6709
|
+
const _hoisted_4$4 = [
|
|
6710
|
+
_hoisted_2$8,
|
|
6711
|
+
_hoisted_3$4
|
|
6531
6712
|
];
|
|
6532
|
-
const _sfc_main$
|
|
6713
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
6533
6714
|
...{
|
|
6534
6715
|
name: "MEditorFolderMinusIcon"
|
|
6535
6716
|
},
|
|
6536
6717
|
__name: "FolderMinusIcon",
|
|
6537
6718
|
setup(__props) {
|
|
6538
6719
|
return (_ctx, _cache) => {
|
|
6539
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
6720
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$a, _hoisted_4$4);
|
|
6540
6721
|
};
|
|
6541
6722
|
}
|
|
6542
6723
|
});
|
|
@@ -6616,7 +6797,7 @@
|
|
|
6616
6797
|
};
|
|
6617
6798
|
};
|
|
6618
6799
|
|
|
6619
|
-
const _sfc_main$
|
|
6800
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
6620
6801
|
...{
|
|
6621
6802
|
name: "MEditorLayerMenu"
|
|
6622
6803
|
},
|
|
@@ -6679,7 +6860,7 @@
|
|
|
6679
6860
|
{
|
|
6680
6861
|
type: "button",
|
|
6681
6862
|
text: "全部折叠",
|
|
6682
|
-
icon: _sfc_main$
|
|
6863
|
+
icon: _sfc_main$j,
|
|
6683
6864
|
display: () => utils.isPage(node.value),
|
|
6684
6865
|
handler: () => {
|
|
6685
6866
|
emit("collapse-all");
|
|
@@ -6705,7 +6886,7 @@
|
|
|
6705
6886
|
show
|
|
6706
6887
|
});
|
|
6707
6888
|
return (_ctx, _cache) => {
|
|
6708
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6889
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$k, {
|
|
6709
6890
|
"menu-data": menuData.value,
|
|
6710
6891
|
ref_key: "menu",
|
|
6711
6892
|
ref: menu,
|
|
@@ -6715,7 +6896,7 @@
|
|
|
6715
6896
|
}
|
|
6716
6897
|
});
|
|
6717
6898
|
|
|
6718
|
-
const _sfc_main$
|
|
6899
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
6719
6900
|
__name: "LayerNodeTool",
|
|
6720
6901
|
props: {
|
|
6721
6902
|
data: {}
|
|
@@ -6734,12 +6915,12 @@
|
|
|
6734
6915
|
};
|
|
6735
6916
|
return (_ctx, _cache) => {
|
|
6736
6917
|
return _ctx.data.type !== "page" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
6737
|
-
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6918
|
+
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
6738
6919
|
key: 0,
|
|
6739
6920
|
icon: vue.unref(iconsVue.Hide),
|
|
6740
6921
|
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => setNodeVisible(true), ["stop"])),
|
|
6741
6922
|
title: "点击显示"
|
|
6742
|
-
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6923
|
+
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
6743
6924
|
key: 1,
|
|
6744
6925
|
icon: vue.unref(iconsVue.View),
|
|
6745
6926
|
onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => setNodeVisible(false), ["stop"])),
|
|
@@ -6751,6 +6932,75 @@
|
|
|
6751
6932
|
}
|
|
6752
6933
|
});
|
|
6753
6934
|
|
|
6935
|
+
const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
|
|
6936
|
+
const select = async (data) => {
|
|
6937
|
+
if (!data.id) {
|
|
6938
|
+
throw new Error("没有id");
|
|
6939
|
+
}
|
|
6940
|
+
if (isCtrlKeyDown.value) {
|
|
6941
|
+
multiSelect(data);
|
|
6942
|
+
} else {
|
|
6943
|
+
await services?.editorService.select(data);
|
|
6944
|
+
services?.editorService.get("stage")?.select(data.id);
|
|
6945
|
+
}
|
|
6946
|
+
};
|
|
6947
|
+
const multiSelect = async (data) => {
|
|
6948
|
+
const nodes = services?.editorService.get("nodes") || [];
|
|
6949
|
+
const newNodes = [];
|
|
6950
|
+
let isCancel = false;
|
|
6951
|
+
nodes.forEach((node) => {
|
|
6952
|
+
if (node.id === data.id) {
|
|
6953
|
+
isCancel = true;
|
|
6954
|
+
return;
|
|
6955
|
+
}
|
|
6956
|
+
newNodes.push(node.id);
|
|
6957
|
+
});
|
|
6958
|
+
if (!isCancel || newNodes.length === 0) {
|
|
6959
|
+
newNodes.push(data.id);
|
|
6960
|
+
}
|
|
6961
|
+
await services?.editorService.multiSelect(newNodes);
|
|
6962
|
+
services?.editorService.get("stage")?.multiSelect(newNodes);
|
|
6963
|
+
};
|
|
6964
|
+
const throttleTime = 300;
|
|
6965
|
+
const highlightHandler = lodashEs.throttle((event, data) => {
|
|
6966
|
+
highlight(data);
|
|
6967
|
+
}, throttleTime);
|
|
6968
|
+
const highlight = (data) => {
|
|
6969
|
+
services?.editorService?.highlight(data);
|
|
6970
|
+
services?.editorService?.get("stage")?.highlight(data.id);
|
|
6971
|
+
};
|
|
6972
|
+
const nodeClickHandler = (event, data) => {
|
|
6973
|
+
if (!nodeStatusMap?.value)
|
|
6974
|
+
return;
|
|
6975
|
+
if (services?.uiService.get("uiSelectMode")) {
|
|
6976
|
+
document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: data }));
|
|
6977
|
+
return;
|
|
6978
|
+
}
|
|
6979
|
+
if (data.items && data.items.length > 0 && !isCtrlKeyDown.value) {
|
|
6980
|
+
updateStatus(nodeStatusMap.value, data.id, {
|
|
6981
|
+
expand: true
|
|
6982
|
+
});
|
|
6983
|
+
}
|
|
6984
|
+
vue.nextTick(() => {
|
|
6985
|
+
select(data);
|
|
6986
|
+
});
|
|
6987
|
+
};
|
|
6988
|
+
const menu = vue.ref();
|
|
6989
|
+
return {
|
|
6990
|
+
menu,
|
|
6991
|
+
nodeClickHandler,
|
|
6992
|
+
nodeContentmenuHandler(event, data) {
|
|
6993
|
+
event.preventDefault();
|
|
6994
|
+
const nodes = services?.editorService.get("nodes") || [];
|
|
6995
|
+
if (nodes.length < 2 || !nodes.includes(data)) {
|
|
6996
|
+
nodeClickHandler(event, data);
|
|
6997
|
+
}
|
|
6998
|
+
menu.value?.show(event);
|
|
6999
|
+
},
|
|
7000
|
+
highlightHandler
|
|
7001
|
+
};
|
|
7002
|
+
};
|
|
7003
|
+
|
|
6754
7004
|
const dragState = {
|
|
6755
7005
|
dragOverNodeId: "",
|
|
6756
7006
|
dropType: "",
|
|
@@ -6795,7 +7045,7 @@
|
|
|
6795
7045
|
if (!event.target)
|
|
6796
7046
|
return;
|
|
6797
7047
|
const targetEl = getNodeEl(event.target);
|
|
6798
|
-
if (!targetEl)
|
|
7048
|
+
if (!targetEl?.draggable)
|
|
6799
7049
|
return;
|
|
6800
7050
|
const labelEl = targetEl.children[0];
|
|
6801
7051
|
if (!labelEl)
|
|
@@ -6869,16 +7119,6 @@
|
|
|
6869
7119
|
};
|
|
6870
7120
|
};
|
|
6871
7121
|
|
|
6872
|
-
const updateStatus = (nodeStatusMap, id, status) => {
|
|
6873
|
-
const nodeStatus = nodeStatusMap.get(id);
|
|
6874
|
-
if (!nodeStatus)
|
|
6875
|
-
return;
|
|
6876
|
-
utils.getKeys(status).forEach((key) => {
|
|
6877
|
-
if (nodeStatus[key] !== void 0 && status[key] !== void 0) {
|
|
6878
|
-
nodeStatus[key] = Boolean(status[key]);
|
|
6879
|
-
}
|
|
6880
|
-
});
|
|
6881
|
-
};
|
|
6882
7122
|
const useFilter = (nodeStatusMap, page) => {
|
|
6883
7123
|
const filterIsMatch = (value, data) => {
|
|
6884
7124
|
if (!value) {
|
|
@@ -6923,179 +7163,6 @@
|
|
|
6923
7163
|
};
|
|
6924
7164
|
};
|
|
6925
7165
|
|
|
6926
|
-
const _hoisted_1$a = ["draggable", "data-node-id", "data-is-container"];
|
|
6927
|
-
const _hoisted_2$8 = { class: "layer-node-label" };
|
|
6928
|
-
const _hoisted_3$4 = { class: "layer-node-tool" };
|
|
6929
|
-
const _hoisted_4$4 = {
|
|
6930
|
-
key: 0,
|
|
6931
|
-
class: "magic-editor-layer-node-children"
|
|
6932
|
-
};
|
|
6933
|
-
const throttleTime = 300;
|
|
6934
|
-
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
6935
|
-
...{
|
|
6936
|
-
name: "MEditorLayerNode"
|
|
6937
|
-
},
|
|
6938
|
-
__name: "LayerNode",
|
|
6939
|
-
props: {
|
|
6940
|
-
data: {},
|
|
6941
|
-
parent: {},
|
|
6942
|
-
indent: { default: 0 },
|
|
6943
|
-
filterText: { default: "" },
|
|
6944
|
-
isCtrlKeyDown: { type: Boolean, default: false }
|
|
6945
|
-
},
|
|
6946
|
-
emits: ["node-contextmenu"],
|
|
6947
|
-
setup(__props, { emit }) {
|
|
6948
|
-
const props = __props;
|
|
6949
|
-
const services = vue.inject("services");
|
|
6950
|
-
const nodeStatusMap = vue.inject("nodeStatusMap");
|
|
6951
|
-
const editorService = services?.editorService;
|
|
6952
|
-
const uiService = services?.uiService;
|
|
6953
|
-
const nodeStatus = vue.computed(
|
|
6954
|
-
() => nodeStatusMap?.value?.get(props.data.id) || {
|
|
6955
|
-
selected: false,
|
|
6956
|
-
expand: false,
|
|
6957
|
-
visible: false
|
|
6958
|
-
}
|
|
6959
|
-
);
|
|
6960
|
-
const expanded = vue.computed(() => nodeStatus.value.expand);
|
|
6961
|
-
const selected = vue.computed(() => nodeStatus.value.selected);
|
|
6962
|
-
const visible = vue.computed(() => nodeStatus.value.visible);
|
|
6963
|
-
const hasChilren = vue.computed(() => props.data.items?.length > 0);
|
|
6964
|
-
const nodeEl = vue.ref();
|
|
6965
|
-
const { handleDragStart, handleDragEnd, handleDragLeave } = useDrag(services);
|
|
6966
|
-
const expandHandler = () => {
|
|
6967
|
-
if (!nodeStatusMap?.value)
|
|
6968
|
-
return;
|
|
6969
|
-
updateStatus(nodeStatusMap.value, props.data.id, {
|
|
6970
|
-
expand: !expanded.value
|
|
6971
|
-
});
|
|
6972
|
-
};
|
|
6973
|
-
const nodeClickHandler = () => {
|
|
6974
|
-
if (!nodeStatusMap?.value)
|
|
6975
|
-
return;
|
|
6976
|
-
if (uiService?.get("uiSelectMode")) {
|
|
6977
|
-
document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: props.data }));
|
|
6978
|
-
return;
|
|
6979
|
-
}
|
|
6980
|
-
if (hasChilren.value && !props.isCtrlKeyDown) {
|
|
6981
|
-
updateStatus(nodeStatusMap.value, props.data.id, {
|
|
6982
|
-
expand: true
|
|
6983
|
-
});
|
|
6984
|
-
}
|
|
6985
|
-
vue.nextTick(() => {
|
|
6986
|
-
select(props.data);
|
|
6987
|
-
});
|
|
6988
|
-
};
|
|
6989
|
-
const contextmenuHandler = (event) => {
|
|
6990
|
-
event.preventDefault();
|
|
6991
|
-
const nodes = editorService?.get("nodes") || [];
|
|
6992
|
-
if (nodes.length < 2 || !nodes.includes(props.data)) {
|
|
6993
|
-
nodeClickHandler();
|
|
6994
|
-
}
|
|
6995
|
-
emit("node-contextmenu", event, props.data);
|
|
6996
|
-
};
|
|
6997
|
-
const nodeContentmenuHandler = (event, node) => {
|
|
6998
|
-
emit("node-contextmenu", event, node);
|
|
6999
|
-
};
|
|
7000
|
-
const select = async (data) => {
|
|
7001
|
-
if (!data.id) {
|
|
7002
|
-
throw new Error("没有id");
|
|
7003
|
-
}
|
|
7004
|
-
if (props.isCtrlKeyDown) {
|
|
7005
|
-
multiSelect(data);
|
|
7006
|
-
} else {
|
|
7007
|
-
await editorService?.select(data);
|
|
7008
|
-
editorService?.get("stage")?.select(data.id);
|
|
7009
|
-
}
|
|
7010
|
-
};
|
|
7011
|
-
const multiSelect = async (data) => {
|
|
7012
|
-
const nodes = editorService?.get("nodes") || [];
|
|
7013
|
-
const newNodes = [];
|
|
7014
|
-
let isCancel = false;
|
|
7015
|
-
nodes.forEach((node) => {
|
|
7016
|
-
if (node.id === data.id) {
|
|
7017
|
-
isCancel = true;
|
|
7018
|
-
return;
|
|
7019
|
-
}
|
|
7020
|
-
newNodes.push(node.id);
|
|
7021
|
-
});
|
|
7022
|
-
if (!isCancel || newNodes.length === 0) {
|
|
7023
|
-
newNodes.push(data.id);
|
|
7024
|
-
}
|
|
7025
|
-
await editorService?.multiSelect(newNodes);
|
|
7026
|
-
editorService?.get("stage")?.multiSelect(newNodes);
|
|
7027
|
-
};
|
|
7028
|
-
const highlightHandler = lodashEs.throttle(() => {
|
|
7029
|
-
highlight();
|
|
7030
|
-
}, throttleTime);
|
|
7031
|
-
const highlight = () => {
|
|
7032
|
-
editorService?.highlight(props.data);
|
|
7033
|
-
editorService?.get("stage")?.highlight(props.data.id);
|
|
7034
|
-
};
|
|
7035
|
-
return (_ctx, _cache) => {
|
|
7036
|
-
const _component_LayerNode = vue.resolveComponent("LayerNode", true);
|
|
7037
|
-
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
7038
|
-
class: "magic-editor-layer-node",
|
|
7039
|
-
ref_key: "nodeEl",
|
|
7040
|
-
ref: nodeEl,
|
|
7041
|
-
draggable: !vue.unref(utils.isPage)(_ctx.data),
|
|
7042
|
-
"data-node-id": _ctx.data.id,
|
|
7043
|
-
"data-is-container": Array.isArray(_ctx.data.items),
|
|
7044
|
-
onDragstart: _cache[1] || (_cache[1] = //@ts-ignore
|
|
7045
|
-
(...args) => vue.unref(handleDragStart) && vue.unref(handleDragStart)(...args)),
|
|
7046
|
-
onDragleave: _cache[2] || (_cache[2] = //@ts-ignore
|
|
7047
|
-
(...args) => vue.unref(handleDragLeave) && vue.unref(handleDragLeave)(...args)),
|
|
7048
|
-
onDragend: _cache[3] || (_cache[3] = ($event) => vue.unref(handleDragEnd)($event, _ctx.data))
|
|
7049
|
-
}, [
|
|
7050
|
-
vue.createElementVNode("div", {
|
|
7051
|
-
class: vue.normalizeClass(["layer-node", { selected: selected.value, expanded: expanded.value }]),
|
|
7052
|
-
style: vue.normalizeStyle(`padding-left: ${_ctx.indent}px`),
|
|
7053
|
-
onContextmenu: contextmenuHandler,
|
|
7054
|
-
onMouseenter: _cache[0] || (_cache[0] = ($event) => vue.unref(highlightHandler)())
|
|
7055
|
-
}, [
|
|
7056
|
-
vue.createVNode(_sfc_main$M, {
|
|
7057
|
-
class: "expand-icon",
|
|
7058
|
-
style: vue.normalizeStyle(hasChilren.value ? "" : "color: transparent; cursor: default"),
|
|
7059
|
-
icon: expanded.value ? vue.unref(iconsVue.ArrowDown) : vue.unref(iconsVue.ArrowRight),
|
|
7060
|
-
onClick: expandHandler
|
|
7061
|
-
}, null, 8, ["style", "icon"]),
|
|
7062
|
-
vue.createElementVNode("div", {
|
|
7063
|
-
class: "layer-node-content",
|
|
7064
|
-
onClick: nodeClickHandler
|
|
7065
|
-
}, [
|
|
7066
|
-
vue.renderSlot(_ctx.$slots, "layer-node-content", { data: _ctx.data }, () => [
|
|
7067
|
-
vue.createElementVNode("div", _hoisted_2$8, vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1),
|
|
7068
|
-
vue.createElementVNode("div", _hoisted_3$4, [
|
|
7069
|
-
vue.createVNode(_sfc_main$i, { data: _ctx.data }, null, 8, ["data"])
|
|
7070
|
-
])
|
|
7071
|
-
])
|
|
7072
|
-
])
|
|
7073
|
-
], 38),
|
|
7074
|
-
hasChilren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [
|
|
7075
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (item) => {
|
|
7076
|
-
return vue.openBlock(), vue.createBlock(_component_LayerNode, {
|
|
7077
|
-
data: item,
|
|
7078
|
-
parent: _ctx.data,
|
|
7079
|
-
key: item.id,
|
|
7080
|
-
indent: _ctx.indent + 11,
|
|
7081
|
-
"filter-text": _ctx.filterText,
|
|
7082
|
-
"is-ctrl-key-down": _ctx.isCtrlKeyDown,
|
|
7083
|
-
onNodeContextmenu: nodeContentmenuHandler
|
|
7084
|
-
}, {
|
|
7085
|
-
"layer-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
7086
|
-
vue.renderSlot(_ctx.$slots, "layer-node-content", { data: nodeData })
|
|
7087
|
-
]),
|
|
7088
|
-
_: 2
|
|
7089
|
-
}, 1032, ["data", "parent", "indent", "filter-text", "is-ctrl-key-down"]);
|
|
7090
|
-
}), 128))
|
|
7091
|
-
])) : vue.createCommentVNode("", true)
|
|
7092
|
-
], 40, _hoisted_1$a)), [
|
|
7093
|
-
[vue.vShow, visible.value]
|
|
7094
|
-
]);
|
|
7095
|
-
};
|
|
7096
|
-
}
|
|
7097
|
-
});
|
|
7098
|
-
|
|
7099
7166
|
var KeyBindingContainerKey = /* @__PURE__ */ ((KeyBindingContainerKey2) => {
|
|
7100
7167
|
KeyBindingContainerKey2["STAGE"] = "stage";
|
|
7101
7168
|
KeyBindingContainerKey2["LAYER_PANEL"] = "layer-panel";
|
|
@@ -7247,7 +7314,7 @@
|
|
|
7247
7314
|
vue.watchEffect(() => {
|
|
7248
7315
|
if (contianer.value) {
|
|
7249
7316
|
globalThis.addEventListener("blur", windowBlurHandler);
|
|
7250
|
-
keybindingService?.registeEl(KeyBindingContainerKey.LAYER_PANEL, contianer.value);
|
|
7317
|
+
keybindingService?.registeEl(KeyBindingContainerKey.LAYER_PANEL, contianer.value.$el);
|
|
7251
7318
|
} else {
|
|
7252
7319
|
globalThis.removeEventListener("blur", windowBlurHandler);
|
|
7253
7320
|
keybindingService?.unregisteEl(KeyBindingContainerKey.LAYER_PANEL);
|
|
@@ -7263,14 +7330,16 @@
|
|
|
7263
7330
|
map.set(pageId, {
|
|
7264
7331
|
visible: true,
|
|
7265
7332
|
expand: true,
|
|
7266
|
-
selected: true
|
|
7333
|
+
selected: true,
|
|
7334
|
+
draggable: false
|
|
7267
7335
|
});
|
|
7268
7336
|
services?.editorService.getNodeById(pageId)?.items.forEach(
|
|
7269
7337
|
(node) => traverseNode(node, (node2) => {
|
|
7270
7338
|
map.set(node2.id, {
|
|
7271
7339
|
visible: true,
|
|
7272
7340
|
expand: false,
|
|
7273
|
-
selected: false
|
|
7341
|
+
selected: false,
|
|
7342
|
+
draggable: true
|
|
7274
7343
|
});
|
|
7275
7344
|
})
|
|
7276
7345
|
);
|
|
@@ -7320,7 +7389,8 @@
|
|
|
7320
7389
|
nodeStatusMap.value?.set(node2.id, {
|
|
7321
7390
|
visible: true,
|
|
7322
7391
|
expand: Array.isArray(node2.items),
|
|
7323
|
-
selected: true
|
|
7392
|
+
selected: true,
|
|
7393
|
+
draggable: true
|
|
7324
7394
|
});
|
|
7325
7395
|
});
|
|
7326
7396
|
});
|
|
@@ -7349,13 +7419,11 @@
|
|
|
7349
7419
|
setup(__props) {
|
|
7350
7420
|
const services = vue.inject("services");
|
|
7351
7421
|
const editorService = services?.editorService;
|
|
7352
|
-
const
|
|
7422
|
+
const tree = vue.ref();
|
|
7353
7423
|
const page = vue.computed(() => editorService?.get("page"));
|
|
7354
|
-
const root = vue.computed(() => editorService?.get("root"));
|
|
7355
7424
|
const { nodeStatusMap } = useNodeStatus(services, page);
|
|
7356
|
-
const { isCtrlKeyDown } = useKeybinding(services,
|
|
7357
|
-
|
|
7358
|
-
const { filterText, filterTextChangeHandler } = useFilter(nodeStatusMap, page);
|
|
7425
|
+
const { isCtrlKeyDown } = useKeybinding(services, tree);
|
|
7426
|
+
const { filterTextChangeHandler } = useFilter(nodeStatusMap, page);
|
|
7359
7427
|
const collapseAllHandler = () => {
|
|
7360
7428
|
if (!page.value || !nodeStatusMap.value)
|
|
7361
7429
|
return;
|
|
@@ -7367,40 +7435,45 @@
|
|
|
7367
7435
|
status.expand = false;
|
|
7368
7436
|
}
|
|
7369
7437
|
};
|
|
7370
|
-
const
|
|
7371
|
-
const
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7438
|
+
const { handleDragStart, handleDragEnd, handleDragLeave, handleDragOver } = useDrag(services);
|
|
7439
|
+
const {
|
|
7440
|
+
menu,
|
|
7441
|
+
nodeClickHandler,
|
|
7442
|
+
nodeContentmenuHandler,
|
|
7443
|
+
highlightHandler: mouseenterHandler
|
|
7444
|
+
} = useClick(services, isCtrlKeyDown, nodeStatusMap);
|
|
7376
7445
|
return (_ctx, _cache) => {
|
|
7377
|
-
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "
|
|
7446
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
7378
7447
|
default: vue.withCtx(() => [
|
|
7379
7448
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
7380
|
-
vue.createVNode(_sfc_main$
|
|
7381
|
-
vue.
|
|
7382
|
-
|
|
7383
|
-
ref_key: "layerTreeContainer",
|
|
7384
|
-
ref: layerTreeContainer,
|
|
7449
|
+
vue.createVNode(_sfc_main$u, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
7450
|
+
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
|
|
7451
|
+
key: 0,
|
|
7385
7452
|
tabindex: "-1",
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7453
|
+
ref_key: "tree",
|
|
7454
|
+
ref: tree,
|
|
7455
|
+
data: [page.value],
|
|
7456
|
+
"node-status-map": vue.unref(nodeStatusMap),
|
|
7457
|
+
onNodeDragover: vue.unref(handleDragOver),
|
|
7458
|
+
onNodeDragstart: vue.unref(handleDragStart),
|
|
7459
|
+
onNodeDragleave: vue.unref(handleDragLeave),
|
|
7460
|
+
onNodeDragend: vue.unref(handleDragEnd),
|
|
7461
|
+
onNodeContextmenu: vue.unref(nodeContentmenuHandler),
|
|
7462
|
+
onNodeMouseenter: vue.unref(mouseenterHandler),
|
|
7463
|
+
onNodeClick: vue.unref(nodeClickHandler)
|
|
7464
|
+
}, {
|
|
7465
|
+
"tree-node-tool": vue.withCtx(({ data: nodeData }) => [
|
|
7466
|
+
vue.renderSlot(_ctx.$slots, "layer-node-tool", { data: nodeData }, () => [
|
|
7467
|
+
vue.createVNode(_sfc_main$h, { data: nodeData }, null, 8, ["data"])
|
|
7468
|
+
])
|
|
7469
|
+
]),
|
|
7470
|
+
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
7471
|
+
vue.renderSlot(_ctx.$slots, "layer-node-content", { data: nodeData })
|
|
7472
|
+
]),
|
|
7473
|
+
_: 3
|
|
7474
|
+
}, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
7402
7475
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
7403
|
-
vue.createVNode(_sfc_main$
|
|
7476
|
+
vue.createVNode(_sfc_main$i, {
|
|
7404
7477
|
ref_key: "menu",
|
|
7405
7478
|
ref: menu,
|
|
7406
7479
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
@@ -7496,7 +7569,7 @@
|
|
|
7496
7569
|
"model-value": collapseValue.value
|
|
7497
7570
|
}, {
|
|
7498
7571
|
default: vue.withCtx(() => [
|
|
7499
|
-
vue.createVNode(_sfc_main$
|
|
7572
|
+
vue.createVNode(_sfc_main$u, { onSearch: filterTextChangeHandler }),
|
|
7500
7573
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
7501
7574
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
7502
7575
|
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
@@ -7504,7 +7577,7 @@
|
|
|
7504
7577
|
name: `${index}`
|
|
7505
7578
|
}, {
|
|
7506
7579
|
title: vue.withCtx(() => [
|
|
7507
|
-
vue.createVNode(_sfc_main$
|
|
7580
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
|
|
7508
7581
|
vue.createTextVNode(vue.toDisplayString(group.title), 1)
|
|
7509
7582
|
]),
|
|
7510
7583
|
default: vue.withCtx(() => [
|
|
@@ -7525,7 +7598,7 @@
|
|
|
7525
7598
|
content: item.desc
|
|
7526
7599
|
}, {
|
|
7527
7600
|
default: vue.withCtx(() => [
|
|
7528
|
-
vue.createVNode(_sfc_main$
|
|
7601
|
+
vue.createVNode(_sfc_main$N, {
|
|
7529
7602
|
icon: item.icon
|
|
7530
7603
|
}, null, 8, ["icon"])
|
|
7531
7604
|
]),
|
|
@@ -7600,7 +7673,7 @@
|
|
|
7600
7673
|
type: "component",
|
|
7601
7674
|
icon: iconsVue.EditPen,
|
|
7602
7675
|
text: "代码编辑",
|
|
7603
|
-
component: _sfc_main$
|
|
7676
|
+
component: _sfc_main$q,
|
|
7604
7677
|
slots: {}
|
|
7605
7678
|
},
|
|
7606
7679
|
"data-source": {
|
|
@@ -7608,7 +7681,7 @@
|
|
|
7608
7681
|
type: "component",
|
|
7609
7682
|
icon: iconsVue.Coin,
|
|
7610
7683
|
text: "数据源",
|
|
7611
|
-
component: _sfc_main$
|
|
7684
|
+
component: _sfc_main$n,
|
|
7612
7685
|
slots: {}
|
|
7613
7686
|
}
|
|
7614
7687
|
};
|
|
@@ -7633,7 +7706,7 @@
|
|
|
7633
7706
|
key: config.$key ?? index,
|
|
7634
7707
|
onClick: ($event) => activeTabName.value = config.text || `${index}`
|
|
7635
7708
|
}, [
|
|
7636
|
-
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7709
|
+
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
7637
7710
|
key: 0,
|
|
7638
7711
|
icon: config.icon
|
|
7639
7712
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -7704,6 +7777,29 @@
|
|
|
7704
7777
|
}, null, 8, ["data"])) : vue.createCommentVNode("", true)
|
|
7705
7778
|
]),
|
|
7706
7779
|
key: "5"
|
|
7780
|
+
} : void 0,
|
|
7781
|
+
config.$key === "layer" || config.slots?.layerNodeTool ? {
|
|
7782
|
+
name: "layer-node-tool",
|
|
7783
|
+
fn: vue.withCtx(({ data: nodeData }) => [
|
|
7784
|
+
config.$key === "layer" ? vue.renderSlot(_ctx.$slots, "layer-node-tool", {
|
|
7785
|
+
key: 0,
|
|
7786
|
+
data: nodeData
|
|
7787
|
+
}) : config.slots?.layerNodeTool ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.layerNodeTool), {
|
|
7788
|
+
key: 1,
|
|
7789
|
+
data: nodeData
|
|
7790
|
+
}, null, 8, ["data"])) : vue.createCommentVNode("", true)
|
|
7791
|
+
]),
|
|
7792
|
+
key: "6"
|
|
7793
|
+
} : void 0,
|
|
7794
|
+
config.$key === "data-source" || config.slots?.codeBlockPanelTool ? {
|
|
7795
|
+
name: "data-source-panel-tool",
|
|
7796
|
+
fn: vue.withCtx(({ data }) => [
|
|
7797
|
+
config.$key === "data-source" ? vue.renderSlot(_ctx.$slots, "data-source-panel-tool", {
|
|
7798
|
+
key: 0,
|
|
7799
|
+
data
|
|
7800
|
+
}) : config.slots?.DataSourcePanelTool ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.DataSourcePanelTool), { key: 1 })) : vue.createCommentVNode("", true)
|
|
7801
|
+
]),
|
|
7802
|
+
key: "7"
|
|
7707
7803
|
} : void 0
|
|
7708
7804
|
]), 1040)) : vue.createCommentVNode("", true)
|
|
7709
7805
|
])), [
|
|
@@ -8331,7 +8427,7 @@
|
|
|
8331
8427
|
content: _ctx.pinned ? "取消置于顶层自动隐藏" : "置于顶层不消失"
|
|
8332
8428
|
}, {
|
|
8333
8429
|
default: vue.withCtx(() => [
|
|
8334
|
-
vue.createVNode(_sfc_main$
|
|
8430
|
+
vue.createVNode(_sfc_main$N, {
|
|
8335
8431
|
style: { "margin-left": "10px", "cursor": "pointer" },
|
|
8336
8432
|
icon: _ctx.pinned ? _sfc_main$a : _sfc_main$b,
|
|
8337
8433
|
onClick: pinHandler
|
|
@@ -8347,7 +8443,7 @@
|
|
|
8347
8443
|
onClick: closeHandler
|
|
8348
8444
|
}, {
|
|
8349
8445
|
default: vue.withCtx(() => [
|
|
8350
|
-
vue.createVNode(_sfc_main$
|
|
8446
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Close) }, null, 8, ["icon"])
|
|
8351
8447
|
]),
|
|
8352
8448
|
_: 1
|
|
8353
8449
|
})
|
|
@@ -8357,6 +8453,7 @@
|
|
|
8357
8453
|
}
|
|
8358
8454
|
});
|
|
8359
8455
|
|
|
8456
|
+
const PINNED_STATUE_CACHE_KEY = "tmagic-pinned-node-list-pinned-status";
|
|
8360
8457
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
8361
8458
|
__name: "NodeListMenu",
|
|
8362
8459
|
props: {
|
|
@@ -8366,7 +8463,8 @@
|
|
|
8366
8463
|
const props = __props;
|
|
8367
8464
|
const menu = vue.ref();
|
|
8368
8465
|
const nodeList = vue.ref([]);
|
|
8369
|
-
const pinned = vue.ref(
|
|
8466
|
+
const pinned = vue.ref(Boolean(globalThis.localStorage.getItem(PINNED_STATUE_CACHE_KEY)));
|
|
8467
|
+
const firstShow = vue.ref(true);
|
|
8370
8468
|
const services = vue.inject("services");
|
|
8371
8469
|
const editorService = services?.editorService;
|
|
8372
8470
|
const componentListService = services?.componentListService;
|
|
@@ -8415,7 +8513,8 @@
|
|
|
8415
8513
|
}
|
|
8416
8514
|
nodeList.value = nodes;
|
|
8417
8515
|
if (nodeList.value.length > 1) {
|
|
8418
|
-
menu.value?.show(pinned.value ? void 0 : event);
|
|
8516
|
+
menu.value?.show(pinned.value && !firstShow.value ? void 0 : event);
|
|
8517
|
+
firstShow.value = false;
|
|
8419
8518
|
}
|
|
8420
8519
|
}, 1500);
|
|
8421
8520
|
});
|
|
@@ -8473,8 +8572,11 @@
|
|
|
8473
8572
|
const closeHandler = () => {
|
|
8474
8573
|
menu.value?.hide();
|
|
8475
8574
|
};
|
|
8575
|
+
vue.watch(pinned, () => {
|
|
8576
|
+
globalThis.localStorage.setItem(PINNED_STATUE_CACHE_KEY, pinned.value.toString());
|
|
8577
|
+
});
|
|
8476
8578
|
return (_ctx, _cache) => {
|
|
8477
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8579
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$k, {
|
|
8478
8580
|
ref_key: "menu",
|
|
8479
8581
|
ref: menu,
|
|
8480
8582
|
class: "magic-editor-node-list-menu",
|
|
@@ -8660,7 +8762,7 @@
|
|
|
8660
8762
|
};
|
|
8661
8763
|
__expose({ show });
|
|
8662
8764
|
return (_ctx, _cache) => {
|
|
8663
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8765
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$k, {
|
|
8664
8766
|
"menu-data": menuData.value,
|
|
8665
8767
|
ref_key: "menu",
|
|
8666
8768
|
ref: menu
|
|
@@ -8993,14 +9095,14 @@
|
|
|
8993
9095
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
8994
9096
|
onClick: addPage
|
|
8995
9097
|
}, [
|
|
8996
|
-
vue.createVNode(_sfc_main$
|
|
9098
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
8997
9099
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2)),
|
|
8998
9100
|
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
8999
9101
|
key: 2,
|
|
9000
9102
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9001
9103
|
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
9002
9104
|
}, [
|
|
9003
|
-
vue.createVNode(_sfc_main$
|
|
9105
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
9004
9106
|
])) : vue.createCommentVNode("", true),
|
|
9005
9107
|
pageLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9006
9108
|
key: 3,
|
|
@@ -9016,7 +9118,7 @@
|
|
|
9016
9118
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9017
9119
|
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
9018
9120
|
}, [
|
|
9019
|
-
vue.createVNode(_sfc_main$
|
|
9121
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
9020
9122
|
])) : vue.createCommentVNode("", true)
|
|
9021
9123
|
], 512);
|
|
9022
9124
|
};
|
|
@@ -9088,7 +9190,7 @@
|
|
|
9088
9190
|
default: vue.withCtx(() => [
|
|
9089
9191
|
vue.createElementVNode("div", null, [
|
|
9090
9192
|
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
9091
|
-
vue.createVNode(_sfc_main$
|
|
9193
|
+
vue.createVNode(_sfc_main$x, {
|
|
9092
9194
|
data: {
|
|
9093
9195
|
type: "button",
|
|
9094
9196
|
text: "复制",
|
|
@@ -9096,7 +9198,7 @@
|
|
|
9096
9198
|
handler: () => copy(item)
|
|
9097
9199
|
}
|
|
9098
9200
|
}, null, 8, ["data"]),
|
|
9099
|
-
vue.createVNode(_sfc_main$
|
|
9201
|
+
vue.createVNode(_sfc_main$x, {
|
|
9100
9202
|
data: {
|
|
9101
9203
|
type: "button",
|
|
9102
9204
|
text: "删除",
|
|
@@ -9586,7 +9688,7 @@
|
|
|
9586
9688
|
const doCollect = (key, value) => {
|
|
9587
9689
|
const keyIsItems = key === "items";
|
|
9588
9690
|
const fullKey = prop ? `${prop}.${key}` : key;
|
|
9589
|
-
if (target.isTarget(
|
|
9691
|
+
if (target.isTarget(fullKey, value)) {
|
|
9590
9692
|
target.updateDep(node, fullKey);
|
|
9591
9693
|
this.emit("update-dep", node, fullKey);
|
|
9592
9694
|
} else if (!keyIsItems && Array.isArray(value)) {
|
|
@@ -9874,7 +9976,12 @@
|
|
|
9874
9976
|
const createDataSourceCondTarget = (id) => new Target({
|
|
9875
9977
|
type: DepTargetType.DATA_SOURCE_COND,
|
|
9876
9978
|
id,
|
|
9877
|
-
isTarget: (key, value) =>
|
|
9979
|
+
isTarget: (key, value) => {
|
|
9980
|
+
if (!Array.isArray(value) || value[0] !== id || !`${key}`.startsWith("displayConds"))
|
|
9981
|
+
return false;
|
|
9982
|
+
const ds = dataSourceService.getDataSourceById(id);
|
|
9983
|
+
return Boolean(ds?.fields?.find((field) => field.name === value[1]));
|
|
9984
|
+
}
|
|
9878
9985
|
});
|
|
9879
9986
|
const createDataSourceMethodTarget = (id) => new Target({
|
|
9880
9987
|
type: DepTargetType.DATA_SOURCE_METHOD,
|
|
@@ -10273,13 +10380,13 @@
|
|
|
10273
10380
|
);
|
|
10274
10381
|
__expose(services);
|
|
10275
10382
|
return (_ctx, _cache) => {
|
|
10276
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
10383
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$y, null, {
|
|
10277
10384
|
header: vue.withCtx(() => [
|
|
10278
10385
|
vue.renderSlot(_ctx.$slots, "header")
|
|
10279
10386
|
]),
|
|
10280
10387
|
nav: vue.withCtx(() => [
|
|
10281
10388
|
vue.renderSlot(_ctx.$slots, "nav", { editorService: vue.unref(editorService) }, () => [
|
|
10282
|
-
vue.createVNode(_sfc_main$
|
|
10389
|
+
vue.createVNode(_sfc_main$w, { data: _ctx.menu }, null, 8, ["data"])
|
|
10283
10390
|
])
|
|
10284
10391
|
]),
|
|
10285
10392
|
"content-before": vue.withCtx(() => [
|
|
@@ -10300,6 +10407,9 @@
|
|
|
10300
10407
|
"layer-node-content": vue.withCtx(({ data }) => [
|
|
10301
10408
|
vue.renderSlot(_ctx.$slots, "layer-node-content", { data })
|
|
10302
10409
|
]),
|
|
10410
|
+
"layer-node-tool": vue.withCtx(({ data }) => [
|
|
10411
|
+
vue.renderSlot(_ctx.$slots, "layer-node-tool", { data })
|
|
10412
|
+
]),
|
|
10303
10413
|
"component-list-panel-header": vue.withCtx(() => [
|
|
10304
10414
|
vue.renderSlot(_ctx.$slots, "component-list-panel-header")
|
|
10305
10415
|
]),
|
|
@@ -10315,6 +10425,9 @@
|
|
|
10315
10425
|
data
|
|
10316
10426
|
})
|
|
10317
10427
|
]),
|
|
10428
|
+
"data-source-panel-tool": vue.withCtx(({ data }) => [
|
|
10429
|
+
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
10430
|
+
]),
|
|
10318
10431
|
_: 3
|
|
10319
10432
|
}, 8, ["data", "layer-content-menu"])
|
|
10320
10433
|
])
|
|
@@ -10340,7 +10453,7 @@
|
|
|
10340
10453
|
]),
|
|
10341
10454
|
"props-panel": vue.withCtx(() => [
|
|
10342
10455
|
vue.renderSlot(_ctx.$slots, "props-panel", {}, () => [
|
|
10343
|
-
vue.createVNode(_sfc_main$
|
|
10456
|
+
vue.createVNode(_sfc_main$v, {
|
|
10344
10457
|
"extend-state": _ctx.extendFormState,
|
|
10345
10458
|
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
|
|
10346
10459
|
}, {
|
|
@@ -10378,61 +10491,61 @@
|
|
|
10378
10491
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
10379
10492
|
setConfig(option);
|
|
10380
10493
|
app.component(_sfc_main.name, _sfc_main);
|
|
10381
|
-
app.component("m-fields-ui-select", _sfc_main$
|
|
10382
|
-
app.component("m-fields-code-link", _sfc_main$
|
|
10383
|
-
app.component("m-fields-vs-code", _sfc_main$
|
|
10384
|
-
app.component("magic-code-editor", _sfc_main$
|
|
10385
|
-
app.component("m-fields-code-select", _sfc_main$
|
|
10386
|
-
app.component("m-fields-code-select-col", _sfc_main$
|
|
10387
|
-
app.component("m-fields-event-select", _sfc_main$
|
|
10388
|
-
app.component("m-fields-data-source-fields", _sfc_main$
|
|
10389
|
-
app.component("m-fields-data-source-mocks", _sfc_main$
|
|
10390
|
-
app.component("m-fields-key-value", _sfc_main$
|
|
10391
|
-
app.component("m-fields-data-source-input", _sfc_main$
|
|
10392
|
-
app.component("m-fields-data-source-select", _sfc_main$
|
|
10393
|
-
app.component("m-fields-data-source-methods", _sfc_main$
|
|
10394
|
-
app.component("m-fields-data-source-method-select", _sfc_main$
|
|
10395
|
-
app.component("m-fields-data-source-field-select", _sfc_main$
|
|
10494
|
+
app.component("m-fields-ui-select", _sfc_main$C);
|
|
10495
|
+
app.component("m-fields-code-link", _sfc_main$R);
|
|
10496
|
+
app.component("m-fields-vs-code", _sfc_main$S);
|
|
10497
|
+
app.component("magic-code-editor", _sfc_main$T);
|
|
10498
|
+
app.component("m-fields-code-select", _sfc_main$Q);
|
|
10499
|
+
app.component("m-fields-code-select-col", _sfc_main$M);
|
|
10500
|
+
app.component("m-fields-event-select", _sfc_main$E);
|
|
10501
|
+
app.component("m-fields-data-source-fields", _sfc_main$L);
|
|
10502
|
+
app.component("m-fields-data-source-mocks", _sfc_main$G);
|
|
10503
|
+
app.component("m-fields-key-value", _sfc_main$D);
|
|
10504
|
+
app.component("m-fields-data-source-input", _sfc_main$J);
|
|
10505
|
+
app.component("m-fields-data-source-select", _sfc_main$F);
|
|
10506
|
+
app.component("m-fields-data-source-methods", _sfc_main$I);
|
|
10507
|
+
app.component("m-fields-data-source-method-select", _sfc_main$H);
|
|
10508
|
+
app.component("m-fields-data-source-field-select", _sfc_main$K);
|
|
10396
10509
|
}
|
|
10397
10510
|
};
|
|
10398
10511
|
|
|
10399
10512
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
10400
10513
|
exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
|
|
10401
|
-
exports.CodeBlockEditor = _sfc_main$
|
|
10402
|
-
exports.CodeBlockList = _sfc_main$
|
|
10403
|
-
exports.CodeBlockListPanel = _sfc_main$
|
|
10514
|
+
exports.CodeBlockEditor = _sfc_main$P;
|
|
10515
|
+
exports.CodeBlockList = _sfc_main$r;
|
|
10516
|
+
exports.CodeBlockListPanel = _sfc_main$q;
|
|
10404
10517
|
exports.CodeDeleteErrorType = CodeDeleteErrorType;
|
|
10405
|
-
exports.CodeSelect = _sfc_main$
|
|
10406
|
-
exports.CodeSelectCol = _sfc_main$
|
|
10518
|
+
exports.CodeSelect = _sfc_main$Q;
|
|
10519
|
+
exports.CodeSelectCol = _sfc_main$M;
|
|
10407
10520
|
exports.ColumnLayout = ColumnLayout;
|
|
10408
10521
|
exports.ComponentListPanel = _sfc_main$f;
|
|
10409
|
-
exports.ContentMenu = _sfc_main$
|
|
10410
|
-
exports.DataSourceFieldSelect = _sfc_main$
|
|
10411
|
-
exports.DataSourceFields = _sfc_main$
|
|
10412
|
-
exports.DataSourceInput = _sfc_main$
|
|
10413
|
-
exports.DataSourceMethodSelect = _sfc_main$
|
|
10414
|
-
exports.DataSourceMethods = _sfc_main$
|
|
10415
|
-
exports.DataSourceMocks = _sfc_main$
|
|
10416
|
-
exports.DataSourceSelect = _sfc_main$
|
|
10522
|
+
exports.ContentMenu = _sfc_main$k;
|
|
10523
|
+
exports.DataSourceFieldSelect = _sfc_main$K;
|
|
10524
|
+
exports.DataSourceFields = _sfc_main$L;
|
|
10525
|
+
exports.DataSourceInput = _sfc_main$J;
|
|
10526
|
+
exports.DataSourceMethodSelect = _sfc_main$H;
|
|
10527
|
+
exports.DataSourceMethods = _sfc_main$I;
|
|
10528
|
+
exports.DataSourceMocks = _sfc_main$G;
|
|
10529
|
+
exports.DataSourceSelect = _sfc_main$F;
|
|
10417
10530
|
exports.DepTargetType = DepTargetType;
|
|
10418
10531
|
exports.DragType = DragType;
|
|
10419
|
-
exports.EventSelect = _sfc_main$
|
|
10532
|
+
exports.EventSelect = _sfc_main$E;
|
|
10420
10533
|
exports.Fixed2Other = Fixed2Other;
|
|
10421
10534
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
10422
|
-
exports.Icon = _sfc_main$
|
|
10535
|
+
exports.Icon = _sfc_main$N;
|
|
10423
10536
|
exports.KeyBindingCommand = KeyBindingCommand;
|
|
10424
|
-
exports.KeyValue = _sfc_main$
|
|
10537
|
+
exports.KeyValue = _sfc_main$D;
|
|
10425
10538
|
exports.Keys = Keys;
|
|
10426
10539
|
exports.LayerOffset = LayerOffset;
|
|
10427
10540
|
exports.LayerPanel = _sfc_main$g;
|
|
10428
10541
|
exports.Layout = Layout;
|
|
10429
|
-
exports.LayoutContainer = _sfc_main$
|
|
10430
|
-
exports.PropsPanel = _sfc_main$
|
|
10431
|
-
exports.Resizer = _sfc_main$
|
|
10432
|
-
exports.SplitView = _sfc_main$
|
|
10433
|
-
exports.TMagicCodeEditor = _sfc_main$
|
|
10542
|
+
exports.LayoutContainer = _sfc_main$A;
|
|
10543
|
+
exports.PropsPanel = _sfc_main$v;
|
|
10544
|
+
exports.Resizer = _sfc_main$B;
|
|
10545
|
+
exports.SplitView = _sfc_main$A;
|
|
10546
|
+
exports.TMagicCodeEditor = _sfc_main$T;
|
|
10434
10547
|
exports.TMagicEditor = _sfc_main;
|
|
10435
|
-
exports.ToolButton = _sfc_main$
|
|
10548
|
+
exports.ToolButton = _sfc_main$x;
|
|
10436
10549
|
exports.UI_SELECT_MODE_EVENT_NAME = UI_SELECT_MODE_EVENT_NAME;
|
|
10437
10550
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
10438
10551
|
exports.advancedTabConfig = advancedTabConfig;
|