@tmagic/editor 1.3.4 → 1.3.6
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 +73 -51
- package/dist/tmagic-editor.js +1171 -1102
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +1188 -1119
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +17 -17
- package/src/Editor.vue +5 -0
- package/src/components/FloatingBox.vue +117 -0
- package/src/components/Tree.vue +5 -0
- package/src/components/TreeNode.vue +8 -2
- package/src/editorProps.ts +7 -0
- package/src/hooks/use-filter.ts +55 -0
- package/src/hooks/use-node-status.ts +48 -0
- package/src/hooks/use-stage.ts +1 -0
- package/src/initService.ts +28 -12
- package/src/layouts/sidebar/Sidebar.vue +7 -2
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +55 -65
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +2 -1
- package/src/layouts/sidebar/data-source/DataSourceList.vue +63 -59
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +1 -1
- package/src/layouts/sidebar/layer/LayerPanel.vue +24 -7
- package/src/layouts/sidebar/layer/use-node-status.ts +8 -11
- package/src/layouts/workspace/viewer/NodeListMenu.vue +67 -128
- package/src/layouts/workspace/viewer/Stage.vue +2 -1
- package/src/layouts/workspace/viewer/ViewerMenu.vue +1 -6
- package/src/services/BaseService.ts +63 -26
- package/src/services/codeBlock.ts +7 -1
- package/src/services/dep.ts +12 -8
- package/src/services/editor.ts +66 -30
- package/src/services/props.ts +70 -12
- package/src/services/storage.ts +23 -13
- package/src/services/ui.ts +4 -1
- package/src/theme/floating-box.scss +30 -0
- package/src/theme/layer-panel.scss +19 -0
- package/src/theme/stage.scss +24 -0
- package/src/theme/theme.scss +1 -1
- package/src/theme/tree.scss +12 -1
- package/src/type.ts +6 -3
- package/src/utils/compose.ts +25 -6
- package/src/utils/content-menu.ts +4 -5
- package/src/utils/editor.ts +12 -3
- package/src/utils/operator.ts +1 -2
- package/types/components/CodeBlockEditor.vue.d.ts +6 -2
- package/types/components/CodeParams.vue.d.ts +3 -1
- package/types/components/ContentMenu.vue.d.ts +13 -5
- package/types/components/FloatingBox.vue.d.ts +78 -0
- package/types/components/Resizer.vue.d.ts +6 -1
- package/types/components/ScrollBar.vue.d.ts +3 -1
- package/types/components/ScrollViewer.vue.d.ts +3 -3
- package/types/components/SearchInput.vue.d.ts +3 -1
- package/types/components/SplitView.vue.d.ts +8 -4
- package/types/components/ToolButton.vue.d.ts +1 -1
- package/types/components/Tree.vue.d.ts +27 -8
- package/types/components/TreeNode.vue.d.ts +24 -7
- package/types/editorProps.d.ts +7 -1
- package/types/fields/Code.vue.d.ts +6 -2
- package/types/fields/CodeLink.vue.d.ts +5 -3
- package/types/fields/CodeSelect.vue.d.ts +3 -1
- package/types/fields/CodeSelectCol.vue.d.ts +3 -1
- package/types/fields/DataSourceFieldSelect.vue.d.ts +3 -1
- package/types/fields/DataSourceFields.vue.d.ts +5 -3
- package/types/fields/DataSourceInput.vue.d.ts +8 -4
- package/types/fields/DataSourceMethodSelect.vue.d.ts +3 -1
- package/types/fields/DataSourceMethods.vue.d.ts +5 -3
- package/types/fields/DataSourceMocks.vue.d.ts +5 -3
- package/types/fields/DataSourceSelect.vue.d.ts +5 -3
- package/types/fields/EventSelect.vue.d.ts +3 -1
- package/types/fields/KeyValue.vue.d.ts +2 -2
- package/types/fields/UISelect.vue.d.ts +3 -1
- package/types/hooks/use-code-block-edit.d.ts +14 -5
- package/types/hooks/use-data-source-method.d.ts +14 -5
- package/types/hooks/use-filter.d.ts +7 -0
- package/types/hooks/use-node-status.d.ts +6 -0
- package/types/layouts/CodeEditor.vue.d.ts +4 -1
- package/types/layouts/Framework.vue.d.ts +1 -1
- package/types/layouts/PropsPanel.vue.d.ts +10 -4
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/Sidebar.vue.d.ts +5 -5
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +9 -3
- package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +3 -1
- package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +8 -2
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +6 -2
- package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/layer/use-click.d.ts +14 -5
- package/types/layouts/sidebar/layer/use-node-status.d.ts +3 -4
- package/types/layouts/workspace/Workspace.vue.d.ts +1 -1
- package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +1 -14
- package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +1 -1
- package/types/services/BaseService.d.ts +4 -1
- package/types/services/dep.d.ts +6 -5
- package/types/services/editor.d.ts +9 -3
- package/types/services/props.d.ts +25 -1
- package/types/services/storage.d.ts +7 -7
- package/types/type.d.ts +8 -6
- package/types/utils/compose.d.ts +1 -1
- package/types/utils/editor.d.ts +5 -1
- package/src/layouts/sidebar/layer/use-filter.ts +0 -59
- package/src/layouts/workspace/viewer/NodeListMenuTitle.vue +0 -68
- package/src/theme/dep-list.scss +0 -59
- package/types/layouts/sidebar/layer/use-filter.d.ts +0 -7
- package/types/layouts/workspace/viewer/NodeListMenuTitle.vue.d.ts +0 -15
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
};
|
|
30
30
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
31
31
|
|
|
32
|
-
const _hoisted_1$
|
|
32
|
+
const _hoisted_1$s = {
|
|
33
33
|
class: /* @__PURE__ */ vue.normalizeClass(`magic-code-editor`)
|
|
34
34
|
};
|
|
35
|
-
const _sfc_main$
|
|
35
|
+
const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
36
36
|
...{
|
|
37
37
|
name: "MEditorCodeEditor"
|
|
38
38
|
},
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
return (_ctx, _cache) => {
|
|
193
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
193
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$s, [
|
|
194
194
|
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
195
195
|
to: "body",
|
|
196
196
|
disabled: !fullScreen.value
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
|
|
221
|
-
const _sfc_main$
|
|
221
|
+
const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
222
222
|
...{
|
|
223
223
|
name: "MEditorCode"
|
|
224
224
|
},
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
emit("change", v);
|
|
244
244
|
};
|
|
245
245
|
return (_ctx, _cache) => {
|
|
246
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
246
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$Q, {
|
|
247
247
|
height: _ctx.config.height,
|
|
248
248
|
"init-values": _ctx.model[_ctx.name],
|
|
249
249
|
language: _ctx.config.language,
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
-
const _sfc_main$
|
|
261
|
+
const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
|
|
262
262
|
...{
|
|
263
263
|
name: "MEditorCodeLink"
|
|
264
264
|
},
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
|
|
341
|
-
const _sfc_main$
|
|
341
|
+
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
342
342
|
...{
|
|
343
343
|
name: "MEditorCodeSelect"
|
|
344
344
|
},
|
|
@@ -411,11 +411,11 @@
|
|
|
411
411
|
}
|
|
412
412
|
});
|
|
413
413
|
|
|
414
|
-
const _hoisted_1$
|
|
415
|
-
const _hoisted_2$
|
|
416
|
-
const _hoisted_3$
|
|
417
|
-
const _hoisted_4$
|
|
418
|
-
const _sfc_main$
|
|
414
|
+
const _hoisted_1$r = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
415
|
+
const _hoisted_2$j = { style: { "flex": "1" } };
|
|
416
|
+
const _hoisted_3$7 = { style: { "flex": "1" } };
|
|
417
|
+
const _hoisted_4$5 = { class: "dialog-footer" };
|
|
418
|
+
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
419
419
|
...{
|
|
420
420
|
name: "MEditorCodeBlockEditor"
|
|
421
421
|
},
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
fullscreen: ""
|
|
637
637
|
}, {
|
|
638
638
|
footer: vue.withCtx(() => [
|
|
639
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
639
|
+
vue.createElementVNode("span", _hoisted_4$5, [
|
|
640
640
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
641
641
|
size: "small",
|
|
642
642
|
onClick: _cache[1] || (_cache[1] = ($event) => difVisible.value = false)
|
|
@@ -659,8 +659,8 @@
|
|
|
659
659
|
])
|
|
660
660
|
]),
|
|
661
661
|
default: vue.withCtx(() => [
|
|
662
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
663
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
662
|
+
vue.createElementVNode("div", _hoisted_1$r, [
|
|
663
|
+
vue.createElementVNode("div", _hoisted_2$j, [
|
|
664
664
|
vue.createVNode(vue.unref(design.TMagicTag), {
|
|
665
665
|
size: "small",
|
|
666
666
|
type: "info"
|
|
@@ -671,7 +671,7 @@
|
|
|
671
671
|
_: 1
|
|
672
672
|
})
|
|
673
673
|
]),
|
|
674
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
674
|
+
vue.createElementVNode("div", _hoisted_3$7, [
|
|
675
675
|
vue.createVNode(vue.unref(design.TMagicTag), {
|
|
676
676
|
size: "small",
|
|
677
677
|
type: "success"
|
|
@@ -683,7 +683,7 @@
|
|
|
683
683
|
})
|
|
684
684
|
])
|
|
685
685
|
]),
|
|
686
|
-
difVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
686
|
+
difVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$Q, {
|
|
687
687
|
key: 0,
|
|
688
688
|
ref_key: "magicVsEditor",
|
|
689
689
|
ref: magicVsEditor,
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
return displayState;
|
|
970
970
|
};
|
|
971
971
|
|
|
972
|
-
const compose = (middleware) => {
|
|
972
|
+
const compose = (middleware, isAsync) => {
|
|
973
973
|
if (!Array.isArray(middleware))
|
|
974
974
|
throw new TypeError("Middleware 必须是一个数组!");
|
|
975
975
|
for (const fn of middleware) {
|
|
@@ -980,18 +980,34 @@
|
|
|
980
980
|
let index = -1;
|
|
981
981
|
return dispatch(0);
|
|
982
982
|
function dispatch(i) {
|
|
983
|
-
if (i <= index)
|
|
984
|
-
|
|
983
|
+
if (i <= index) {
|
|
984
|
+
const error = new Error("next() 被多次调用");
|
|
985
|
+
if (isAsync) {
|
|
986
|
+
return Promise.reject(error);
|
|
987
|
+
}
|
|
988
|
+
throw error;
|
|
989
|
+
}
|
|
985
990
|
index = i;
|
|
986
991
|
let fn = middleware[i];
|
|
987
992
|
if (i === middleware.length && next)
|
|
988
993
|
fn = next;
|
|
989
|
-
if (!fn)
|
|
990
|
-
|
|
994
|
+
if (!fn) {
|
|
995
|
+
if (isAsync) {
|
|
996
|
+
return Promise.resolve();
|
|
997
|
+
}
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
if (isAsync) {
|
|
1001
|
+
try {
|
|
1002
|
+
return Promise.resolve(fn(...args, dispatch.bind(null, i + 1)));
|
|
1003
|
+
} catch (err) {
|
|
1004
|
+
return Promise.reject(err);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
991
1007
|
try {
|
|
992
|
-
return
|
|
1008
|
+
return fn(...args, dispatch.bind(null, i + 1));
|
|
993
1009
|
} catch (err) {
|
|
994
|
-
|
|
1010
|
+
throw err;
|
|
995
1011
|
}
|
|
996
1012
|
}
|
|
997
1013
|
};
|
|
@@ -999,7 +1015,29 @@
|
|
|
999
1015
|
|
|
1000
1016
|
const methodName = (prefix, name) => `${prefix}${name[0].toUpperCase()}${name.substring(1)}`;
|
|
1001
1017
|
const isError = (error) => Object.prototype.toString.call(error) === "[object Error]";
|
|
1002
|
-
const doAction =
|
|
1018
|
+
const doAction = (args, scope, sourceMethod, beforeMethodName, afterMethodName, fn) => {
|
|
1019
|
+
try {
|
|
1020
|
+
let beforeArgs = args;
|
|
1021
|
+
for (const beforeMethod of scope.pluginOptionsList[beforeMethodName]) {
|
|
1022
|
+
beforeArgs = beforeMethod(...beforeArgs) || [];
|
|
1023
|
+
if (isError(beforeArgs))
|
|
1024
|
+
throw beforeArgs;
|
|
1025
|
+
if (!Array.isArray(beforeArgs)) {
|
|
1026
|
+
beforeArgs = [beforeArgs];
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
let returnValue = fn(beforeArgs, sourceMethod.bind(scope));
|
|
1030
|
+
for (const afterMethod of scope.pluginOptionsList[afterMethodName]) {
|
|
1031
|
+
returnValue = afterMethod(returnValue, ...beforeArgs);
|
|
1032
|
+
if (isError(returnValue))
|
|
1033
|
+
throw returnValue;
|
|
1034
|
+
}
|
|
1035
|
+
return returnValue;
|
|
1036
|
+
} catch (error) {
|
|
1037
|
+
throw error;
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
const doAsyncAction = async (args, scope, sourceMethod, beforeMethodName, afterMethodName, fn) => {
|
|
1003
1041
|
try {
|
|
1004
1042
|
let beforeArgs = args;
|
|
1005
1043
|
for (const beforeMethod of scope.pluginOptionsList[beforeMethodName]) {
|
|
@@ -1028,7 +1066,7 @@
|
|
|
1028
1066
|
doingTask = false;
|
|
1029
1067
|
constructor(methods = [], serialMethods = []) {
|
|
1030
1068
|
super();
|
|
1031
|
-
methods.forEach((propertyName) => {
|
|
1069
|
+
methods.forEach(({ name: propertyName, isAsync }) => {
|
|
1032
1070
|
const scope = this;
|
|
1033
1071
|
const sourceMethod = scope[propertyName];
|
|
1034
1072
|
const beforeMethodName = methodName("before", propertyName);
|
|
@@ -1036,16 +1074,16 @@
|
|
|
1036
1074
|
this.pluginOptionsList[beforeMethodName] = [];
|
|
1037
1075
|
this.pluginOptionsList[afterMethodName] = [];
|
|
1038
1076
|
this.middleware[propertyName] = [];
|
|
1039
|
-
const fn = compose(this.middleware[propertyName]);
|
|
1077
|
+
const fn = compose(this.middleware[propertyName], isAsync);
|
|
1040
1078
|
Object.defineProperty(scope, propertyName, {
|
|
1041
|
-
value: async (...args) => {
|
|
1079
|
+
value: isAsync ? async (...args) => {
|
|
1042
1080
|
if (!serialMethods.includes(propertyName)) {
|
|
1043
|
-
return
|
|
1081
|
+
return doAsyncAction(args, scope, sourceMethod, beforeMethodName, afterMethodName, fn);
|
|
1044
1082
|
}
|
|
1045
1083
|
const promise = new Promise((resolve, reject) => {
|
|
1046
1084
|
this.taskList.push(async () => {
|
|
1047
1085
|
try {
|
|
1048
|
-
const value = await
|
|
1086
|
+
const value = await doAsyncAction(args, scope, sourceMethod, beforeMethodName, afterMethodName, fn);
|
|
1049
1087
|
resolve(value);
|
|
1050
1088
|
} catch (e) {
|
|
1051
1089
|
reject(e);
|
|
@@ -1056,7 +1094,7 @@
|
|
|
1056
1094
|
this.doTask();
|
|
1057
1095
|
}
|
|
1058
1096
|
return promise;
|
|
1059
|
-
}
|
|
1097
|
+
} : (...args) => doAction(args, scope, sourceMethod, beforeMethodName, afterMethodName, fn)
|
|
1060
1098
|
});
|
|
1061
1099
|
});
|
|
1062
1100
|
}
|
|
@@ -1743,11 +1781,50 @@
|
|
|
1743
1781
|
if (node.items?.length) {
|
|
1744
1782
|
parents.push(node);
|
|
1745
1783
|
node.items.forEach((item) => {
|
|
1746
|
-
traverseNode(item, cb, parents);
|
|
1784
|
+
traverseNode(item, cb, [...parents]);
|
|
1747
1785
|
});
|
|
1748
1786
|
}
|
|
1749
1787
|
};
|
|
1750
1788
|
|
|
1789
|
+
class Dep extends BaseService {
|
|
1790
|
+
watcher = new dep.Watcher({ initialTargets: vue.reactive({}) });
|
|
1791
|
+
removeTargets(type = dep.DepTargetType.DEFAULT) {
|
|
1792
|
+
this.watcher.removeTargets(type);
|
|
1793
|
+
this.emit("remove-target");
|
|
1794
|
+
}
|
|
1795
|
+
getTargets(type = dep.DepTargetType.DEFAULT) {
|
|
1796
|
+
return this.watcher.getTargets(type);
|
|
1797
|
+
}
|
|
1798
|
+
getTarget(id, type = dep.DepTargetType.DEFAULT) {
|
|
1799
|
+
return this.watcher.getTarget(id, type);
|
|
1800
|
+
}
|
|
1801
|
+
addTarget(target) {
|
|
1802
|
+
this.watcher.addTarget(target);
|
|
1803
|
+
this.emit("add-target", target);
|
|
1804
|
+
}
|
|
1805
|
+
removeTarget(id, type = dep.DepTargetType.DEFAULT) {
|
|
1806
|
+
this.watcher.removeTarget(id, type);
|
|
1807
|
+
this.emit("remove-target");
|
|
1808
|
+
}
|
|
1809
|
+
clearTargets() {
|
|
1810
|
+
this.watcher.clearTargets();
|
|
1811
|
+
}
|
|
1812
|
+
collect(nodes, deep = false, type) {
|
|
1813
|
+
this.watcher.collect(nodes, deep, type);
|
|
1814
|
+
this.emit("collected", nodes, deep);
|
|
1815
|
+
}
|
|
1816
|
+
clear(nodes) {
|
|
1817
|
+
return this.watcher.clear(nodes);
|
|
1818
|
+
}
|
|
1819
|
+
hasTarget(id, type = dep.DepTargetType.DEFAULT) {
|
|
1820
|
+
return this.watcher.hasTarget(id, type);
|
|
1821
|
+
}
|
|
1822
|
+
hasSpecifiedTypeTarget(type = dep.DepTargetType.DEFAULT) {
|
|
1823
|
+
return this.watcher.hasSpecifiedTypeTarget(type);
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
const depService = new Dep();
|
|
1827
|
+
|
|
1751
1828
|
class UndoRedo {
|
|
1752
1829
|
elementList;
|
|
1753
1830
|
listCursor;
|
|
@@ -1889,7 +1966,14 @@
|
|
|
1889
1966
|
storage = globalThis.localStorage;
|
|
1890
1967
|
namespace = "tmagic";
|
|
1891
1968
|
constructor() {
|
|
1892
|
-
super([
|
|
1969
|
+
super([
|
|
1970
|
+
{ name: "getStorage", isAsync: false },
|
|
1971
|
+
{ name: "getNamespace", isAsync: false },
|
|
1972
|
+
{ name: "clear", isAsync: false },
|
|
1973
|
+
{ name: "getItem", isAsync: false },
|
|
1974
|
+
{ name: "removeItem", isAsync: false },
|
|
1975
|
+
{ name: "setItem", isAsync: false }
|
|
1976
|
+
]);
|
|
1893
1977
|
}
|
|
1894
1978
|
/**
|
|
1895
1979
|
* 获取数据存储对象,可以通过
|
|
@@ -1901,24 +1985,25 @@
|
|
|
1901
1985
|
* },
|
|
1902
1986
|
* });
|
|
1903
1987
|
*/
|
|
1904
|
-
|
|
1988
|
+
getStorage() {
|
|
1905
1989
|
return this.storage;
|
|
1906
1990
|
}
|
|
1907
|
-
|
|
1991
|
+
getNamespace() {
|
|
1908
1992
|
return this.namespace;
|
|
1909
1993
|
}
|
|
1910
1994
|
/**
|
|
1911
1995
|
* 清理,支持storageService.usePlugin
|
|
1912
1996
|
*/
|
|
1913
|
-
|
|
1914
|
-
const storage =
|
|
1997
|
+
clear() {
|
|
1998
|
+
const storage = this.getStorage();
|
|
1915
1999
|
storage.clear();
|
|
1916
2000
|
}
|
|
1917
2001
|
/**
|
|
1918
2002
|
* 获取存储项,支持storageService.usePlugin
|
|
1919
2003
|
*/
|
|
1920
|
-
|
|
1921
|
-
const
|
|
2004
|
+
getItem(key, options = {}) {
|
|
2005
|
+
const storage = this.getStorage();
|
|
2006
|
+
const namespace = this.getNamespace();
|
|
1922
2007
|
const { protocol = options.protocol, item } = this.getValueAndProtocol(
|
|
1923
2008
|
storage.getItem(`${options.namespace || namespace}:${key}`)
|
|
1924
2009
|
);
|
|
@@ -1940,22 +2025,24 @@
|
|
|
1940
2025
|
/**
|
|
1941
2026
|
* 获取指定索引位置的key
|
|
1942
2027
|
*/
|
|
1943
|
-
|
|
1944
|
-
const storage =
|
|
2028
|
+
key(index) {
|
|
2029
|
+
const storage = this.getStorage();
|
|
1945
2030
|
return storage.key(index);
|
|
1946
2031
|
}
|
|
1947
2032
|
/**
|
|
1948
2033
|
* 移除存储项,支持storageService.usePlugin
|
|
1949
2034
|
*/
|
|
1950
|
-
|
|
1951
|
-
const
|
|
2035
|
+
removeItem(key, options = {}) {
|
|
2036
|
+
const storage = this.getStorage();
|
|
2037
|
+
const namespace = this.getNamespace();
|
|
1952
2038
|
storage.removeItem(`${options.namespace || namespace}:${key}`);
|
|
1953
2039
|
}
|
|
1954
2040
|
/**
|
|
1955
2041
|
* 设置存储项,支持storageService.usePlugin
|
|
1956
2042
|
*/
|
|
1957
|
-
|
|
1958
|
-
const
|
|
2043
|
+
setItem(key, value, options = {}) {
|
|
2044
|
+
const storage = this.getStorage();
|
|
2045
|
+
const namespace = this.getNamespace();
|
|
1959
2046
|
let item = value;
|
|
1960
2047
|
const protocol = options.protocol ? `${options.protocol}:` : "";
|
|
1961
2048
|
if (typeof value === "string" /* STRING */ || typeof value === "number" /* NUMBER */) {
|
|
@@ -1992,18 +2079,19 @@
|
|
|
1992
2079
|
class Props extends BaseService {
|
|
1993
2080
|
state = vue.reactive({
|
|
1994
2081
|
propsConfigMap: {},
|
|
1995
|
-
propsValueMap: {}
|
|
2082
|
+
propsValueMap: {},
|
|
2083
|
+
relateIdMap: {}
|
|
1996
2084
|
});
|
|
1997
2085
|
constructor() {
|
|
1998
2086
|
super([
|
|
1999
|
-
"setPropsConfig",
|
|
2000
|
-
"getPropsConfig",
|
|
2001
|
-
"setPropsValue",
|
|
2002
|
-
"getPropsValue",
|
|
2003
|
-
"createId",
|
|
2004
|
-
"setNewItemId",
|
|
2005
|
-
"fillConfig",
|
|
2006
|
-
"getDefaultPropsValue"
|
|
2087
|
+
{ name: "setPropsConfig", isAsync: true },
|
|
2088
|
+
{ name: "getPropsConfig", isAsync: true },
|
|
2089
|
+
{ name: "setPropsValue", isAsync: true },
|
|
2090
|
+
{ name: "getPropsValue", isAsync: true },
|
|
2091
|
+
{ name: "createId", isAsync: false },
|
|
2092
|
+
{ name: "setNewItemId", isAsync: true },
|
|
2093
|
+
{ name: "fillConfig", isAsync: true },
|
|
2094
|
+
{ name: "getDefaultPropsValue", isAsync: true }
|
|
2007
2095
|
]);
|
|
2008
2096
|
}
|
|
2009
2097
|
setPropsConfigs(configs) {
|
|
@@ -2083,11 +2171,17 @@
|
|
|
2083
2171
|
}
|
|
2084
2172
|
/**
|
|
2085
2173
|
* 将组件与组件的子元素配置中的id都设置成一个新的ID
|
|
2174
|
+
* 如果没有相同ID并且force为false则保持不变
|
|
2086
2175
|
* @param {Object} config 组件配置
|
|
2176
|
+
* @param {Boolean} force 是否强制设置新的ID
|
|
2087
2177
|
*/
|
|
2088
2178
|
/* eslint no-param-reassign: ["error", { "props": false }] */
|
|
2089
|
-
async setNewItemId(config) {
|
|
2090
|
-
|
|
2179
|
+
async setNewItemId(config, force = true) {
|
|
2180
|
+
if (force || editorService.getNodeById(config.id)) {
|
|
2181
|
+
const newId = await this.createId(config.type || "component");
|
|
2182
|
+
this.setRelateId(config.id, newId);
|
|
2183
|
+
config.id = newId;
|
|
2184
|
+
}
|
|
2091
2185
|
if (config.items && Array.isArray(config.items)) {
|
|
2092
2186
|
for (const item of config.items) {
|
|
2093
2187
|
await this.setNewItemId(item);
|
|
@@ -2117,11 +2211,59 @@
|
|
|
2117
2211
|
this.state.propsConfigMap = {};
|
|
2118
2212
|
this.state.propsValueMap = {};
|
|
2119
2213
|
}
|
|
2214
|
+
/**
|
|
2215
|
+
* 替换关联ID
|
|
2216
|
+
* @param originConfigs 原组件配置
|
|
2217
|
+
* @param targetConfigs 待替换的组件配置
|
|
2218
|
+
*/
|
|
2219
|
+
replaceRelateId(originConfigs, targetConfigs) {
|
|
2220
|
+
const relateIdMap = this.getRelateIdMap();
|
|
2221
|
+
if (Object.keys(relateIdMap).length === 0)
|
|
2222
|
+
return;
|
|
2223
|
+
const target = depService.getTarget(dep.DepTargetType.RELATED_COMP_WHEN_COPY, dep.DepTargetType.RELATED_COMP_WHEN_COPY);
|
|
2224
|
+
if (!target)
|
|
2225
|
+
return;
|
|
2226
|
+
originConfigs.forEach((config) => {
|
|
2227
|
+
const newId = relateIdMap[config.id];
|
|
2228
|
+
const targetConfig = targetConfigs.find((targetConfig2) => targetConfig2.id === newId);
|
|
2229
|
+
if (!targetConfig)
|
|
2230
|
+
return;
|
|
2231
|
+
target.deps[config.id]?.keys?.forEach((fullKey) => {
|
|
2232
|
+
const relateOriginId = lodashEs.get(config, fullKey);
|
|
2233
|
+
const relateTargetId = relateIdMap[relateOriginId];
|
|
2234
|
+
if (!relateTargetId)
|
|
2235
|
+
return;
|
|
2236
|
+
lodashEs.set(targetConfig, fullKey, relateTargetId);
|
|
2237
|
+
});
|
|
2238
|
+
});
|
|
2239
|
+
}
|
|
2240
|
+
/**
|
|
2241
|
+
* 清除setNewItemId前后映射关系
|
|
2242
|
+
*/
|
|
2243
|
+
clearRelateId() {
|
|
2244
|
+
this.state.relateIdMap = {};
|
|
2245
|
+
}
|
|
2120
2246
|
destroy() {
|
|
2121
2247
|
this.resetState();
|
|
2122
2248
|
this.removeAllListeners();
|
|
2123
2249
|
this.removeAllPlugins();
|
|
2124
2250
|
}
|
|
2251
|
+
/**
|
|
2252
|
+
* 获取setNewItemId前后映射关系
|
|
2253
|
+
* @param oldId 原组件ID
|
|
2254
|
+
* @returns 新旧ID映射
|
|
2255
|
+
*/
|
|
2256
|
+
getRelateIdMap() {
|
|
2257
|
+
return this.state.relateIdMap;
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* 记录setNewItemId前后映射关系
|
|
2261
|
+
* @param oldId 原组件ID
|
|
2262
|
+
* @param newId 分配的新ID
|
|
2263
|
+
*/
|
|
2264
|
+
setRelateId(oldId, newId) {
|
|
2265
|
+
this.state.relateIdMap[oldId] = newId;
|
|
2266
|
+
}
|
|
2125
2267
|
}
|
|
2126
2268
|
const propsService = new Props();
|
|
2127
2269
|
|
|
@@ -2141,27 +2283,27 @@
|
|
|
2141
2283
|
constructor() {
|
|
2142
2284
|
super(
|
|
2143
2285
|
[
|
|
2144
|
-
"getLayout",
|
|
2145
|
-
"select",
|
|
2146
|
-
"doAdd",
|
|
2147
|
-
"add",
|
|
2148
|
-
"doRemove",
|
|
2149
|
-
"remove",
|
|
2150
|
-
"doUpdate",
|
|
2151
|
-
"update",
|
|
2152
|
-
"sort",
|
|
2153
|
-
"copy",
|
|
2154
|
-
"paste",
|
|
2155
|
-
"doPaste",
|
|
2156
|
-
"doAlignCenter",
|
|
2157
|
-
"alignCenter",
|
|
2158
|
-
"moveLayer",
|
|
2159
|
-
"moveToContainer",
|
|
2160
|
-
"move",
|
|
2161
|
-
"undo",
|
|
2162
|
-
"redo",
|
|
2163
|
-
"highlight",
|
|
2164
|
-
"dragTo"
|
|
2286
|
+
{ name: "getLayout", isAsync: true },
|
|
2287
|
+
{ name: "select", isAsync: true },
|
|
2288
|
+
{ name: "doAdd", isAsync: true },
|
|
2289
|
+
{ name: "add", isAsync: true },
|
|
2290
|
+
{ name: "doRemove", isAsync: true },
|
|
2291
|
+
{ name: "remove", isAsync: true },
|
|
2292
|
+
{ name: "doUpdate", isAsync: true },
|
|
2293
|
+
{ name: "update", isAsync: true },
|
|
2294
|
+
{ name: "sort", isAsync: true },
|
|
2295
|
+
{ name: "copy", isAsync: true },
|
|
2296
|
+
{ name: "paste", isAsync: true },
|
|
2297
|
+
{ name: "doPaste", isAsync: true },
|
|
2298
|
+
{ name: "doAlignCenter", isAsync: true },
|
|
2299
|
+
{ name: "alignCenter", isAsync: true },
|
|
2300
|
+
{ name: "moveLayer", isAsync: true },
|
|
2301
|
+
{ name: "moveToContainer", isAsync: true },
|
|
2302
|
+
{ name: "move", isAsync: true },
|
|
2303
|
+
{ name: "undo", isAsync: true },
|
|
2304
|
+
{ name: "redo", isAsync: true },
|
|
2305
|
+
{ name: "highlight", isAsync: true },
|
|
2306
|
+
{ name: "dragTo", isAsync: true }
|
|
2165
2307
|
],
|
|
2166
2308
|
// 需要注意循环依赖问题,如果函数间有相互调用的话,不能设置为串行调用
|
|
2167
2309
|
["select", "update", "moveLayer"]
|
|
@@ -2576,12 +2718,46 @@
|
|
|
2576
2718
|
this.pushHistoryState();
|
|
2577
2719
|
}
|
|
2578
2720
|
/**
|
|
2579
|
-
*
|
|
2721
|
+
* 将组件节点配置存储到localStorage中
|
|
2580
2722
|
* @param config 组件节点配置
|
|
2581
|
-
* @returns
|
|
2723
|
+
* @returns
|
|
2724
|
+
*/
|
|
2725
|
+
copy(config) {
|
|
2726
|
+
storageService.setItem(COPY_STORAGE_KEY, Array.isArray(config) ? config : [config], {
|
|
2727
|
+
protocol: Protocol.OBJECT
|
|
2728
|
+
});
|
|
2729
|
+
}
|
|
2730
|
+
/**
|
|
2731
|
+
* 复制时会带上组件关联的依赖
|
|
2732
|
+
* @param config 组件节点配置
|
|
2733
|
+
* @returns
|
|
2582
2734
|
*/
|
|
2583
|
-
|
|
2584
|
-
|
|
2735
|
+
copyWithRelated(config) {
|
|
2736
|
+
const copyNodes = Array.isArray(config) ? config : [config];
|
|
2737
|
+
depService.getTarget(dep.DepTargetType.RELATED_COMP_WHEN_COPY, dep.DepTargetType.RELATED_COMP_WHEN_COPY)?.removeDep();
|
|
2738
|
+
depService.collect(copyNodes, true, dep.DepTargetType.RELATED_COMP_WHEN_COPY);
|
|
2739
|
+
const customTarget = depService.getTarget(
|
|
2740
|
+
dep.DepTargetType.RELATED_COMP_WHEN_COPY,
|
|
2741
|
+
dep.DepTargetType.RELATED_COMP_WHEN_COPY
|
|
2742
|
+
);
|
|
2743
|
+
if (customTarget) {
|
|
2744
|
+
Object.keys(customTarget.deps).forEach((nodeId) => {
|
|
2745
|
+
const node = this.getNodeById(nodeId);
|
|
2746
|
+
if (!node)
|
|
2747
|
+
return;
|
|
2748
|
+
customTarget.deps[nodeId].keys.forEach((key) => {
|
|
2749
|
+
const relateNodeId = lodashEs.get(node, key);
|
|
2750
|
+
const isExist = copyNodes.find((node2) => node2.id === relateNodeId);
|
|
2751
|
+
if (!isExist) {
|
|
2752
|
+
const relateNode = this.getNodeById(relateNodeId);
|
|
2753
|
+
if (relateNode) {
|
|
2754
|
+
copyNodes.push(relateNode);
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
});
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2760
|
+
storageService.setItem(COPY_STORAGE_KEY, copyNodes, {
|
|
2585
2761
|
protocol: Protocol.OBJECT
|
|
2586
2762
|
});
|
|
2587
2763
|
}
|
|
@@ -2591,7 +2767,7 @@
|
|
|
2591
2767
|
* @returns 添加后的组件节点配置
|
|
2592
2768
|
*/
|
|
2593
2769
|
async paste(position = {}) {
|
|
2594
|
-
const config =
|
|
2770
|
+
const config = storageService.getItem(COPY_STORAGE_KEY);
|
|
2595
2771
|
if (!Array.isArray(config))
|
|
2596
2772
|
return;
|
|
2597
2773
|
const node = this.get("node");
|
|
@@ -2603,9 +2779,11 @@
|
|
|
2603
2779
|
}
|
|
2604
2780
|
}
|
|
2605
2781
|
const pasteConfigs = await this.doPaste(config, position);
|
|
2782
|
+
propsService.replaceRelateId(config, pasteConfigs);
|
|
2606
2783
|
return this.add(pasteConfigs, parent);
|
|
2607
2784
|
}
|
|
2608
2785
|
async doPaste(config, position = {}) {
|
|
2786
|
+
propsService.clearRelateId();
|
|
2609
2787
|
const pasteConfigs = await beforePaste(position, lodashEs.cloneDeep(config));
|
|
2610
2788
|
return pasteConfigs;
|
|
2611
2789
|
}
|
|
@@ -2922,7 +3100,7 @@
|
|
|
2922
3100
|
if (pastePosition.top && configItem.style?.top) {
|
|
2923
3101
|
pastePosition.top = configItem.style?.top - referenceTop + pastePosition.top;
|
|
2924
3102
|
}
|
|
2925
|
-
const pasteConfig = await propsService.setNewItemId(configItem);
|
|
3103
|
+
const pasteConfig = await propsService.setNewItemId(configItem, false);
|
|
2926
3104
|
if (pasteConfig.style) {
|
|
2927
3105
|
const { left, top } = pasteConfig.style;
|
|
2928
3106
|
if (typeof left === "number" || !!left && !isNaN(Number(left))) {
|
|
@@ -2976,7 +3154,7 @@
|
|
|
2976
3154
|
return newNode;
|
|
2977
3155
|
};
|
|
2978
3156
|
|
|
2979
|
-
const _sfc_main$
|
|
3157
|
+
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
2980
3158
|
...{
|
|
2981
3159
|
name: "MEditorCodeParams"
|
|
2982
3160
|
},
|
|
@@ -3026,8 +3204,8 @@
|
|
|
3026
3204
|
}
|
|
3027
3205
|
});
|
|
3028
3206
|
|
|
3029
|
-
const _hoisted_1$
|
|
3030
|
-
const _sfc_main$
|
|
3207
|
+
const _hoisted_1$q = ["src"];
|
|
3208
|
+
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
3031
3209
|
...{
|
|
3032
3210
|
name: "MEditorIcon"
|
|
3033
3211
|
},
|
|
@@ -3051,7 +3229,7 @@
|
|
|
3051
3229
|
class: "magic-editor-icon"
|
|
3052
3230
|
}, {
|
|
3053
3231
|
default: vue.withCtx(() => [
|
|
3054
|
-
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
3232
|
+
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$q)
|
|
3055
3233
|
]),
|
|
3056
3234
|
_: 1
|
|
3057
3235
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -3129,9 +3307,9 @@
|
|
|
3129
3307
|
};
|
|
3130
3308
|
};
|
|
3131
3309
|
|
|
3132
|
-
const _hoisted_1$
|
|
3133
|
-
const _hoisted_2$
|
|
3134
|
-
const _sfc_main$
|
|
3310
|
+
const _hoisted_1$p = { class: "m-fields-code-select-col" };
|
|
3311
|
+
const _hoisted_2$i = { class: "code-select-container" };
|
|
3312
|
+
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
3135
3313
|
...{
|
|
3136
3314
|
name: "MEditorCodeSelectCol"
|
|
3137
3315
|
},
|
|
@@ -3204,8 +3382,8 @@
|
|
|
3204
3382
|
const { codeBlockEditor, codeConfig, editCode, submitCodeBlockHandler } = useCodeBlockEdit(services?.codeBlockService);
|
|
3205
3383
|
return (_ctx, _cache) => {
|
|
3206
3384
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
3207
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3208
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3385
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
|
|
3386
|
+
vue.createElementVNode("div", _hoisted_2$i, [
|
|
3209
3387
|
vue.createVNode(_component_m_form_container, {
|
|
3210
3388
|
class: "select",
|
|
3211
3389
|
config: selectConfig,
|
|
@@ -3213,14 +3391,14 @@
|
|
|
3213
3391
|
size: _ctx.size,
|
|
3214
3392
|
onChange: onParamsChangeHandler
|
|
3215
3393
|
}, null, 8, ["model", "size"]),
|
|
3216
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3394
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
3217
3395
|
key: 0,
|
|
3218
3396
|
class: "icon",
|
|
3219
3397
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
3220
3398
|
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(editCode)(_ctx.model[_ctx.name]))
|
|
3221
3399
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
3222
3400
|
]),
|
|
3223
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3401
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$L, {
|
|
3224
3402
|
key: 0,
|
|
3225
3403
|
name: "params",
|
|
3226
3404
|
model: _ctx.model,
|
|
@@ -3228,7 +3406,7 @@
|
|
|
3228
3406
|
"params-config": paramsConfig.value,
|
|
3229
3407
|
onChange: onParamsChangeHandler
|
|
3230
3408
|
}, null, 8, ["model", "size", "params-config"])) : vue.createCommentVNode("", true),
|
|
3231
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3409
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
|
|
3232
3410
|
key: 1,
|
|
3233
3411
|
ref_key: "codeBlockEditor",
|
|
3234
3412
|
ref: codeBlockEditor,
|
|
@@ -3241,9 +3419,9 @@
|
|
|
3241
3419
|
}
|
|
3242
3420
|
});
|
|
3243
3421
|
|
|
3244
|
-
const _hoisted_1$
|
|
3245
|
-
const _hoisted_2$
|
|
3246
|
-
const _sfc_main$
|
|
3422
|
+
const _hoisted_1$o = { class: "m-editor-data-source-fields" };
|
|
3423
|
+
const _hoisted_2$h = { class: "m-editor-data-source-fields-footer" };
|
|
3424
|
+
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
3247
3425
|
...{
|
|
3248
3426
|
name: "MEditorDataSourceFields"
|
|
3249
3427
|
},
|
|
@@ -3478,12 +3656,12 @@
|
|
|
3478
3656
|
}
|
|
3479
3657
|
};
|
|
3480
3658
|
return (_ctx, _cache) => {
|
|
3481
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3659
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
|
|
3482
3660
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
3483
3661
|
data: _ctx.model[_ctx.name],
|
|
3484
3662
|
columns: fieldColumns
|
|
3485
3663
|
}, null, 8, ["data"]),
|
|
3486
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3664
|
+
vue.createElementVNode("div", _hoisted_2$h, [
|
|
3487
3665
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3488
3666
|
size: "small",
|
|
3489
3667
|
disabled: _ctx.disabled,
|
|
@@ -3535,7 +3713,7 @@
|
|
|
3535
3713
|
}
|
|
3536
3714
|
});
|
|
3537
3715
|
|
|
3538
|
-
const _sfc_main$
|
|
3716
|
+
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
3539
3717
|
__name: "DataSourceFieldSelect",
|
|
3540
3718
|
props: {
|
|
3541
3719
|
config: {},
|
|
@@ -3590,10 +3768,10 @@
|
|
|
3590
3768
|
}
|
|
3591
3769
|
});
|
|
3592
3770
|
|
|
3593
|
-
const _hoisted_1$
|
|
3594
|
-
const _hoisted_2$
|
|
3595
|
-
const _hoisted_3$
|
|
3596
|
-
const _sfc_main$
|
|
3771
|
+
const _hoisted_1$n = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
3772
|
+
const _hoisted_2$g = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
3773
|
+
const _hoisted_3$6 = { class: "el-input__inner" };
|
|
3774
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
3597
3775
|
...{
|
|
3598
3776
|
name: "MEditorDataSourceInput"
|
|
3599
3777
|
},
|
|
@@ -3783,12 +3961,12 @@
|
|
|
3783
3961
|
}
|
|
3784
3962
|
), {
|
|
3785
3963
|
suffix: vue.withCtx(() => [
|
|
3786
|
-
vue.createVNode(_sfc_main$
|
|
3964
|
+
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
3787
3965
|
]),
|
|
3788
3966
|
default: vue.withCtx(({ item }) => [
|
|
3789
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
3967
|
+
vue.createElementVNode("div", _hoisted_1$n, [
|
|
3790
3968
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
3791
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
3969
|
+
vue.createElementVNode("span", _hoisted_2$g, vue.toDisplayString(item.value), 1)
|
|
3792
3970
|
])
|
|
3793
3971
|
]),
|
|
3794
3972
|
_: 1
|
|
@@ -3800,7 +3978,7 @@
|
|
|
3800
3978
|
vue.createElementVNode("div", {
|
|
3801
3979
|
class: vue.normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
3802
3980
|
}, [
|
|
3803
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
3981
|
+
vue.createElementVNode("div", _hoisted_3$6, [
|
|
3804
3982
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayState.value, (item, index) => {
|
|
3805
3983
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3806
3984
|
item.type === "text" ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
@@ -3818,7 +3996,7 @@
|
|
|
3818
3996
|
}, 1032, ["size"])) : vue.createCommentVNode("", true)
|
|
3819
3997
|
], 64);
|
|
3820
3998
|
}), 256)),
|
|
3821
|
-
vue.createVNode(_sfc_main$
|
|
3999
|
+
vue.createVNode(_sfc_main$K, {
|
|
3822
4000
|
class: "tmagic-data-source-input-icon",
|
|
3823
4001
|
icon: vue.unref(iconsVue.Coin)
|
|
3824
4002
|
}, null, 8, ["icon"])
|
|
@@ -3901,9 +4079,9 @@
|
|
|
3901
4079
|
};
|
|
3902
4080
|
};
|
|
3903
4081
|
|
|
3904
|
-
const _hoisted_1$
|
|
3905
|
-
const _hoisted_2$
|
|
3906
|
-
const _sfc_main$
|
|
4082
|
+
const _hoisted_1$m = { class: "m-editor-data-source-methods" };
|
|
4083
|
+
const _hoisted_2$f = { class: "m-editor-data-source-methods-footer" };
|
|
4084
|
+
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
3907
4085
|
...{
|
|
3908
4086
|
name: "MEditorDataSourceMethods"
|
|
3909
4087
|
},
|
|
@@ -3973,12 +4151,12 @@
|
|
|
3973
4151
|
emit("change", props.model[props.name]);
|
|
3974
4152
|
};
|
|
3975
4153
|
return (_ctx, _cache) => {
|
|
3976
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4154
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
3977
4155
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
3978
4156
|
data: _ctx.model[_ctx.name],
|
|
3979
4157
|
columns: methodColumns
|
|
3980
4158
|
}, null, 8, ["data"]),
|
|
3981
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4159
|
+
vue.createElementVNode("div", _hoisted_2$f, [
|
|
3982
4160
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3983
4161
|
size: "small",
|
|
3984
4162
|
type: "primary",
|
|
@@ -3992,7 +4170,7 @@
|
|
|
3992
4170
|
_: 1
|
|
3993
4171
|
}, 8, ["disabled"])
|
|
3994
4172
|
]),
|
|
3995
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4173
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
|
|
3996
4174
|
key: 0,
|
|
3997
4175
|
ref_key: "codeBlockEditor",
|
|
3998
4176
|
ref: codeBlockEditor,
|
|
@@ -4007,9 +4185,9 @@
|
|
|
4007
4185
|
}
|
|
4008
4186
|
});
|
|
4009
4187
|
|
|
4010
|
-
const _hoisted_1$
|
|
4011
|
-
const _hoisted_2$
|
|
4012
|
-
const _sfc_main$
|
|
4188
|
+
const _hoisted_1$l = { class: "m-fields-data-source-method-select" };
|
|
4189
|
+
const _hoisted_2$e = { class: "data-source-method-select-container" };
|
|
4190
|
+
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
4013
4191
|
...{
|
|
4014
4192
|
name: "MEditorDataSourceMethodSelect"
|
|
4015
4193
|
},
|
|
@@ -4092,22 +4270,22 @@
|
|
|
4092
4270
|
};
|
|
4093
4271
|
return (_ctx, _cache) => {
|
|
4094
4272
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
4095
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4096
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4273
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
4274
|
+
vue.createElementVNode("div", _hoisted_2$e, [
|
|
4097
4275
|
vue.createVNode(_component_m_form_container, {
|
|
4098
4276
|
class: "select",
|
|
4099
4277
|
config: cascaderConfig.value,
|
|
4100
4278
|
model: _ctx.model,
|
|
4101
4279
|
onChange: onChangeHandler
|
|
4102
4280
|
}, null, 8, ["config", "model"]),
|
|
4103
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4281
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
4104
4282
|
key: 0,
|
|
4105
4283
|
class: "icon",
|
|
4106
4284
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
4107
4285
|
onClick: editCodeHandler
|
|
4108
4286
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
4109
4287
|
]),
|
|
4110
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4288
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$L, {
|
|
4111
4289
|
key: 0,
|
|
4112
4290
|
name: "params",
|
|
4113
4291
|
model: _ctx.model,
|
|
@@ -4116,7 +4294,7 @@
|
|
|
4116
4294
|
"params-config": paramsConfig.value,
|
|
4117
4295
|
onChange: onChangeHandler
|
|
4118
4296
|
}, null, 8, ["model", "size", "disabled", "params-config"])) : vue.createCommentVNode("", true),
|
|
4119
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4297
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
|
|
4120
4298
|
key: 1,
|
|
4121
4299
|
ref_key: "codeBlockEditor",
|
|
4122
4300
|
ref: codeBlockEditor,
|
|
@@ -4129,9 +4307,9 @@
|
|
|
4129
4307
|
}
|
|
4130
4308
|
});
|
|
4131
4309
|
|
|
4132
|
-
const _hoisted_1$
|
|
4133
|
-
const _hoisted_2$
|
|
4134
|
-
const _sfc_main$
|
|
4310
|
+
const _hoisted_1$k = { class: "m-editor-data-source-fields" };
|
|
4311
|
+
const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
|
|
4312
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
4135
4313
|
...{
|
|
4136
4314
|
name: "MEditorDataSourceMocks"
|
|
4137
4315
|
},
|
|
@@ -4218,7 +4396,7 @@
|
|
|
4218
4396
|
const columns = [
|
|
4219
4397
|
{
|
|
4220
4398
|
type: "expand",
|
|
4221
|
-
component: _sfc_main$
|
|
4399
|
+
component: _sfc_main$Q,
|
|
4222
4400
|
props: (row) => ({
|
|
4223
4401
|
initValues: row.data,
|
|
4224
4402
|
language: "json",
|
|
@@ -4327,12 +4505,12 @@
|
|
|
4327
4505
|
});
|
|
4328
4506
|
};
|
|
4329
4507
|
return (_ctx, _cache) => {
|
|
4330
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4508
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
|
|
4331
4509
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
4332
4510
|
data: _ctx.model[_ctx.name],
|
|
4333
4511
|
columns
|
|
4334
4512
|
}, null, 8, ["data"]),
|
|
4335
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4513
|
+
vue.createElementVNode("div", _hoisted_2$d, [
|
|
4336
4514
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4337
4515
|
size: "small",
|
|
4338
4516
|
type: "primary",
|
|
@@ -4363,7 +4541,7 @@
|
|
|
4363
4541
|
}
|
|
4364
4542
|
});
|
|
4365
4543
|
|
|
4366
|
-
const _sfc_main$
|
|
4544
|
+
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
4367
4545
|
...{
|
|
4368
4546
|
name: "MEditorDataSourceSelect"
|
|
4369
4547
|
},
|
|
@@ -4420,12 +4598,12 @@
|
|
|
4420
4598
|
}
|
|
4421
4599
|
});
|
|
4422
4600
|
|
|
4423
|
-
const _hoisted_1$
|
|
4424
|
-
const _hoisted_2$
|
|
4601
|
+
const _hoisted_1$j = { class: "m-fields-event-select" };
|
|
4602
|
+
const _hoisted_2$c = {
|
|
4425
4603
|
key: 1,
|
|
4426
4604
|
class: "fullWidth"
|
|
4427
4605
|
};
|
|
4428
|
-
const _sfc_main$
|
|
4606
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
4429
4607
|
...{
|
|
4430
4608
|
name: "MEditorEventSelect"
|
|
4431
4609
|
},
|
|
@@ -4628,7 +4806,7 @@
|
|
|
4628
4806
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
4629
4807
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
4630
4808
|
const _component_m_form_panel = vue.resolveComponent("m-form-panel");
|
|
4631
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4809
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
|
|
4632
4810
|
isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
|
|
4633
4811
|
key: 0,
|
|
4634
4812
|
ref: "eventForm",
|
|
@@ -4638,7 +4816,7 @@
|
|
|
4638
4816
|
model: _ctx.model,
|
|
4639
4817
|
config: tableConfig.value,
|
|
4640
4818
|
onChange: onChangeHandler
|
|
4641
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
4819
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
|
|
4642
4820
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4643
4821
|
class: "create-button",
|
|
4644
4822
|
type: "primary",
|
|
@@ -4688,32 +4866,32 @@
|
|
|
4688
4866
|
}
|
|
4689
4867
|
});
|
|
4690
4868
|
|
|
4691
|
-
const _hoisted_1$
|
|
4869
|
+
const _hoisted_1$i = {
|
|
4692
4870
|
viewBox: "0 0 32 32",
|
|
4693
4871
|
version: "1.1",
|
|
4694
4872
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4695
4873
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
4696
4874
|
};
|
|
4697
|
-
const _hoisted_2$
|
|
4698
|
-
const _hoisted_4$
|
|
4699
|
-
_hoisted_2$
|
|
4875
|
+
const _hoisted_2$b = /* @__PURE__ */ vue.createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
|
|
4876
|
+
const _hoisted_4$4 = [
|
|
4877
|
+
_hoisted_2$b
|
|
4700
4878
|
];
|
|
4701
|
-
const _sfc_main$
|
|
4879
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
4702
4880
|
...{
|
|
4703
4881
|
name: "MEditorCodeIcon"
|
|
4704
4882
|
},
|
|
4705
4883
|
__name: "CodeIcon",
|
|
4706
4884
|
setup(__props) {
|
|
4707
4885
|
return (_ctx, _cache) => {
|
|
4708
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
4886
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$i, _hoisted_4$4);
|
|
4709
4887
|
};
|
|
4710
4888
|
}
|
|
4711
4889
|
});
|
|
4712
4890
|
|
|
4713
|
-
const _hoisted_1$
|
|
4714
|
-
const _hoisted_2$
|
|
4715
|
-
const _hoisted_3$
|
|
4716
|
-
const _sfc_main$
|
|
4891
|
+
const _hoisted_1$h = { class: "m-fields-key-value" };
|
|
4892
|
+
const _hoisted_2$a = { key: 0 };
|
|
4893
|
+
const _hoisted_3$5 = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
4894
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
4717
4895
|
...{
|
|
4718
4896
|
name: "MEditorKeyValue"
|
|
4719
4897
|
},
|
|
@@ -4771,8 +4949,8 @@
|
|
|
4771
4949
|
emit("change", v);
|
|
4772
4950
|
};
|
|
4773
4951
|
return (_ctx, _cache) => {
|
|
4774
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4775
|
-
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
4952
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
4953
|
+
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
|
|
4776
4954
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
4777
4955
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4778
4956
|
class: "m-fields-key-value-item",
|
|
@@ -4786,7 +4964,7 @@
|
|
|
4786
4964
|
size: _ctx.size,
|
|
4787
4965
|
onChange: keyChangeHandler
|
|
4788
4966
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
4789
|
-
_hoisted_3$
|
|
4967
|
+
_hoisted_3$5,
|
|
4790
4968
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4791
4969
|
placeholder: "value",
|
|
4792
4970
|
modelValue: records.value[index][1],
|
|
@@ -4821,7 +4999,7 @@
|
|
|
4821
4999
|
_: 1
|
|
4822
5000
|
}, 8, ["size", "disabled", "icon"])
|
|
4823
5001
|
])) : vue.createCommentVNode("", true),
|
|
4824
|
-
_ctx.config.advanced && showCode.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5002
|
+
_ctx.config.advanced && showCode.value ? (vue.openBlock(), vue.createBlock(_sfc_main$Q, {
|
|
4825
5003
|
key: 1,
|
|
4826
5004
|
height: "200px",
|
|
4827
5005
|
"init-values": _ctx.model[_ctx.name],
|
|
@@ -4837,7 +5015,7 @@
|
|
|
4837
5015
|
size: "default",
|
|
4838
5016
|
disabled: _ctx.disabled,
|
|
4839
5017
|
text: "",
|
|
4840
|
-
icon: _sfc_main$
|
|
5018
|
+
icon: _sfc_main$A,
|
|
4841
5019
|
onClick: _cache[0] || (_cache[0] = ($event) => showCode.value = !showCode.value)
|
|
4842
5020
|
}, null, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
4843
5021
|
]);
|
|
@@ -4845,12 +5023,12 @@
|
|
|
4845
5023
|
}
|
|
4846
5024
|
});
|
|
4847
5025
|
|
|
4848
|
-
const _hoisted_1$
|
|
5026
|
+
const _hoisted_1$g = {
|
|
4849
5027
|
key: 1,
|
|
4850
5028
|
class: "m-fields-ui-select",
|
|
4851
5029
|
style: { "display": "flex" }
|
|
4852
5030
|
};
|
|
4853
|
-
const _sfc_main$
|
|
5031
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
4854
5032
|
...{
|
|
4855
5033
|
name: "MEditorUISelect"
|
|
4856
5034
|
},
|
|
@@ -4940,7 +5118,7 @@
|
|
|
4940
5118
|
]),
|
|
4941
5119
|
_: 1
|
|
4942
5120
|
}, 8, ["icon", "disabled", "size"])
|
|
4943
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5121
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
|
|
4944
5122
|
val.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
4945
5123
|
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
4946
5124
|
content: "清除",
|
|
@@ -5007,8 +5185,6 @@
|
|
|
5007
5185
|
}
|
|
5008
5186
|
});
|
|
5009
5187
|
|
|
5010
|
-
const UISelect_vue_vue_type_style_index_0_lang = '';
|
|
5011
|
-
|
|
5012
5188
|
const useGetSo = (target, emit) => {
|
|
5013
5189
|
let getso;
|
|
5014
5190
|
const isDraging = vue.ref(false);
|
|
@@ -5037,7 +5213,7 @@
|
|
|
5037
5213
|
};
|
|
5038
5214
|
};
|
|
5039
5215
|
|
|
5040
|
-
const _sfc_main$
|
|
5216
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
5041
5217
|
...{
|
|
5042
5218
|
name: "MEditorResizer"
|
|
5043
5219
|
},
|
|
@@ -5059,7 +5235,7 @@
|
|
|
5059
5235
|
}
|
|
5060
5236
|
});
|
|
5061
5237
|
|
|
5062
|
-
const _sfc_main$
|
|
5238
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
5063
5239
|
...{
|
|
5064
5240
|
name: "MEditorLayout"
|
|
5065
5241
|
},
|
|
@@ -5186,7 +5362,7 @@
|
|
|
5186
5362
|
}, [
|
|
5187
5363
|
vue.renderSlot(_ctx.$slots, "left")
|
|
5188
5364
|
], 6),
|
|
5189
|
-
vue.createVNode(_sfc_main$
|
|
5365
|
+
vue.createVNode(_sfc_main$x, { onChange: changeLeft })
|
|
5190
5366
|
], 64)) : vue.createCommentVNode("", true),
|
|
5191
5367
|
vue.createElementVNode("div", {
|
|
5192
5368
|
class: vue.normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
@@ -5195,7 +5371,7 @@
|
|
|
5195
5371
|
vue.renderSlot(_ctx.$slots, "center")
|
|
5196
5372
|
], 6),
|
|
5197
5373
|
hasRight.value && _ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
5198
|
-
vue.createVNode(_sfc_main$
|
|
5374
|
+
vue.createVNode(_sfc_main$x, { onChange: changeRight }),
|
|
5199
5375
|
vue.createElementVNode("div", {
|
|
5200
5376
|
class: vue.normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
5201
5377
|
style: vue.normalizeStyle(`width: ${_ctx.right}px`)
|
|
@@ -5208,10 +5384,10 @@
|
|
|
5208
5384
|
}
|
|
5209
5385
|
});
|
|
5210
5386
|
|
|
5211
|
-
const _hoisted_1$
|
|
5212
|
-
const _hoisted_2$
|
|
5213
|
-
const _hoisted_3$
|
|
5214
|
-
const _sfc_main$
|
|
5387
|
+
const _hoisted_1$f = { class: "m-editor-empty-panel" };
|
|
5388
|
+
const _hoisted_2$9 = { class: "m-editor-empty-content" };
|
|
5389
|
+
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
5390
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
5215
5391
|
...{
|
|
5216
5392
|
name: "MEditorAddPageBox"
|
|
5217
5393
|
},
|
|
@@ -5231,16 +5407,16 @@
|
|
|
5231
5407
|
});
|
|
5232
5408
|
};
|
|
5233
5409
|
return (_ctx, _cache) => {
|
|
5234
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5235
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5410
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
|
|
5411
|
+
vue.createElementVNode("div", _hoisted_2$9, [
|
|
5236
5412
|
vue.createElementVNode("div", {
|
|
5237
5413
|
class: "m-editor-empty-button",
|
|
5238
5414
|
onClick: clickHandler
|
|
5239
5415
|
}, [
|
|
5240
5416
|
vue.createElementVNode("div", null, [
|
|
5241
|
-
vue.createVNode(_sfc_main$
|
|
5417
|
+
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
5242
5418
|
]),
|
|
5243
|
-
_hoisted_3$
|
|
5419
|
+
_hoisted_3$4
|
|
5244
5420
|
])
|
|
5245
5421
|
])
|
|
5246
5422
|
]);
|
|
@@ -5252,7 +5428,7 @@
|
|
|
5252
5428
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
5253
5429
|
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
5254
5430
|
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
5255
|
-
const _sfc_main$
|
|
5431
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
5256
5432
|
...{
|
|
5257
5433
|
name: "MEditorFramework"
|
|
5258
5434
|
},
|
|
@@ -5327,13 +5503,13 @@
|
|
|
5327
5503
|
vue.renderSlot(_ctx.$slots, "nav"),
|
|
5328
5504
|
vue.renderSlot(_ctx.$slots, "content-before"),
|
|
5329
5505
|
showSrc.value ? vue.renderSlot(_ctx.$slots, "src-code", { key: 0 }, () => [
|
|
5330
|
-
vue.createVNode(_sfc_main$
|
|
5506
|
+
vue.createVNode(_sfc_main$Q, {
|
|
5331
5507
|
class: "m-editor-content",
|
|
5332
5508
|
"init-values": root.value,
|
|
5333
5509
|
options: vue.unref(codeOptions),
|
|
5334
5510
|
onSave: saveCode
|
|
5335
5511
|
}, null, 8, ["init-values", "options"])
|
|
5336
|
-
]) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5512
|
+
]) : (vue.openBlock(), vue.createBlock(_sfc_main$w, {
|
|
5337
5513
|
key: 1,
|
|
5338
5514
|
ref_key: "splitView",
|
|
5339
5515
|
ref: splitView,
|
|
@@ -5355,7 +5531,7 @@
|
|
|
5355
5531
|
]),
|
|
5356
5532
|
center: vue.withCtx(() => [
|
|
5357
5533
|
pageLength.value > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
5358
|
-
vue.createVNode(_sfc_main$
|
|
5534
|
+
vue.createVNode(_sfc_main$v)
|
|
5359
5535
|
])
|
|
5360
5536
|
]),
|
|
5361
5537
|
_: 2
|
|
@@ -5380,12 +5556,12 @@
|
|
|
5380
5556
|
}
|
|
5381
5557
|
});
|
|
5382
5558
|
|
|
5383
|
-
const _hoisted_1$
|
|
5559
|
+
const _hoisted_1$e = {
|
|
5384
5560
|
key: 1,
|
|
5385
5561
|
class: "menu-item-text"
|
|
5386
5562
|
};
|
|
5387
|
-
const _hoisted_2$
|
|
5388
|
-
const _sfc_main$
|
|
5563
|
+
const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
|
|
5564
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
5389
5565
|
...{
|
|
5390
5566
|
name: "MEditorToolButton"
|
|
5391
5567
|
},
|
|
@@ -5464,7 +5640,7 @@
|
|
|
5464
5640
|
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
5465
5641
|
key: 0,
|
|
5466
5642
|
direction: _ctx.data.direction || "vertical"
|
|
5467
|
-
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5643
|
+
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
5468
5644
|
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
5469
5645
|
key: 0,
|
|
5470
5646
|
effect: "dark",
|
|
@@ -5478,7 +5654,7 @@
|
|
|
5478
5654
|
disabled: disabled.value
|
|
5479
5655
|
}, {
|
|
5480
5656
|
default: vue.withCtx(() => [
|
|
5481
|
-
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5657
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
5482
5658
|
key: 0,
|
|
5483
5659
|
icon: _ctx.data.icon
|
|
5484
5660
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -5496,7 +5672,7 @@
|
|
|
5496
5672
|
title: _ctx.data.text
|
|
5497
5673
|
}, {
|
|
5498
5674
|
default: vue.withCtx(() => [
|
|
5499
|
-
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5675
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
5500
5676
|
key: 0,
|
|
5501
5677
|
icon: _ctx.data.icon
|
|
5502
5678
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -5529,7 +5705,7 @@
|
|
|
5529
5705
|
})) : vue.createCommentVNode("", true)
|
|
5530
5706
|
]),
|
|
5531
5707
|
default: vue.withCtx(() => [
|
|
5532
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
5708
|
+
vue.createElementVNode("span", _hoisted_2$8, [
|
|
5533
5709
|
vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
|
|
5534
5710
|
vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
|
|
5535
5711
|
default: vue.withCtx(() => [
|
|
@@ -5546,7 +5722,7 @@
|
|
|
5546
5722
|
}
|
|
5547
5723
|
});
|
|
5548
5724
|
|
|
5549
|
-
const _sfc_main$
|
|
5725
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
5550
5726
|
...{
|
|
5551
5727
|
name: "MEditorNavMenu"
|
|
5552
5728
|
},
|
|
@@ -5708,7 +5884,7 @@
|
|
|
5708
5884
|
style: vue.normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
5709
5885
|
}, [
|
|
5710
5886
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(buttons.value[key], (item, index) => {
|
|
5711
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5887
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$t, {
|
|
5712
5888
|
data: item,
|
|
5713
5889
|
key: index
|
|
5714
5890
|
}, null, 8, ["data"]);
|
|
@@ -5720,8 +5896,8 @@
|
|
|
5720
5896
|
}
|
|
5721
5897
|
});
|
|
5722
5898
|
|
|
5723
|
-
const _hoisted_1$
|
|
5724
|
-
const _sfc_main$
|
|
5899
|
+
const _hoisted_1$d = { class: "m-editor-props-panel" };
|
|
5900
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
5725
5901
|
...{
|
|
5726
5902
|
name: "MEditorPropsPanel"
|
|
5727
5903
|
},
|
|
@@ -5775,7 +5951,7 @@
|
|
|
5775
5951
|
};
|
|
5776
5952
|
__expose({ configForm, submit });
|
|
5777
5953
|
return (_ctx, _cache) => {
|
|
5778
|
-
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5954
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
5779
5955
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
5780
5956
|
vue.createVNode(vue.unref(form.MForm), {
|
|
5781
5957
|
ref_key: "configForm",
|
|
@@ -5926,7 +6102,7 @@
|
|
|
5926
6102
|
};
|
|
5927
6103
|
};
|
|
5928
6104
|
|
|
5929
|
-
const _sfc_main$
|
|
6105
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
5930
6106
|
...{
|
|
5931
6107
|
name: "MEditorSearchInput"
|
|
5932
6108
|
},
|
|
@@ -5966,198 +6142,403 @@
|
|
|
5966
6142
|
}
|
|
5967
6143
|
});
|
|
5968
6144
|
|
|
5969
|
-
const
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
})
|
|
5978
|
-
|
|
5979
|
-
], -1);
|
|
5980
|
-
const _hoisted_3$8 = [
|
|
5981
|
-
_hoisted_2$d
|
|
5982
|
-
];
|
|
5983
|
-
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
5984
|
-
...{
|
|
5985
|
-
name: "MEditorAppManageIcon"
|
|
5986
|
-
},
|
|
5987
|
-
__name: "AppManageIcon",
|
|
5988
|
-
setup(__props) {
|
|
5989
|
-
return (_ctx, _cache) => {
|
|
5990
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$h, _hoisted_3$8);
|
|
5991
|
-
};
|
|
5992
|
-
}
|
|
5993
|
-
});
|
|
6145
|
+
const updateStatus = (nodeStatusMap, id, status) => {
|
|
6146
|
+
const nodeStatus = nodeStatusMap.get(id);
|
|
6147
|
+
if (!nodeStatus)
|
|
6148
|
+
return;
|
|
6149
|
+
utils.getKeys(status).forEach((key) => {
|
|
6150
|
+
if (nodeStatus[key] !== void 0 && status[key] !== void 0) {
|
|
6151
|
+
nodeStatus[key] = Boolean(status[key]);
|
|
6152
|
+
}
|
|
6153
|
+
});
|
|
6154
|
+
};
|
|
5994
6155
|
|
|
5995
|
-
const _hoisted_1$
|
|
5996
|
-
const _hoisted_2$
|
|
5997
|
-
const _hoisted_3$
|
|
5998
|
-
|
|
5999
|
-
|
|
6156
|
+
const _hoisted_1$c = ["draggable", "data-node-id", "data-is-container"];
|
|
6157
|
+
const _hoisted_2$7 = { class: "tree-node-label" };
|
|
6158
|
+
const _hoisted_3$3 = { class: "tree-node-tool" };
|
|
6159
|
+
const _hoisted_4$3 = {
|
|
6160
|
+
key: 0,
|
|
6161
|
+
class: "m-editor-tree-node-children"
|
|
6000
6162
|
};
|
|
6001
|
-
const _sfc_main$
|
|
6163
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
6002
6164
|
...{
|
|
6003
|
-
name: "
|
|
6165
|
+
name: "MEditorTreeNode"
|
|
6004
6166
|
},
|
|
6005
|
-
__name: "
|
|
6167
|
+
__name: "TreeNode",
|
|
6006
6168
|
props: {
|
|
6007
|
-
|
|
6169
|
+
data: {},
|
|
6170
|
+
nodeStatusMap: {},
|
|
6171
|
+
indent: { default: 0 }
|
|
6008
6172
|
},
|
|
6009
|
-
emits: ["
|
|
6010
|
-
setup(__props, {
|
|
6173
|
+
emits: ["node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
6174
|
+
setup(__props, { emit: __emit }) {
|
|
6175
|
+
const treeEmit = vue.inject("treeEmit");
|
|
6011
6176
|
const props = __props;
|
|
6012
|
-
const
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
type: "node",
|
|
6019
|
-
id,
|
|
6020
|
-
children: dep.keys.map((key) => ({ name: key, id: key, type: "key" }))
|
|
6021
|
-
}));
|
|
6022
|
-
return {
|
|
6023
|
-
id: target.id,
|
|
6024
|
-
name: target.name,
|
|
6025
|
-
type: "code",
|
|
6026
|
-
codeBlockContent: codeBlockService?.getCodeContentById(target.id),
|
|
6027
|
-
children: compNodes
|
|
6028
|
-
};
|
|
6029
|
-
})
|
|
6030
|
-
);
|
|
6031
|
-
const expandedKeys = vue.computed(() => codeList.value.map((item) => item.id));
|
|
6032
|
-
const editable = vue.computed(() => codeBlockService?.getEditStatus());
|
|
6033
|
-
const filterNode = (value, data) => {
|
|
6034
|
-
if (!value) {
|
|
6035
|
-
return true;
|
|
6177
|
+
const nodeStatus = vue.computed(
|
|
6178
|
+
() => props.nodeStatusMap?.get(props.data.id) || {
|
|
6179
|
+
selected: false,
|
|
6180
|
+
expand: false,
|
|
6181
|
+
visible: false,
|
|
6182
|
+
draggable: false
|
|
6036
6183
|
}
|
|
6037
|
-
|
|
6184
|
+
);
|
|
6185
|
+
const expanded = vue.computed(() => nodeStatus.value.expand);
|
|
6186
|
+
const selected = vue.computed(() => nodeStatus.value.selected);
|
|
6187
|
+
const visible = vue.computed(() => nodeStatus.value.visible);
|
|
6188
|
+
const draggable = vue.computed(() => nodeStatus.value.draggable);
|
|
6189
|
+
const hasChilren = vue.computed(() => props.data.items?.some((item) => props.nodeStatusMap.get(item.id)?.visible));
|
|
6190
|
+
const handleDragStart = (event) => {
|
|
6191
|
+
treeEmit?.("node-dragstart", event, props.data);
|
|
6038
6192
|
};
|
|
6039
|
-
const
|
|
6040
|
-
|
|
6041
|
-
editorService?.select(compId);
|
|
6042
|
-
stage?.select(compId);
|
|
6193
|
+
const handleDragLeave = (event) => {
|
|
6194
|
+
treeEmit?.("node-dragleave", event, props.data);
|
|
6043
6195
|
};
|
|
6044
|
-
const
|
|
6045
|
-
|
|
6046
|
-
selectComp(data.id);
|
|
6047
|
-
} else if (data.type === "key") {
|
|
6048
|
-
selectComp(node.parent.data.id);
|
|
6049
|
-
}
|
|
6196
|
+
const handleDragEnd = (event) => {
|
|
6197
|
+
treeEmit?.("node-dragend", event, props.data);
|
|
6050
6198
|
};
|
|
6051
|
-
const
|
|
6052
|
-
|
|
6199
|
+
const nodeContentmenuHandler = (event) => {
|
|
6200
|
+
treeEmit?.("node-contextmenu", event, props.data);
|
|
6053
6201
|
};
|
|
6054
|
-
const
|
|
6055
|
-
|
|
6056
|
-
const existBinds = Boolean(currentCode?.children.length);
|
|
6057
|
-
const undeleteableList = codeBlockService?.getUndeletableList() || [];
|
|
6058
|
-
if (!existBinds && !undeleteableList.includes(id)) {
|
|
6059
|
-
await design.tMagicMessageBox.confirm("确定删除该代码块吗?", "提示", {
|
|
6060
|
-
confirmButtonText: "确定",
|
|
6061
|
-
cancelButtonText: "取消",
|
|
6062
|
-
type: "warning"
|
|
6063
|
-
});
|
|
6064
|
-
emit("remove", id);
|
|
6065
|
-
} else {
|
|
6066
|
-
if (typeof props.customError === "function") {
|
|
6067
|
-
props.customError(id, existBinds ? CodeDeleteErrorType.BIND : CodeDeleteErrorType.UNDELETEABLE);
|
|
6068
|
-
} else {
|
|
6069
|
-
design.tMagicMessage.error("代码块删除失败");
|
|
6070
|
-
}
|
|
6071
|
-
}
|
|
6202
|
+
const mouseenterHandler = (event) => {
|
|
6203
|
+
treeEmit?.("node-mouseenter", event, props.data);
|
|
6072
6204
|
};
|
|
6073
|
-
const
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6205
|
+
const expandHandler = () => {
|
|
6206
|
+
updateStatus(props.nodeStatusMap, props.data.id, {
|
|
6207
|
+
expand: !expanded.value
|
|
6208
|
+
});
|
|
6209
|
+
};
|
|
6210
|
+
const nodeClickHandler = (event) => {
|
|
6211
|
+
treeEmit?.("node-click", event, props.data);
|
|
6212
|
+
};
|
|
6213
|
+
return (_ctx, _cache) => {
|
|
6214
|
+
const _component_TreeNode = vue.resolveComponent("TreeNode", true);
|
|
6215
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
6216
|
+
class: "m-editor-tree-node",
|
|
6217
|
+
draggable: draggable.value,
|
|
6218
|
+
"data-node-id": _ctx.data.id,
|
|
6219
|
+
"data-is-container": Array.isArray(_ctx.data.items),
|
|
6220
|
+
onDragstart: handleDragStart,
|
|
6221
|
+
onDragleave: handleDragLeave,
|
|
6222
|
+
onDragend: handleDragEnd
|
|
6223
|
+
}, [
|
|
6224
|
+
vue.createElementVNode("div", {
|
|
6225
|
+
class: vue.normalizeClass(["tree-node", { selected: selected.value, expanded: expanded.value }]),
|
|
6226
|
+
style: vue.normalizeStyle(`padding-left: ${_ctx.indent}px`),
|
|
6227
|
+
onContextmenu: nodeContentmenuHandler,
|
|
6228
|
+
onMouseenter: mouseenterHandler
|
|
6229
|
+
}, [
|
|
6230
|
+
vue.createVNode(_sfc_main$K, {
|
|
6231
|
+
class: "expand-icon",
|
|
6232
|
+
style: vue.normalizeStyle(hasChilren.value ? "" : "color: transparent; cursor: default"),
|
|
6233
|
+
icon: expanded.value ? vue.unref(iconsVue.ArrowDown) : vue.unref(iconsVue.ArrowRight),
|
|
6234
|
+
onClick: expandHandler
|
|
6235
|
+
}, null, 8, ["style", "icon"]),
|
|
6236
|
+
vue.createElementVNode("div", {
|
|
6237
|
+
class: "tree-node-content",
|
|
6238
|
+
onClick: nodeClickHandler
|
|
6239
|
+
}, [
|
|
6240
|
+
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
6241
|
+
vue.createElementVNode("div", _hoisted_2$7, [
|
|
6242
|
+
vue.renderSlot(_ctx.$slots, "tree-node-label", { data: _ctx.data }, () => [
|
|
6243
|
+
vue.createTextVNode(vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1)
|
|
6244
|
+
])
|
|
6245
|
+
]),
|
|
6246
|
+
vue.createElementVNode("div", _hoisted_3$3, [
|
|
6247
|
+
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: _ctx.data })
|
|
6248
|
+
])
|
|
6249
|
+
])
|
|
6250
|
+
])
|
|
6251
|
+
], 38),
|
|
6252
|
+
hasChilren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
|
|
6253
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (item) => {
|
|
6254
|
+
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
6255
|
+
key: item.id,
|
|
6256
|
+
data: item,
|
|
6257
|
+
"node-status-map": _ctx.nodeStatusMap,
|
|
6258
|
+
indent: _ctx.indent + 11
|
|
6259
|
+
}, {
|
|
6260
|
+
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
6261
|
+
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
6262
|
+
]),
|
|
6263
|
+
"tree-node-label": vue.withCtx(({ data: nodeData }) => [
|
|
6264
|
+
vue.renderSlot(_ctx.$slots, "tree-node-label", { data: nodeData })
|
|
6265
|
+
]),
|
|
6266
|
+
"tree-node-tool": vue.withCtx(({ data: nodeData }) => [
|
|
6267
|
+
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
6268
|
+
]),
|
|
6269
|
+
_: 2
|
|
6270
|
+
}, 1032, ["data", "node-status-map", "indent"]);
|
|
6271
|
+
}), 128))
|
|
6272
|
+
])) : vue.createCommentVNode("", true)
|
|
6273
|
+
], 40, _hoisted_1$c)), [
|
|
6274
|
+
[vue.vShow, visible.value]
|
|
6275
|
+
]);
|
|
6276
|
+
};
|
|
6277
|
+
}
|
|
6278
|
+
});
|
|
6279
|
+
|
|
6280
|
+
const _hoisted_1$b = { key: 1 };
|
|
6281
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
6282
|
+
...{
|
|
6283
|
+
name: "MEditorTree"
|
|
6284
|
+
},
|
|
6285
|
+
__name: "Tree",
|
|
6286
|
+
props: {
|
|
6287
|
+
data: {},
|
|
6288
|
+
nodeStatusMap: {},
|
|
6289
|
+
indent: { default: 0 },
|
|
6290
|
+
emptyText: { default: "暂无数据" }
|
|
6291
|
+
},
|
|
6292
|
+
emits: ["node-dragover", "node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
6293
|
+
setup(__props, { emit: __emit }) {
|
|
6294
|
+
const emit = __emit;
|
|
6295
|
+
vue.provide("treeEmit", emit);
|
|
6296
|
+
const handleDragOver = (event) => {
|
|
6297
|
+
emit("node-dragover", event);
|
|
6298
|
+
};
|
|
6299
|
+
return (_ctx, _cache) => {
|
|
6300
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6301
|
+
class: "m-editor-tree",
|
|
6302
|
+
onDragover: handleDragOver
|
|
6303
|
+
}, [
|
|
6304
|
+
_ctx.data?.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.data, (item) => {
|
|
6305
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$p, {
|
|
6306
|
+
key: item.id,
|
|
6307
|
+
data: item,
|
|
6308
|
+
indent: _ctx.indent,
|
|
6309
|
+
"node-status-map": _ctx.nodeStatusMap
|
|
6310
|
+
}, {
|
|
6311
|
+
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
6312
|
+
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
6313
|
+
]),
|
|
6314
|
+
"tree-node-label": vue.withCtx(({ data: nodeData }) => [
|
|
6315
|
+
vue.renderSlot(_ctx.$slots, "tree-node-label", { data: nodeData })
|
|
6316
|
+
]),
|
|
6317
|
+
"tree-node-tool": vue.withCtx(({ data: nodeData }) => [
|
|
6318
|
+
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
6319
|
+
]),
|
|
6320
|
+
_: 2
|
|
6321
|
+
}, 1032, ["data", "indent", "node-status-map"]);
|
|
6322
|
+
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
6323
|
+
vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
6324
|
+
]))
|
|
6325
|
+
], 32);
|
|
6326
|
+
};
|
|
6327
|
+
}
|
|
6328
|
+
});
|
|
6329
|
+
|
|
6330
|
+
const useFilter = (nodeData, nodeStatusMap, filterNodeMethod) => {
|
|
6331
|
+
const filterIsMatch = (value, data) => {
|
|
6332
|
+
const string = !Array.isArray(value) ? [value] : value;
|
|
6333
|
+
if (!string.length) {
|
|
6334
|
+
return true;
|
|
6335
|
+
}
|
|
6336
|
+
return string.some((v) => filterNodeMethod(v, data));
|
|
6337
|
+
};
|
|
6338
|
+
const filter = (text) => {
|
|
6339
|
+
if (!nodeData.value.length)
|
|
6340
|
+
return;
|
|
6341
|
+
nodeData.value.forEach((node) => {
|
|
6342
|
+
traverseNode(node, (node2, parents) => {
|
|
6343
|
+
if (!nodeStatusMap.value)
|
|
6344
|
+
return;
|
|
6345
|
+
const visible = filterIsMatch(text, node2);
|
|
6346
|
+
if (visible && parents.length) {
|
|
6347
|
+
parents.forEach((parent) => {
|
|
6348
|
+
updateStatus(nodeStatusMap.value, parent.id, {
|
|
6349
|
+
visible,
|
|
6350
|
+
expand: true
|
|
6351
|
+
});
|
|
6352
|
+
});
|
|
6353
|
+
}
|
|
6354
|
+
updateStatus(nodeStatusMap.value, node2.id, {
|
|
6355
|
+
visible
|
|
6356
|
+
});
|
|
6357
|
+
});
|
|
6358
|
+
});
|
|
6359
|
+
};
|
|
6360
|
+
return {
|
|
6361
|
+
filterText: vue.ref(""),
|
|
6362
|
+
filterTextChangeHandler(text) {
|
|
6363
|
+
filter(text);
|
|
6364
|
+
}
|
|
6365
|
+
};
|
|
6366
|
+
};
|
|
6367
|
+
|
|
6368
|
+
const createPageNodeStatus$1 = (nodeData, initalLayerNodeStatus) => {
|
|
6369
|
+
const map = /* @__PURE__ */ new Map();
|
|
6370
|
+
nodeData.forEach(
|
|
6371
|
+
(node) => traverseNode(node, (node2) => {
|
|
6372
|
+
map.set(
|
|
6373
|
+
node2.id,
|
|
6374
|
+
initalLayerNodeStatus?.get(node2.id) || {
|
|
6375
|
+
visible: true,
|
|
6376
|
+
expand: false,
|
|
6377
|
+
selected: false,
|
|
6378
|
+
draggable: false
|
|
6379
|
+
}
|
|
6380
|
+
);
|
|
6381
|
+
})
|
|
6382
|
+
);
|
|
6383
|
+
return map;
|
|
6384
|
+
};
|
|
6385
|
+
const useNodeStatus$1 = (nodeData) => {
|
|
6386
|
+
const nodeStatusMap = vue.ref(/* @__PURE__ */ new Map());
|
|
6387
|
+
vue.watch(
|
|
6388
|
+
nodeData,
|
|
6389
|
+
(nodeData2) => {
|
|
6390
|
+
nodeStatusMap.value = createPageNodeStatus$1(nodeData2, nodeStatusMap.value);
|
|
6391
|
+
},
|
|
6392
|
+
{
|
|
6393
|
+
immediate: true,
|
|
6394
|
+
deep: true
|
|
6395
|
+
}
|
|
6396
|
+
);
|
|
6397
|
+
return {
|
|
6398
|
+
nodeStatusMap
|
|
6399
|
+
};
|
|
6400
|
+
};
|
|
6401
|
+
|
|
6402
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
6403
|
+
...{
|
|
6404
|
+
name: "MEditorCodeBlockList"
|
|
6405
|
+
},
|
|
6406
|
+
__name: "CodeBlockList",
|
|
6407
|
+
props: {
|
|
6408
|
+
customError: { type: Function }
|
|
6409
|
+
},
|
|
6410
|
+
emits: ["edit", "remove"],
|
|
6411
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
6412
|
+
const props = __props;
|
|
6413
|
+
const emit = __emit;
|
|
6414
|
+
const services = vue.inject("services");
|
|
6415
|
+
const { codeBlockService, depService, editorService } = services || {};
|
|
6416
|
+
const codeList = vue.computed(
|
|
6417
|
+
() => Object.values(depService?.getTargets(dep.DepTargetType.CODE_BLOCK) || {}).map((target) => {
|
|
6418
|
+
const compNodes = Object.entries(target.deps).map(([id, dep]) => ({
|
|
6419
|
+
name: dep.name,
|
|
6420
|
+
type: "node",
|
|
6421
|
+
id: `${target.id}_${id}`,
|
|
6422
|
+
key: id,
|
|
6423
|
+
items: dep.keys.map((key) => {
|
|
6424
|
+
const data2 = { name: `${key}`, id: `${target.id}_${id}_${key}`, type: "key" };
|
|
6425
|
+
return data2;
|
|
6426
|
+
})
|
|
6427
|
+
}));
|
|
6428
|
+
const data = {
|
|
6429
|
+
id: target.id,
|
|
6430
|
+
key: target.id,
|
|
6431
|
+
name: target.name,
|
|
6432
|
+
type: "code",
|
|
6433
|
+
codeBlockContent: codeBlockService?.getCodeContentById(target.id),
|
|
6434
|
+
items: compNodes
|
|
6435
|
+
};
|
|
6436
|
+
return data;
|
|
6437
|
+
})
|
|
6438
|
+
);
|
|
6439
|
+
const filterNode = (value, data) => {
|
|
6440
|
+
if (!value) {
|
|
6441
|
+
return true;
|
|
6442
|
+
}
|
|
6443
|
+
return `${data.name}${data.id}`.toLocaleLowerCase().includes(value.toLocaleLowerCase());
|
|
6444
|
+
};
|
|
6445
|
+
const { nodeStatusMap } = useNodeStatus$1(codeList);
|
|
6446
|
+
const { filterTextChangeHandler } = useFilter(codeList, nodeStatusMap, filterNode);
|
|
6447
|
+
const editable = vue.computed(() => codeBlockService?.getEditStatus());
|
|
6448
|
+
const selectComp = (compId) => {
|
|
6449
|
+
const stage = editorService?.get("stage");
|
|
6450
|
+
editorService?.select(compId);
|
|
6451
|
+
stage?.select(compId);
|
|
6452
|
+
};
|
|
6453
|
+
const clickHandler = (event, data) => {
|
|
6454
|
+
if (data.type === "node") {
|
|
6455
|
+
selectComp(data.key);
|
|
6456
|
+
}
|
|
6457
|
+
};
|
|
6458
|
+
const editCode = (id) => {
|
|
6459
|
+
emit("edit", id);
|
|
6460
|
+
};
|
|
6461
|
+
const deleteCode = async (id) => {
|
|
6462
|
+
const currentCode = codeList.value.find((codeItem) => codeItem.id === id);
|
|
6463
|
+
const existBinds = Boolean(currentCode?.items?.length);
|
|
6464
|
+
const undeleteableList = codeBlockService?.getUndeletableList() || [];
|
|
6465
|
+
if (!existBinds && !undeleteableList.includes(id)) {
|
|
6466
|
+
await design.tMagicMessageBox.confirm("确定删除该代码块吗?", "提示", {
|
|
6467
|
+
confirmButtonText: "确定",
|
|
6468
|
+
cancelButtonText: "取消",
|
|
6469
|
+
type: "warning"
|
|
6470
|
+
});
|
|
6471
|
+
emit("remove", id);
|
|
6472
|
+
} else {
|
|
6473
|
+
if (typeof props.customError === "function") {
|
|
6474
|
+
props.customError(id, existBinds ? CodeDeleteErrorType.BIND : CodeDeleteErrorType.UNDELETEABLE);
|
|
6475
|
+
} else {
|
|
6476
|
+
design.tMagicMessage.error("代码块删除失败");
|
|
6477
|
+
}
|
|
6077
6478
|
}
|
|
6479
|
+
};
|
|
6480
|
+
__expose({
|
|
6481
|
+
filter: filterTextChangeHandler
|
|
6078
6482
|
});
|
|
6079
6483
|
return (_ctx, _cache) => {
|
|
6080
|
-
return vue.openBlock(), vue.createBlock(
|
|
6081
|
-
ref_key: "tree",
|
|
6082
|
-
ref: tree,
|
|
6083
|
-
class: "magic-editor-layer-tree",
|
|
6084
|
-
"node-key": "id",
|
|
6085
|
-
"empty-text": "暂无代码块",
|
|
6086
|
-
"default-expanded-keys": expandedKeys.value,
|
|
6087
|
-
"expand-on-click-node": false,
|
|
6484
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
6088
6485
|
data: codeList.value,
|
|
6089
|
-
|
|
6090
|
-
children: "children",
|
|
6091
|
-
label: "name",
|
|
6092
|
-
value: "id"
|
|
6093
|
-
},
|
|
6094
|
-
"highlight-current": true,
|
|
6095
|
-
"filter-node-method": filterNode,
|
|
6486
|
+
"node-status-map": vue.unref(nodeStatusMap),
|
|
6096
6487
|
onNodeClick: clickHandler
|
|
6097
6488
|
}, {
|
|
6098
|
-
|
|
6489
|
+
"tree-node-label": vue.withCtx(({ data }) => [
|
|
6099
6490
|
vue.createElementVNode("div", {
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
vue.
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
]),
|
|
6143
|
-
_: 2
|
|
6144
|
-
}, 1024)) : vue.createCommentVNode("", true),
|
|
6145
|
-
vue.renderSlot(_ctx.$slots, "code-block-panel-tool", {
|
|
6146
|
-
id: data.id,
|
|
6147
|
-
data: data.codeBlockContent
|
|
6148
|
-
})
|
|
6149
|
-
])) : vue.createCommentVNode("", true)
|
|
6150
|
-
])
|
|
6151
|
-
], 8, _hoisted_1$g)
|
|
6491
|
+
class: vue.normalizeClass({
|
|
6492
|
+
code: data.type === "code",
|
|
6493
|
+
hook: data.type === "key",
|
|
6494
|
+
disabled: data.type === "key" || data.type === "code"
|
|
6495
|
+
})
|
|
6496
|
+
}, vue.toDisplayString(data.name) + " " + vue.toDisplayString(data.key ? `(${data.key})` : ""), 3)
|
|
6497
|
+
]),
|
|
6498
|
+
"tree-node-tool": vue.withCtx(({ data }) => [
|
|
6499
|
+
data.type === "code" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
6500
|
+
key: 0,
|
|
6501
|
+
effect: "dark",
|
|
6502
|
+
content: editable.value ? "编辑" : "查看",
|
|
6503
|
+
placement: "bottom"
|
|
6504
|
+
}, {
|
|
6505
|
+
default: vue.withCtx(() => [
|
|
6506
|
+
vue.createVNode(_sfc_main$K, {
|
|
6507
|
+
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
6508
|
+
class: "edit-icon",
|
|
6509
|
+
onClick: vue.withModifiers(($event) => editCode(`${data.key}`), ["stop"])
|
|
6510
|
+
}, null, 8, ["icon", "onClick"])
|
|
6511
|
+
]),
|
|
6512
|
+
_: 2
|
|
6513
|
+
}, 1032, ["content"])) : vue.createCommentVNode("", true),
|
|
6514
|
+
data.type === "code" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
6515
|
+
key: 1,
|
|
6516
|
+
effect: "dark",
|
|
6517
|
+
content: "删除",
|
|
6518
|
+
placement: "bottom"
|
|
6519
|
+
}, {
|
|
6520
|
+
default: vue.withCtx(() => [
|
|
6521
|
+
vue.createVNode(_sfc_main$K, {
|
|
6522
|
+
icon: vue.unref(iconsVue.Close),
|
|
6523
|
+
class: "edit-icon",
|
|
6524
|
+
onClick: vue.withModifiers(($event) => deleteCode(`${data.key}`), ["stop"])
|
|
6525
|
+
}, null, 8, ["icon", "onClick"])
|
|
6526
|
+
]),
|
|
6527
|
+
_: 2
|
|
6528
|
+
}, 1024)) : vue.createCommentVNode("", true),
|
|
6529
|
+
vue.renderSlot(_ctx.$slots, "code-block-panel-tool", {
|
|
6530
|
+
id: data.key,
|
|
6531
|
+
data
|
|
6532
|
+
})
|
|
6152
6533
|
]),
|
|
6153
6534
|
_: 3
|
|
6154
|
-
}, 8, ["
|
|
6535
|
+
}, 8, ["data", "node-status-map"]);
|
|
6155
6536
|
};
|
|
6156
6537
|
}
|
|
6157
6538
|
});
|
|
6158
6539
|
|
|
6159
|
-
const _hoisted_1$
|
|
6160
|
-
const _sfc_main$
|
|
6540
|
+
const _hoisted_1$a = { class: "search-wrapper" };
|
|
6541
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
6161
6542
|
...{
|
|
6162
6543
|
name: "MEditorCodeBlockListPanel"
|
|
6163
6544
|
},
|
|
@@ -6176,11 +6557,11 @@
|
|
|
6176
6557
|
};
|
|
6177
6558
|
return (_ctx, _cache) => {
|
|
6178
6559
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
6179
|
-
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-
|
|
6560
|
+
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-layer-panel" }, {
|
|
6180
6561
|
default: vue.withCtx(() => [
|
|
6181
6562
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
6182
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6183
|
-
vue.createVNode(_sfc_main$
|
|
6563
|
+
vue.createElementVNode("div", _hoisted_1$a, [
|
|
6564
|
+
vue.createVNode(_sfc_main$q, { onSearch: filterTextChangeHandler }),
|
|
6184
6565
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
6185
6566
|
key: 0,
|
|
6186
6567
|
class: "create-code-button",
|
|
@@ -6196,7 +6577,7 @@
|
|
|
6196
6577
|
vue.renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
6197
6578
|
])
|
|
6198
6579
|
]),
|
|
6199
|
-
vue.createVNode(_sfc_main$
|
|
6580
|
+
vue.createVNode(_sfc_main$n, {
|
|
6200
6581
|
ref_key: "codeBlockList",
|
|
6201
6582
|
ref: codeBlockList,
|
|
6202
6583
|
"custom-error": _ctx.customError,
|
|
@@ -6214,7 +6595,7 @@
|
|
|
6214
6595
|
]),
|
|
6215
6596
|
_: 3
|
|
6216
6597
|
}),
|
|
6217
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6598
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
|
|
6218
6599
|
key: 0,
|
|
6219
6600
|
ref_key: "codeBlockEditor",
|
|
6220
6601
|
ref: codeBlockEditor,
|
|
@@ -6228,7 +6609,7 @@
|
|
|
6228
6609
|
}
|
|
6229
6610
|
});
|
|
6230
6611
|
|
|
6231
|
-
const _sfc_main$
|
|
6612
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
6232
6613
|
...{
|
|
6233
6614
|
name: "MEditorDataSourceConfigPanel"
|
|
6234
6615
|
},
|
|
@@ -6284,13 +6665,7 @@
|
|
|
6284
6665
|
}
|
|
6285
6666
|
});
|
|
6286
6667
|
|
|
6287
|
-
const
|
|
6288
|
-
const _hoisted_2$b = { class: "list-item" };
|
|
6289
|
-
const _hoisted_3$6 = {
|
|
6290
|
-
key: 2,
|
|
6291
|
-
class: "right-tool"
|
|
6292
|
-
};
|
|
6293
|
-
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
6668
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
6294
6669
|
...{
|
|
6295
6670
|
name: "MEditorDataSourceList"
|
|
6296
6671
|
},
|
|
@@ -6304,20 +6679,27 @@
|
|
|
6304
6679
|
const dsDep = vue.computed(() => depService?.getTargets(dep.DepTargetType.DATA_SOURCE) || {});
|
|
6305
6680
|
const dsMethodDep = vue.computed(() => depService?.getTargets(dep.DepTargetType.DATA_SOURCE_METHOD) || {});
|
|
6306
6681
|
const dsCondDep = vue.computed(() => depService?.getTargets(dep.DepTargetType.DATA_SOURCE_COND) || {});
|
|
6307
|
-
const getKeyTreeConfig = (dep, type) => dep.keys.map((key) => ({
|
|
6308
|
-
|
|
6682
|
+
const getKeyTreeConfig = (dep, type, parentKey) => dep.keys.map((key) => ({
|
|
6683
|
+
name: key,
|
|
6684
|
+
id: `${parentKey}_${key}`,
|
|
6685
|
+
type: "key",
|
|
6686
|
+
isMethod: type === "method",
|
|
6687
|
+
isCond: type === "cond"
|
|
6688
|
+
}));
|
|
6689
|
+
const getNodeTreeConfig = (id, dep, type, parentKey) => ({
|
|
6309
6690
|
name: dep.name,
|
|
6310
6691
|
type: "node",
|
|
6311
|
-
id
|
|
6312
|
-
|
|
6692
|
+
id: `${parentKey}_${id}`,
|
|
6693
|
+
key: id,
|
|
6694
|
+
items: getKeyTreeConfig(dep, type, `${parentKey}_${id}`)
|
|
6313
6695
|
});
|
|
6314
|
-
const mergeChildren = (
|
|
6696
|
+
const mergeChildren = (dsId, items, deps, type) => {
|
|
6315
6697
|
Object.entries(deps).forEach(([id, dep]) => {
|
|
6316
|
-
const nodeItem =
|
|
6698
|
+
const nodeItem = items.find((item) => item.key === id);
|
|
6317
6699
|
if (nodeItem) {
|
|
6318
|
-
nodeItem.
|
|
6700
|
+
nodeItem.items = nodeItem.items.concat(getKeyTreeConfig(dep, type, nodeItem.key));
|
|
6319
6701
|
} else {
|
|
6320
|
-
|
|
6702
|
+
items.push(getNodeTreeConfig(id, dep, type, dsId));
|
|
6321
6703
|
}
|
|
6322
6704
|
});
|
|
6323
6705
|
};
|
|
@@ -6326,18 +6708,27 @@
|
|
|
6326
6708
|
const dsDeps = dsDep.value[ds.id]?.deps || {};
|
|
6327
6709
|
const dsMethodDeps = dsMethodDep.value[ds.id]?.deps || {};
|
|
6328
6710
|
const dsCondDeps = dsCondDep.value[ds.id]?.deps || {};
|
|
6329
|
-
const
|
|
6330
|
-
mergeChildren(
|
|
6331
|
-
mergeChildren(
|
|
6332
|
-
mergeChildren(
|
|
6711
|
+
const items = [];
|
|
6712
|
+
mergeChildren(ds.id, items, dsDeps);
|
|
6713
|
+
mergeChildren(ds.id, items, dsMethodDeps, "method");
|
|
6714
|
+
mergeChildren(ds.id, items, dsCondDeps, "cond");
|
|
6333
6715
|
return {
|
|
6334
6716
|
id: ds.id,
|
|
6717
|
+
key: ds.id,
|
|
6335
6718
|
name: ds.title,
|
|
6336
6719
|
type: "ds",
|
|
6337
|
-
|
|
6720
|
+
items
|
|
6338
6721
|
};
|
|
6339
6722
|
})
|
|
6340
6723
|
);
|
|
6724
|
+
const filterNode = (value, data) => {
|
|
6725
|
+
if (!value) {
|
|
6726
|
+
return true;
|
|
6727
|
+
}
|
|
6728
|
+
return `${data.name}${data.id}`.toLocaleLowerCase().includes(value.toLocaleLowerCase());
|
|
6729
|
+
};
|
|
6730
|
+
const { nodeStatusMap } = useNodeStatus$1(list);
|
|
6731
|
+
const { filterTextChangeHandler } = useFilter(list, nodeStatusMap, filterNode);
|
|
6341
6732
|
const editHandler = (id) => {
|
|
6342
6733
|
emit("edit", id);
|
|
6343
6734
|
};
|
|
@@ -6354,95 +6745,71 @@
|
|
|
6354
6745
|
editorService?.select(compId);
|
|
6355
6746
|
stage?.select(compId);
|
|
6356
6747
|
};
|
|
6357
|
-
const clickHandler = (
|
|
6748
|
+
const clickHandler = (event, data) => {
|
|
6358
6749
|
if (data.type === "node") {
|
|
6359
|
-
selectComp(data.
|
|
6360
|
-
} else if (data.type === "key") {
|
|
6361
|
-
selectComp(node.parent.data.id);
|
|
6750
|
+
selectComp(data.key);
|
|
6362
6751
|
}
|
|
6363
6752
|
};
|
|
6364
|
-
const tree = vue.ref();
|
|
6365
6753
|
__expose({
|
|
6366
|
-
filter
|
|
6367
|
-
tree.value?.filter(val);
|
|
6368
|
-
}
|
|
6754
|
+
filter: filterTextChangeHandler
|
|
6369
6755
|
});
|
|
6370
6756
|
return (_ctx, _cache) => {
|
|
6371
|
-
return vue.openBlock(), vue.createBlock(
|
|
6372
|
-
ref_key: "tree",
|
|
6373
|
-
ref: tree,
|
|
6374
|
-
class: "magic-editor-layer-tree",
|
|
6375
|
-
"node-key": "id",
|
|
6376
|
-
"empty-text": "暂无代码块",
|
|
6377
|
-
"default-expand-all": "",
|
|
6378
|
-
"expand-on-click-node": false,
|
|
6757
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
6379
6758
|
data: list.value,
|
|
6380
|
-
"
|
|
6759
|
+
"node-status-map": vue.unref(nodeStatusMap),
|
|
6381
6760
|
onNodeClick: clickHandler
|
|
6382
6761
|
}, {
|
|
6383
|
-
|
|
6762
|
+
"tree-node-label": vue.withCtx(({ data }) => [
|
|
6384
6763
|
vue.createElementVNode("div", {
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
vue.
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
vue.createVNode(_sfc_main$N, {
|
|
6425
|
-
icon: vue.unref(iconsVue.Close),
|
|
6426
|
-
class: "edit-icon",
|
|
6427
|
-
onClick: vue.withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
|
|
6428
|
-
}, null, 8, ["icon", "onClick"])
|
|
6429
|
-
]),
|
|
6430
|
-
_: 2
|
|
6431
|
-
}, 1024)) : vue.createCommentVNode("", true),
|
|
6432
|
-
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
6433
|
-
])) : vue.createCommentVNode("", true)
|
|
6434
|
-
])
|
|
6435
|
-
], 8, _hoisted_1$e)
|
|
6764
|
+
class: vue.normalizeClass({
|
|
6765
|
+
ds: data.type === "ds",
|
|
6766
|
+
hook: data.type === "key",
|
|
6767
|
+
disabled: data.type === "key" || data.type === "ds"
|
|
6768
|
+
})
|
|
6769
|
+
}, vue.toDisplayString(data.name) + " " + vue.toDisplayString(data.key ? `(${data.key})` : ""), 3)
|
|
6770
|
+
]),
|
|
6771
|
+
"tree-node-tool": vue.withCtx(({ data }) => [
|
|
6772
|
+
data.type === "ds" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
6773
|
+
key: 0,
|
|
6774
|
+
effect: "dark",
|
|
6775
|
+
content: editable.value ? "编辑" : "查看",
|
|
6776
|
+
placement: "bottom"
|
|
6777
|
+
}, {
|
|
6778
|
+
default: vue.withCtx(() => [
|
|
6779
|
+
vue.createVNode(_sfc_main$K, {
|
|
6780
|
+
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
6781
|
+
class: "edit-icon",
|
|
6782
|
+
onClick: vue.withModifiers(($event) => editHandler(`${data.key}`), ["stop"])
|
|
6783
|
+
}, null, 8, ["icon", "onClick"])
|
|
6784
|
+
]),
|
|
6785
|
+
_: 2
|
|
6786
|
+
}, 1032, ["content"])) : vue.createCommentVNode("", true),
|
|
6787
|
+
data.type === "ds" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
6788
|
+
key: 1,
|
|
6789
|
+
effect: "dark",
|
|
6790
|
+
content: "删除",
|
|
6791
|
+
placement: "bottom"
|
|
6792
|
+
}, {
|
|
6793
|
+
default: vue.withCtx(() => [
|
|
6794
|
+
vue.createVNode(_sfc_main$K, {
|
|
6795
|
+
icon: vue.unref(iconsVue.Close),
|
|
6796
|
+
class: "edit-icon",
|
|
6797
|
+
onClick: vue.withModifiers(($event) => removeHandler(`${data.key}`), ["stop"])
|
|
6798
|
+
}, null, 8, ["icon", "onClick"])
|
|
6799
|
+
]),
|
|
6800
|
+
_: 2
|
|
6801
|
+
}, 1024)) : vue.createCommentVNode("", true),
|
|
6802
|
+
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
6436
6803
|
]),
|
|
6437
6804
|
_: 3
|
|
6438
|
-
}, 8, ["data"]);
|
|
6805
|
+
}, 8, ["data", "node-status-map"]);
|
|
6439
6806
|
};
|
|
6440
6807
|
}
|
|
6441
6808
|
});
|
|
6442
6809
|
|
|
6443
|
-
const _hoisted_1$
|
|
6444
|
-
const _hoisted_2$
|
|
6445
|
-
const _sfc_main$
|
|
6810
|
+
const _hoisted_1$9 = { class: "search-wrapper" };
|
|
6811
|
+
const _hoisted_2$6 = { class: "data-source-list-panel-add-menu" };
|
|
6812
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
6446
6813
|
...{
|
|
6447
6814
|
name: "MEditorDataSourceListPanel"
|
|
6448
6815
|
},
|
|
@@ -6504,10 +6871,10 @@
|
|
|
6504
6871
|
};
|
|
6505
6872
|
return (_ctx, _cache) => {
|
|
6506
6873
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
6507
|
-
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-
|
|
6874
|
+
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
|
|
6508
6875
|
default: vue.withCtx(() => [
|
|
6509
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6510
|
-
vue.createVNode(_sfc_main$
|
|
6876
|
+
vue.createElementVNode("div", _hoisted_1$9, [
|
|
6877
|
+
vue.createVNode(_sfc_main$q, { onSearch: filterTextChangeHandler }),
|
|
6511
6878
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
6512
6879
|
key: 0,
|
|
6513
6880
|
placement: "right"
|
|
@@ -6524,9 +6891,9 @@
|
|
|
6524
6891
|
})
|
|
6525
6892
|
]),
|
|
6526
6893
|
default: vue.withCtx(() => [
|
|
6527
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
6894
|
+
vue.createElementVNode("div", _hoisted_2$6, [
|
|
6528
6895
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(datasourceTypeList.value, (item, index) => {
|
|
6529
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6896
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$t, {
|
|
6530
6897
|
data: {
|
|
6531
6898
|
type: "button",
|
|
6532
6899
|
text: item.text,
|
|
@@ -6542,14 +6909,14 @@
|
|
|
6542
6909
|
_: 1
|
|
6543
6910
|
})) : vue.createCommentVNode("", true)
|
|
6544
6911
|
]),
|
|
6545
|
-
vue.createVNode(_sfc_main$
|
|
6912
|
+
vue.createVNode(_sfc_main$k, {
|
|
6546
6913
|
onEdit: editHandler,
|
|
6547
6914
|
onRemove: removeHandler
|
|
6548
6915
|
})
|
|
6549
6916
|
]),
|
|
6550
6917
|
_: 1
|
|
6551
6918
|
}),
|
|
6552
|
-
vue.createVNode(_sfc_main$
|
|
6919
|
+
vue.createVNode(_sfc_main$l, {
|
|
6553
6920
|
ref_key: "editDialog",
|
|
6554
6921
|
ref: editDialog,
|
|
6555
6922
|
disabled: !editable.value,
|
|
@@ -6563,182 +6930,7 @@
|
|
|
6563
6930
|
}
|
|
6564
6931
|
});
|
|
6565
6932
|
|
|
6566
|
-
const
|
|
6567
|
-
const nodeStatus = nodeStatusMap.get(id);
|
|
6568
|
-
if (!nodeStatus)
|
|
6569
|
-
return;
|
|
6570
|
-
utils.getKeys(status).forEach((key) => {
|
|
6571
|
-
if (nodeStatus[key] !== void 0 && status[key] !== void 0) {
|
|
6572
|
-
nodeStatus[key] = Boolean(status[key]);
|
|
6573
|
-
}
|
|
6574
|
-
});
|
|
6575
|
-
};
|
|
6576
|
-
|
|
6577
|
-
const _hoisted_1$c = ["draggable", "data-node-id", "data-is-container"];
|
|
6578
|
-
const _hoisted_2$9 = { class: "tree-node-label" };
|
|
6579
|
-
const _hoisted_3$5 = { class: "tree-node-tool" };
|
|
6580
|
-
const _hoisted_4$5 = {
|
|
6581
|
-
key: 0,
|
|
6582
|
-
class: "m-editor-tree-node-children"
|
|
6583
|
-
};
|
|
6584
|
-
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
6585
|
-
...{
|
|
6586
|
-
name: "MEditorTreeNode"
|
|
6587
|
-
},
|
|
6588
|
-
__name: "TreeNode",
|
|
6589
|
-
props: {
|
|
6590
|
-
data: {},
|
|
6591
|
-
nodeStatusMap: {},
|
|
6592
|
-
indent: { default: 0 }
|
|
6593
|
-
},
|
|
6594
|
-
emits: ["node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
6595
|
-
setup(__props, { emit: __emit }) {
|
|
6596
|
-
const treeEmit = vue.inject("treeEmit");
|
|
6597
|
-
const props = __props;
|
|
6598
|
-
const nodeStatus = vue.computed(
|
|
6599
|
-
() => props.nodeStatusMap?.get(props.data.id) || {
|
|
6600
|
-
selected: false,
|
|
6601
|
-
expand: false,
|
|
6602
|
-
visible: false,
|
|
6603
|
-
draggable: false
|
|
6604
|
-
}
|
|
6605
|
-
);
|
|
6606
|
-
const expanded = vue.computed(() => nodeStatus.value.expand);
|
|
6607
|
-
const selected = vue.computed(() => nodeStatus.value.selected);
|
|
6608
|
-
const visible = vue.computed(() => nodeStatus.value.visible);
|
|
6609
|
-
const draggable = vue.computed(() => nodeStatus.value.draggable);
|
|
6610
|
-
const hasChilren = vue.computed(() => props.data.items && props.data.items.length > 0);
|
|
6611
|
-
const handleDragStart = (event) => {
|
|
6612
|
-
treeEmit?.("node-dragstart", event, props.data);
|
|
6613
|
-
};
|
|
6614
|
-
const handleDragLeave = (event) => {
|
|
6615
|
-
treeEmit?.("node-dragleave", event, props.data);
|
|
6616
|
-
};
|
|
6617
|
-
const handleDragEnd = (event) => {
|
|
6618
|
-
treeEmit?.("node-dragend", event, props.data);
|
|
6619
|
-
};
|
|
6620
|
-
const nodeContentmenuHandler = (event) => {
|
|
6621
|
-
treeEmit?.("node-contextmenu", event, props.data);
|
|
6622
|
-
};
|
|
6623
|
-
const mouseenterHandler = (event) => {
|
|
6624
|
-
treeEmit?.("node-mouseenter", event, props.data);
|
|
6625
|
-
};
|
|
6626
|
-
const expandHandler = () => {
|
|
6627
|
-
updateStatus(props.nodeStatusMap, props.data.id, {
|
|
6628
|
-
expand: !expanded.value
|
|
6629
|
-
});
|
|
6630
|
-
};
|
|
6631
|
-
const nodeClickHandler = (event) => {
|
|
6632
|
-
treeEmit?.("node-click", event, props.data);
|
|
6633
|
-
};
|
|
6634
|
-
return (_ctx, _cache) => {
|
|
6635
|
-
const _component_TreeNode = vue.resolveComponent("TreeNode", true);
|
|
6636
|
-
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
6637
|
-
class: "m-editor-tree-node",
|
|
6638
|
-
draggable: draggable.value,
|
|
6639
|
-
"data-node-id": _ctx.data.id,
|
|
6640
|
-
"data-is-container": Array.isArray(_ctx.data.items),
|
|
6641
|
-
onDragstart: handleDragStart,
|
|
6642
|
-
onDragleave: handleDragLeave,
|
|
6643
|
-
onDragend: handleDragEnd
|
|
6644
|
-
}, [
|
|
6645
|
-
vue.createElementVNode("div", {
|
|
6646
|
-
class: vue.normalizeClass(["tree-node", { selected: selected.value, expanded: expanded.value }]),
|
|
6647
|
-
style: vue.normalizeStyle(`padding-left: ${_ctx.indent}px`),
|
|
6648
|
-
onContextmenu: nodeContentmenuHandler,
|
|
6649
|
-
onMouseenter: mouseenterHandler
|
|
6650
|
-
}, [
|
|
6651
|
-
vue.createVNode(_sfc_main$N, {
|
|
6652
|
-
class: "expand-icon",
|
|
6653
|
-
style: vue.normalizeStyle(hasChilren.value ? "" : "color: transparent; cursor: default"),
|
|
6654
|
-
icon: expanded.value ? vue.unref(iconsVue.ArrowDown) : vue.unref(iconsVue.ArrowRight),
|
|
6655
|
-
onClick: expandHandler
|
|
6656
|
-
}, null, 8, ["style", "icon"]),
|
|
6657
|
-
vue.createElementVNode("div", {
|
|
6658
|
-
class: "tree-node-content",
|
|
6659
|
-
onClick: nodeClickHandler
|
|
6660
|
-
}, [
|
|
6661
|
-
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
6662
|
-
vue.createElementVNode("div", _hoisted_2$9, vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1),
|
|
6663
|
-
vue.createElementVNode("div", _hoisted_3$5, [
|
|
6664
|
-
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: _ctx.data })
|
|
6665
|
-
])
|
|
6666
|
-
])
|
|
6667
|
-
])
|
|
6668
|
-
], 38),
|
|
6669
|
-
hasChilren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [
|
|
6670
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (item) => {
|
|
6671
|
-
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
6672
|
-
key: item.id,
|
|
6673
|
-
data: item,
|
|
6674
|
-
"node-status-map": _ctx.nodeStatusMap,
|
|
6675
|
-
indent: _ctx.indent + 11
|
|
6676
|
-
}, {
|
|
6677
|
-
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
6678
|
-
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
6679
|
-
]),
|
|
6680
|
-
"tree-node-tool": vue.withCtx(({ data: nodeData }) => [
|
|
6681
|
-
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
6682
|
-
]),
|
|
6683
|
-
_: 2
|
|
6684
|
-
}, 1032, ["data", "node-status-map", "indent"]);
|
|
6685
|
-
}), 128))
|
|
6686
|
-
])) : vue.createCommentVNode("", true)
|
|
6687
|
-
], 40, _hoisted_1$c)), [
|
|
6688
|
-
[vue.vShow, visible.value]
|
|
6689
|
-
]);
|
|
6690
|
-
};
|
|
6691
|
-
}
|
|
6692
|
-
});
|
|
6693
|
-
|
|
6694
|
-
const _hoisted_1$b = { key: 1 };
|
|
6695
|
-
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
6696
|
-
...{
|
|
6697
|
-
name: "MEditorTree"
|
|
6698
|
-
},
|
|
6699
|
-
__name: "Tree",
|
|
6700
|
-
props: {
|
|
6701
|
-
data: {},
|
|
6702
|
-
nodeStatusMap: {},
|
|
6703
|
-
indent: { default: 0 },
|
|
6704
|
-
emptyText: { default: "暂无数据" }
|
|
6705
|
-
},
|
|
6706
|
-
emits: ["node-dragover", "node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
6707
|
-
setup(__props, { emit: __emit }) {
|
|
6708
|
-
const emit = __emit;
|
|
6709
|
-
vue.provide("treeEmit", emit);
|
|
6710
|
-
const handleDragOver = (event) => {
|
|
6711
|
-
emit("node-dragover", event);
|
|
6712
|
-
};
|
|
6713
|
-
return (_ctx, _cache) => {
|
|
6714
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6715
|
-
class: "m-editor-tree",
|
|
6716
|
-
onDragover: handleDragOver
|
|
6717
|
-
}, [
|
|
6718
|
-
_ctx.data?.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.data, (item) => {
|
|
6719
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
6720
|
-
key: item.id,
|
|
6721
|
-
data: item,
|
|
6722
|
-
indent: _ctx.indent,
|
|
6723
|
-
"node-status-map": _ctx.nodeStatusMap
|
|
6724
|
-
}, {
|
|
6725
|
-
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
6726
|
-
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
6727
|
-
]),
|
|
6728
|
-
"tree-node-tool": vue.withCtx(({ data: nodeData }) => [
|
|
6729
|
-
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
6730
|
-
]),
|
|
6731
|
-
_: 2
|
|
6732
|
-
}, 1032, ["data", "indent", "node-status-map"]);
|
|
6733
|
-
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
6734
|
-
vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
6735
|
-
]))
|
|
6736
|
-
], 32);
|
|
6737
|
-
};
|
|
6738
|
-
}
|
|
6739
|
-
});
|
|
6740
|
-
|
|
6741
|
-
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
6933
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
6742
6934
|
...{
|
|
6743
6935
|
name: "MEditorContentMenu"
|
|
6744
6936
|
},
|
|
@@ -6869,7 +7061,7 @@
|
|
|
6869
7061
|
vue.renderSlot(_ctx.$slots, "title"),
|
|
6870
7062
|
vue.createElementVNode("div", null, [
|
|
6871
7063
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuData, (item, index) => {
|
|
6872
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7064
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$t, {
|
|
6873
7065
|
"event-type": "mouseup",
|
|
6874
7066
|
ref_for: true,
|
|
6875
7067
|
ref_key: "buttons",
|
|
@@ -6904,7 +7096,7 @@
|
|
|
6904
7096
|
}
|
|
6905
7097
|
});
|
|
6906
7098
|
|
|
6907
|
-
const _hoisted_1$
|
|
7099
|
+
const _hoisted_1$8 = {
|
|
6908
7100
|
width: "1em",
|
|
6909
7101
|
height: "1em",
|
|
6910
7102
|
viewBox: "0 0 16 16",
|
|
@@ -6912,26 +7104,26 @@
|
|
|
6912
7104
|
fill: "currentColor",
|
|
6913
7105
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6914
7106
|
};
|
|
6915
|
-
const _hoisted_2$
|
|
7107
|
+
const _hoisted_2$5 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
6916
7108
|
"fill-rule": "evenodd",
|
|
6917
7109
|
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"
|
|
6918
7110
|
}, null, -1);
|
|
6919
|
-
const _hoisted_3$
|
|
7111
|
+
const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
6920
7112
|
"fill-rule": "evenodd",
|
|
6921
7113
|
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"
|
|
6922
7114
|
}, null, -1);
|
|
6923
|
-
const _hoisted_4$
|
|
6924
|
-
_hoisted_2$
|
|
6925
|
-
_hoisted_3$
|
|
7115
|
+
const _hoisted_4$2 = [
|
|
7116
|
+
_hoisted_2$5,
|
|
7117
|
+
_hoisted_3$2
|
|
6926
7118
|
];
|
|
6927
|
-
const _sfc_main$
|
|
7119
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
6928
7120
|
...{
|
|
6929
7121
|
name: "MEditorFolderMinusIcon"
|
|
6930
7122
|
},
|
|
6931
7123
|
__name: "FolderMinusIcon",
|
|
6932
7124
|
setup(__props) {
|
|
6933
7125
|
return (_ctx, _cache) => {
|
|
6934
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
7126
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$8, _hoisted_4$2);
|
|
6935
7127
|
};
|
|
6936
7128
|
}
|
|
6937
7129
|
});
|
|
@@ -6949,7 +7141,6 @@
|
|
|
6949
7141
|
nodes && services?.editorService?.remove(nodes);
|
|
6950
7142
|
}
|
|
6951
7143
|
});
|
|
6952
|
-
const canPaste = vue.ref(false);
|
|
6953
7144
|
const useCopyMenu = () => ({
|
|
6954
7145
|
type: "button",
|
|
6955
7146
|
text: "复制",
|
|
@@ -6957,14 +7148,13 @@
|
|
|
6957
7148
|
handler: (services) => {
|
|
6958
7149
|
const nodes = services?.editorService?.get("nodes");
|
|
6959
7150
|
nodes && services?.editorService?.copy(nodes);
|
|
6960
|
-
canPaste.value = true;
|
|
6961
7151
|
}
|
|
6962
7152
|
});
|
|
6963
7153
|
const usePasteMenu = (menu) => ({
|
|
6964
7154
|
type: "button",
|
|
6965
7155
|
text: "粘贴",
|
|
6966
7156
|
icon: vue.markRaw(iconsVue.DocumentCopy),
|
|
6967
|
-
display: () =>
|
|
7157
|
+
display: (services) => !!services?.storageService?.getItem(COPY_STORAGE_KEY),
|
|
6968
7158
|
handler: (services) => {
|
|
6969
7159
|
const nodes = services?.editorService?.get("nodes");
|
|
6970
7160
|
if (!nodes || nodes.length === 0)
|
|
@@ -7011,7 +7201,7 @@
|
|
|
7011
7201
|
};
|
|
7012
7202
|
};
|
|
7013
7203
|
|
|
7014
|
-
const _sfc_main$
|
|
7204
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
7015
7205
|
...{
|
|
7016
7206
|
name: "MEditorLayerMenu"
|
|
7017
7207
|
},
|
|
@@ -7075,7 +7265,7 @@
|
|
|
7075
7265
|
{
|
|
7076
7266
|
type: "button",
|
|
7077
7267
|
text: "全部折叠",
|
|
7078
|
-
icon: _sfc_main$
|
|
7268
|
+
icon: _sfc_main$h,
|
|
7079
7269
|
display: () => utils.isPage(node.value),
|
|
7080
7270
|
handler: () => {
|
|
7081
7271
|
emit("collapse-all");
|
|
@@ -7101,7 +7291,7 @@
|
|
|
7101
7291
|
show
|
|
7102
7292
|
});
|
|
7103
7293
|
return (_ctx, _cache) => {
|
|
7104
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7294
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$i, {
|
|
7105
7295
|
"menu-data": menuData.value,
|
|
7106
7296
|
ref_key: "menu",
|
|
7107
7297
|
ref: menu,
|
|
@@ -7111,7 +7301,7 @@
|
|
|
7111
7301
|
}
|
|
7112
7302
|
});
|
|
7113
7303
|
|
|
7114
|
-
const _sfc_main$
|
|
7304
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
7115
7305
|
__name: "LayerNodeTool",
|
|
7116
7306
|
props: {
|
|
7117
7307
|
data: {}
|
|
@@ -7130,12 +7320,12 @@
|
|
|
7130
7320
|
};
|
|
7131
7321
|
return (_ctx, _cache) => {
|
|
7132
7322
|
return _ctx.data.type !== "page" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
7133
|
-
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7323
|
+
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
7134
7324
|
key: 0,
|
|
7135
7325
|
icon: vue.unref(iconsVue.Hide),
|
|
7136
7326
|
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => setNodeVisible(true), ["stop"])),
|
|
7137
7327
|
title: "点击显示"
|
|
7138
|
-
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7328
|
+
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
7139
7329
|
key: 1,
|
|
7140
7330
|
icon: vue.unref(iconsVue.View),
|
|
7141
7331
|
onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => setNodeVisible(false), ["stop"])),
|
|
@@ -7337,50 +7527,6 @@
|
|
|
7337
7527
|
};
|
|
7338
7528
|
};
|
|
7339
7529
|
|
|
7340
|
-
const useFilter = (nodeStatusMap, page) => {
|
|
7341
|
-
const filterIsMatch = (value, data) => {
|
|
7342
|
-
if (!value) {
|
|
7343
|
-
return true;
|
|
7344
|
-
}
|
|
7345
|
-
let name = "";
|
|
7346
|
-
if (data.name) {
|
|
7347
|
-
name = data.name;
|
|
7348
|
-
} else if (data.items) {
|
|
7349
|
-
name = "container";
|
|
7350
|
-
}
|
|
7351
|
-
return `${data.id}${name}${data.type}`.includes(value);
|
|
7352
|
-
};
|
|
7353
|
-
const filterNode = (text) => (node, parents) => {
|
|
7354
|
-
if (!nodeStatusMap.value)
|
|
7355
|
-
return;
|
|
7356
|
-
const visible = filterIsMatch(text, node);
|
|
7357
|
-
if (visible && parents.length) {
|
|
7358
|
-
parents.forEach((parent) => {
|
|
7359
|
-
updateStatus(nodeStatusMap.value, parent.id, {
|
|
7360
|
-
visible,
|
|
7361
|
-
expand: true
|
|
7362
|
-
});
|
|
7363
|
-
});
|
|
7364
|
-
}
|
|
7365
|
-
updateStatus(nodeStatusMap.value, node.id, {
|
|
7366
|
-
visible
|
|
7367
|
-
});
|
|
7368
|
-
};
|
|
7369
|
-
const filter = (text) => {
|
|
7370
|
-
if (!page.value?.items?.length)
|
|
7371
|
-
return;
|
|
7372
|
-
page.value.items.forEach((node) => {
|
|
7373
|
-
traverseNode(node, filterNode(text));
|
|
7374
|
-
});
|
|
7375
|
-
};
|
|
7376
|
-
return {
|
|
7377
|
-
filterText: vue.ref(""),
|
|
7378
|
-
filterTextChangeHandler(text) {
|
|
7379
|
-
filter(text);
|
|
7380
|
-
}
|
|
7381
|
-
};
|
|
7382
|
-
};
|
|
7383
|
-
|
|
7384
7530
|
var KeyBindingContainerKey = /* @__PURE__ */ ((KeyBindingContainerKey2) => {
|
|
7385
7531
|
KeyBindingContainerKey2["STAGE"] = "stage";
|
|
7386
7532
|
KeyBindingContainerKey2["LAYER_PANEL"] = "layer-panel";
|
|
@@ -7543,15 +7689,15 @@
|
|
|
7543
7689
|
};
|
|
7544
7690
|
};
|
|
7545
7691
|
|
|
7546
|
-
const createPageNodeStatus = (
|
|
7692
|
+
const createPageNodeStatus = (page, initalLayerNodeStatus) => {
|
|
7547
7693
|
const map = /* @__PURE__ */ new Map();
|
|
7548
|
-
map.set(
|
|
7694
|
+
map.set(page.id, {
|
|
7549
7695
|
visible: true,
|
|
7550
7696
|
expand: true,
|
|
7551
7697
|
selected: true,
|
|
7552
7698
|
draggable: false
|
|
7553
7699
|
});
|
|
7554
|
-
|
|
7700
|
+
page.items.forEach(
|
|
7555
7701
|
(node) => traverseNode(node, (node2) => {
|
|
7556
7702
|
map.set(
|
|
7557
7703
|
node2.id,
|
|
@@ -7566,7 +7712,8 @@
|
|
|
7566
7712
|
);
|
|
7567
7713
|
return map;
|
|
7568
7714
|
};
|
|
7569
|
-
const useNodeStatus = (services
|
|
7715
|
+
const useNodeStatus = (services) => {
|
|
7716
|
+
const page = vue.computed(() => services?.editorService.get("page"));
|
|
7570
7717
|
const nodes = vue.computed(() => services?.editorService.get("nodes") || []);
|
|
7571
7718
|
const nodeStatusMaps = vue.ref(/* @__PURE__ */ new Map());
|
|
7572
7719
|
const nodeStatusMap = vue.computed(
|
|
@@ -7578,7 +7725,7 @@
|
|
|
7578
7725
|
if (!page2) {
|
|
7579
7726
|
return;
|
|
7580
7727
|
}
|
|
7581
|
-
nodeStatusMaps.value.set(page2.id, createPageNodeStatus(
|
|
7728
|
+
nodeStatusMaps.value.set(page2.id, createPageNodeStatus(page2, nodeStatusMaps.value.get(page2.id)));
|
|
7582
7729
|
},
|
|
7583
7730
|
{
|
|
7584
7731
|
immediate: true
|
|
@@ -7629,7 +7776,7 @@
|
|
|
7629
7776
|
};
|
|
7630
7777
|
};
|
|
7631
7778
|
|
|
7632
|
-
const _sfc_main$
|
|
7779
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
7633
7780
|
...{
|
|
7634
7781
|
name: "MEditorLayerPanel"
|
|
7635
7782
|
},
|
|
@@ -7642,9 +7789,19 @@
|
|
|
7642
7789
|
const editorService = services?.editorService;
|
|
7643
7790
|
const tree = vue.ref();
|
|
7644
7791
|
const page = vue.computed(() => editorService?.get("page"));
|
|
7645
|
-
const
|
|
7792
|
+
const nodeData = vue.computed(() => !page.value ? [] : [page.value]);
|
|
7793
|
+
const { nodeStatusMap } = useNodeStatus(services);
|
|
7646
7794
|
const { isCtrlKeyDown } = useKeybinding(services, tree);
|
|
7647
|
-
const
|
|
7795
|
+
const filterNodeMethod = (v, data) => {
|
|
7796
|
+
let name = "";
|
|
7797
|
+
if (data.name) {
|
|
7798
|
+
name = data.name;
|
|
7799
|
+
} else if (data.items) {
|
|
7800
|
+
name = "container";
|
|
7801
|
+
}
|
|
7802
|
+
return `${data.id}${name}${data.type}`.includes(v);
|
|
7803
|
+
};
|
|
7804
|
+
const { filterTextChangeHandler } = useFilter(nodeData, nodeStatusMap, filterNodeMethod);
|
|
7648
7805
|
const collapseAllHandler = () => {
|
|
7649
7806
|
if (!page.value || !nodeStatusMap.value)
|
|
7650
7807
|
return;
|
|
@@ -7667,13 +7824,13 @@
|
|
|
7667
7824
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
7668
7825
|
default: vue.withCtx(() => [
|
|
7669
7826
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
7670
|
-
vue.createVNode(_sfc_main$
|
|
7671
|
-
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7827
|
+
vue.createVNode(_sfc_main$q, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
7828
|
+
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
7672
7829
|
key: 0,
|
|
7673
7830
|
tabindex: "-1",
|
|
7674
7831
|
ref_key: "tree",
|
|
7675
7832
|
ref: tree,
|
|
7676
|
-
data:
|
|
7833
|
+
data: nodeData.value,
|
|
7677
7834
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
7678
7835
|
onNodeDragover: vue.unref(handleDragOver),
|
|
7679
7836
|
onNodeDragstart: vue.unref(handleDragStart),
|
|
@@ -7683,18 +7840,21 @@
|
|
|
7683
7840
|
onNodeMouseenter: vue.unref(mouseenterHandler),
|
|
7684
7841
|
onNodeClick: vue.unref(nodeClickHandler)
|
|
7685
7842
|
}, {
|
|
7686
|
-
"tree-node-
|
|
7687
|
-
vue.renderSlot(_ctx.$slots, "layer-node-
|
|
7688
|
-
|
|
7843
|
+
"tree-node-content": vue.withCtx(({ data: nodeData2 }) => [
|
|
7844
|
+
vue.renderSlot(_ctx.$slots, "layer-node-content", { data: nodeData2 })
|
|
7845
|
+
]),
|
|
7846
|
+
"tree-node-tool": vue.withCtx(({ data: nodeData2 }) => [
|
|
7847
|
+
vue.renderSlot(_ctx.$slots, "layer-node-tool", { data: nodeData2 }, () => [
|
|
7848
|
+
vue.createVNode(_sfc_main$f, { data: nodeData2 }, null, 8, ["data"])
|
|
7689
7849
|
])
|
|
7690
7850
|
]),
|
|
7691
|
-
"tree-node-
|
|
7692
|
-
vue.renderSlot(_ctx.$slots, "layer-node-
|
|
7851
|
+
"tree-node-label": vue.withCtx(({ data: nodeData2 }) => [
|
|
7852
|
+
vue.renderSlot(_ctx.$slots, "layer-node-label", { data: nodeData2 })
|
|
7693
7853
|
]),
|
|
7694
7854
|
_: 3
|
|
7695
7855
|
}, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
7696
7856
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
7697
|
-
vue.createVNode(_sfc_main$
|
|
7857
|
+
vue.createVNode(_sfc_main$g, {
|
|
7698
7858
|
ref_key: "menu",
|
|
7699
7859
|
ref: menu,
|
|
7700
7860
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
@@ -7708,9 +7868,9 @@
|
|
|
7708
7868
|
}
|
|
7709
7869
|
});
|
|
7710
7870
|
|
|
7711
|
-
const _hoisted_1$
|
|
7712
|
-
const _hoisted_2$
|
|
7713
|
-
const _sfc_main$
|
|
7871
|
+
const _hoisted_1$7 = ["onClick", "onDragstart"];
|
|
7872
|
+
const _hoisted_2$4 = ["title"];
|
|
7873
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
7714
7874
|
...{
|
|
7715
7875
|
name: "MEditorComponentListPanel"
|
|
7716
7876
|
},
|
|
@@ -7790,7 +7950,7 @@
|
|
|
7790
7950
|
"model-value": collapseValue.value
|
|
7791
7951
|
}, {
|
|
7792
7952
|
default: vue.withCtx(() => [
|
|
7793
|
-
vue.createVNode(_sfc_main$
|
|
7953
|
+
vue.createVNode(_sfc_main$q, { onSearch: filterTextChangeHandler }),
|
|
7794
7954
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
7795
7955
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
7796
7956
|
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
@@ -7798,7 +7958,7 @@
|
|
|
7798
7958
|
name: `${index}`
|
|
7799
7959
|
}, {
|
|
7800
7960
|
title: vue.withCtx(() => [
|
|
7801
|
-
vue.createVNode(_sfc_main$
|
|
7961
|
+
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
|
|
7802
7962
|
vue.createTextVNode(vue.toDisplayString(group.title), 1)
|
|
7803
7963
|
]),
|
|
7804
7964
|
default: vue.withCtx(() => [
|
|
@@ -7819,7 +7979,7 @@
|
|
|
7819
7979
|
content: item.desc
|
|
7820
7980
|
}, {
|
|
7821
7981
|
default: vue.withCtx(() => [
|
|
7822
|
-
vue.createVNode(_sfc_main$
|
|
7982
|
+
vue.createVNode(_sfc_main$K, {
|
|
7823
7983
|
icon: item.icon
|
|
7824
7984
|
}, null, 8, ["icon"])
|
|
7825
7985
|
]),
|
|
@@ -7827,9 +7987,9 @@
|
|
|
7827
7987
|
}, 1032, ["disabled", "content"]),
|
|
7828
7988
|
vue.createElementVNode("span", {
|
|
7829
7989
|
title: item.text
|
|
7830
|
-
}, vue.toDisplayString(item.text), 9, _hoisted_2$
|
|
7990
|
+
}, vue.toDisplayString(item.text), 9, _hoisted_2$4)
|
|
7831
7991
|
])
|
|
7832
|
-
], 40, _hoisted_1$
|
|
7992
|
+
], 40, _hoisted_1$7);
|
|
7833
7993
|
}), 128))
|
|
7834
7994
|
]),
|
|
7835
7995
|
_: 2
|
|
@@ -7846,20 +8006,20 @@
|
|
|
7846
8006
|
}
|
|
7847
8007
|
});
|
|
7848
8008
|
|
|
7849
|
-
const _hoisted_1$
|
|
8009
|
+
const _hoisted_1$6 = {
|
|
7850
8010
|
key: 0,
|
|
7851
8011
|
class: "m-editor-sidebar"
|
|
7852
8012
|
};
|
|
7853
|
-
const _hoisted_2$
|
|
7854
|
-
const _hoisted_3$
|
|
7855
|
-
const _hoisted_4$
|
|
8013
|
+
const _hoisted_2$3 = { class: "m-editor-sidebar-header" };
|
|
8014
|
+
const _hoisted_3$1 = ["onClick", "onDragend"];
|
|
8015
|
+
const _hoisted_4$1 = {
|
|
7856
8016
|
key: 1,
|
|
7857
8017
|
class: "magic-editor-tab-panel-title"
|
|
7858
8018
|
};
|
|
7859
|
-
const _hoisted_5$
|
|
7860
|
-
const _hoisted_6
|
|
8019
|
+
const _hoisted_5$1 = { class: "m-editor-float-box-list" };
|
|
8020
|
+
const _hoisted_6 = ["onClick"];
|
|
7861
8021
|
const _hoisted_7 = { class: "m-editor-float-box-body" };
|
|
7862
|
-
const _sfc_main$
|
|
8022
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
7863
8023
|
...{
|
|
7864
8024
|
name: "MEditorSidebar"
|
|
7865
8025
|
},
|
|
@@ -7879,7 +8039,7 @@
|
|
|
7879
8039
|
type: "component",
|
|
7880
8040
|
icon: iconsVue.Goods,
|
|
7881
8041
|
text: "组件",
|
|
7882
|
-
component: _sfc_main$
|
|
8042
|
+
component: _sfc_main$d,
|
|
7883
8043
|
slots: {}
|
|
7884
8044
|
},
|
|
7885
8045
|
layer: {
|
|
@@ -7890,7 +8050,7 @@
|
|
|
7890
8050
|
props: {
|
|
7891
8051
|
layerContentMenu: props.layerContentMenu
|
|
7892
8052
|
},
|
|
7893
|
-
component: _sfc_main$
|
|
8053
|
+
component: _sfc_main$e,
|
|
7894
8054
|
slots: {}
|
|
7895
8055
|
},
|
|
7896
8056
|
"code-block": {
|
|
@@ -7898,7 +8058,7 @@
|
|
|
7898
8058
|
type: "component",
|
|
7899
8059
|
icon: iconsVue.EditPen,
|
|
7900
8060
|
text: "代码编辑",
|
|
7901
|
-
component: _sfc_main$
|
|
8061
|
+
component: _sfc_main$m,
|
|
7902
8062
|
slots: {},
|
|
7903
8063
|
boxComponentConfig: {
|
|
7904
8064
|
props: {
|
|
@@ -7911,7 +8071,7 @@
|
|
|
7911
8071
|
type: "component",
|
|
7912
8072
|
icon: iconsVue.Coin,
|
|
7913
8073
|
text: "数据源",
|
|
7914
|
-
component: _sfc_main$
|
|
8074
|
+
component: _sfc_main$j,
|
|
7915
8075
|
slots: {},
|
|
7916
8076
|
boxComponentConfig: {
|
|
7917
8077
|
props: {
|
|
@@ -7954,24 +8114,24 @@
|
|
|
7954
8114
|
});
|
|
7955
8115
|
return (_ctx, _cache) => {
|
|
7956
8116
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
7957
|
-
_ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
7958
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
8117
|
+
_ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
8118
|
+
vue.createElementVNode("div", _hoisted_2$3, [
|
|
7959
8119
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sideBarItems.value, (config, index) => {
|
|
7960
8120
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
7961
8121
|
class: vue.normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
|
|
8122
|
+
draggable: "true",
|
|
7962
8123
|
key: config.$key ?? index,
|
|
7963
8124
|
onClick: ($event) => activeTabName.value = config.text || `${index}`,
|
|
7964
|
-
draggable: "true",
|
|
7965
8125
|
onDragstart: _cache[0] || (_cache[0] = //@ts-ignore
|
|
7966
8126
|
(...args) => vue.unref(dragstartHandler) && vue.unref(dragstartHandler)(...args)),
|
|
7967
8127
|
onDragend: ($event) => vue.unref(dragendHandler)(config.$key, $event)
|
|
7968
8128
|
}, [
|
|
7969
|
-
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8129
|
+
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
7970
8130
|
key: 0,
|
|
7971
8131
|
icon: config.icon
|
|
7972
8132
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
7973
|
-
config.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
7974
|
-
], 42, _hoisted_3$
|
|
8133
|
+
config.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, vue.toDisplayString(config.text), 1)) : vue.createCommentVNode("", true)
|
|
8134
|
+
], 42, _hoisted_3$1)), [
|
|
7975
8135
|
[vue.vShow, !vue.unref(floatBoxStates)?.get(config.$key)?.status]
|
|
7976
8136
|
]);
|
|
7977
8137
|
}), 128))
|
|
@@ -8040,6 +8200,19 @@
|
|
|
8040
8200
|
]),
|
|
8041
8201
|
key: "5"
|
|
8042
8202
|
} : void 0,
|
|
8203
|
+
config.$key === "layer" || config.slots?.layerNodeLabel ? {
|
|
8204
|
+
name: "layer-node-label",
|
|
8205
|
+
fn: vue.withCtx(({ data: nodeData }) => [
|
|
8206
|
+
config.$key === "layer" ? vue.renderSlot(_ctx.$slots, "layer-node-label", {
|
|
8207
|
+
key: 0,
|
|
8208
|
+
data: nodeData
|
|
8209
|
+
}) : config.slots?.layerNodeLabel ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.layerNodeTool), {
|
|
8210
|
+
key: 1,
|
|
8211
|
+
data: nodeData
|
|
8212
|
+
}, null, 8, ["data"])) : vue.createCommentVNode("", true)
|
|
8213
|
+
]),
|
|
8214
|
+
key: "6"
|
|
8215
|
+
} : void 0,
|
|
8043
8216
|
config.$key === "layer" || config.slots?.layerNodeTool ? {
|
|
8044
8217
|
name: "layer-node-tool",
|
|
8045
8218
|
fn: vue.withCtx(({ data: nodeData }) => [
|
|
@@ -8051,7 +8224,7 @@
|
|
|
8051
8224
|
data: nodeData
|
|
8052
8225
|
}, null, 8, ["data"])) : vue.createCommentVNode("", true)
|
|
8053
8226
|
]),
|
|
8054
|
-
key: "
|
|
8227
|
+
key: "7"
|
|
8055
8228
|
} : void 0,
|
|
8056
8229
|
config.$key === "data-source" || config.slots?.codeBlockPanelTool ? {
|
|
8057
8230
|
name: "data-source-panel-tool",
|
|
@@ -8061,7 +8234,7 @@
|
|
|
8061
8234
|
data
|
|
8062
8235
|
}) : config.slots?.DataSourcePanelTool ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.DataSourcePanelTool), { key: 1 })) : vue.createCommentVNode("", true)
|
|
8063
8236
|
]),
|
|
8064
|
-
key: "
|
|
8237
|
+
key: "8"
|
|
8065
8238
|
} : void 0
|
|
8066
8239
|
]), 1040)) : vue.createCommentVNode("", true)
|
|
8067
8240
|
])), [
|
|
@@ -8070,7 +8243,7 @@
|
|
|
8070
8243
|
}), 128))
|
|
8071
8244
|
])) : vue.createCommentVNode("", true),
|
|
8072
8245
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
8073
|
-
vue.createElementVNode("div", _hoisted_5$
|
|
8246
|
+
vue.createElementVNode("div", _hoisted_5$1, [
|
|
8074
8247
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sideBarItems.value, (config, index) => {
|
|
8075
8248
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
8076
8249
|
key: config.$key ?? index,
|
|
@@ -8089,12 +8262,12 @@
|
|
|
8089
8262
|
onClick: ($event) => vue.unref(showFloatBox)(config.$key)
|
|
8090
8263
|
}, [
|
|
8091
8264
|
vue.createElementVNode("div", null, vue.toDisplayString(config.text), 1),
|
|
8092
|
-
vue.createVNode(_sfc_main$
|
|
8265
|
+
vue.createVNode(_sfc_main$K, {
|
|
8093
8266
|
class: "m-editor-float-box-close",
|
|
8094
8267
|
icon: vue.unref(iconsVue.Close),
|
|
8095
8268
|
onClick: vue.withModifiers(($event) => vue.unref(closeFloatBox)(config.$key), ["stop"])
|
|
8096
8269
|
}, null, 8, ["icon", "onClick"])
|
|
8097
|
-
], 10, _hoisted_6
|
|
8270
|
+
], 10, _hoisted_6),
|
|
8098
8271
|
vue.createElementVNode("div", _hoisted_7, [
|
|
8099
8272
|
config && vue.unref(floatBoxStates)?.get(config.$key)?.status ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.boxComponentConfig?.component || config.component), vue.mergeProps({ key: 0 }, config.boxComponentConfig?.props || config.props || {}, vue.toHandlers(config?.listeners || {})), null, 16)) : vue.createCommentVNode("", true)
|
|
8100
8273
|
])
|
|
@@ -8237,7 +8410,7 @@
|
|
|
8237
8410
|
};
|
|
8238
8411
|
}
|
|
8239
8412
|
|
|
8240
|
-
const _sfc_main$
|
|
8413
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
8241
8414
|
...{
|
|
8242
8415
|
name: "MEditorScrollBar"
|
|
8243
8416
|
},
|
|
@@ -8325,9 +8498,7 @@
|
|
|
8325
8498
|
}
|
|
8326
8499
|
});
|
|
8327
8500
|
|
|
8328
|
-
const
|
|
8329
|
-
|
|
8330
|
-
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
8501
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
8331
8502
|
...{
|
|
8332
8503
|
name: "MEditorScrollViewer"
|
|
8333
8504
|
},
|
|
@@ -8413,14 +8584,14 @@
|
|
|
8413
8584
|
}, [
|
|
8414
8585
|
vue.renderSlot(_ctx.$slots, "default")
|
|
8415
8586
|
], 4),
|
|
8416
|
-
scrollHeight.value > _ctx.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8587
|
+
scrollHeight.value > _ctx.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$b, {
|
|
8417
8588
|
key: 0,
|
|
8418
8589
|
"scroll-size": scrollHeight.value,
|
|
8419
8590
|
size: _ctx.wrapHeight,
|
|
8420
8591
|
pos: vOffset.value,
|
|
8421
8592
|
onScroll: vScrollHandler
|
|
8422
8593
|
}, null, 8, ["scroll-size", "size", "pos"])) : vue.createCommentVNode("", true),
|
|
8423
|
-
scrollWidth.value > _ctx.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8594
|
+
scrollWidth.value > _ctx.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$b, {
|
|
8424
8595
|
key: 1,
|
|
8425
8596
|
"is-horizontal": true,
|
|
8426
8597
|
"scroll-size": scrollWidth.value,
|
|
@@ -8459,7 +8630,10 @@
|
|
|
8459
8630
|
});
|
|
8460
8631
|
class Ui extends BaseService {
|
|
8461
8632
|
constructor() {
|
|
8462
|
-
super([
|
|
8633
|
+
super([
|
|
8634
|
+
{ name: "zoom", isAsync: true },
|
|
8635
|
+
{ name: "calcZoom", isAsync: true }
|
|
8636
|
+
]);
|
|
8463
8637
|
}
|
|
8464
8638
|
set(name, value) {
|
|
8465
8639
|
const mask = editorService.get("stage")?.mask;
|
|
@@ -8550,6 +8724,7 @@
|
|
|
8550
8724
|
containerHighlightDuration: stageOptions.containerHighlightDuration,
|
|
8551
8725
|
containerHighlightType: stageOptions.containerHighlightType,
|
|
8552
8726
|
disabledDragStart: stageOptions.disabledDragStart,
|
|
8727
|
+
renderType: stageOptions.renderType,
|
|
8553
8728
|
canSelect: (el, event, stop) => {
|
|
8554
8729
|
const elCanSelect = stageOptions.canSelect(el);
|
|
8555
8730
|
if (uiSelectMode.value && elCanSelect && event.type === "mousedown") {
|
|
@@ -8615,228 +8790,142 @@
|
|
|
8615
8790
|
return stage;
|
|
8616
8791
|
};
|
|
8617
8792
|
|
|
8618
|
-
const _hoisted_1$
|
|
8619
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8620
|
-
class: "icon icon-tabler icon-tabler-pin",
|
|
8621
|
-
width: "24",
|
|
8622
|
-
height: "24",
|
|
8623
|
-
viewBox: "0 0 24 24",
|
|
8624
|
-
"stroke-width": "2",
|
|
8625
|
-
stroke: "currentColor",
|
|
8626
|
-
fill: "none",
|
|
8627
|
-
"stroke-linecap": "round",
|
|
8628
|
-
"stroke-linejoin": "round"
|
|
8629
|
-
};
|
|
8630
|
-
const _hoisted_2$5 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
8631
|
-
stroke: "none",
|
|
8632
|
-
d: "M0 0h24v24H0z",
|
|
8633
|
-
fill: "none"
|
|
8634
|
-
}, null, -1);
|
|
8635
|
-
const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("path", { d: "M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4" }, null, -1);
|
|
8636
|
-
const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("line", {
|
|
8637
|
-
x1: "9",
|
|
8638
|
-
y1: "15",
|
|
8639
|
-
x2: "4.5",
|
|
8640
|
-
y2: "19.5"
|
|
8641
|
-
}, null, -1);
|
|
8642
|
-
const _hoisted_5$2 = /* @__PURE__ */ vue.createElementVNode("line", {
|
|
8643
|
-
x1: "14.5",
|
|
8644
|
-
y1: "4",
|
|
8645
|
-
x2: "20",
|
|
8646
|
-
y2: "9.5"
|
|
8647
|
-
}, null, -1);
|
|
8648
|
-
const _hoisted_6$1 = [
|
|
8649
|
-
_hoisted_2$5,
|
|
8650
|
-
_hoisted_3$2,
|
|
8651
|
-
_hoisted_4$2,
|
|
8652
|
-
_hoisted_5$2
|
|
8653
|
-
];
|
|
8654
|
-
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
8655
|
-
...{
|
|
8656
|
-
name: "MEditorPinIcon"
|
|
8657
|
-
},
|
|
8658
|
-
__name: "PinIcon",
|
|
8659
|
-
setup(__props) {
|
|
8660
|
-
return (_ctx, _cache) => {
|
|
8661
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$7, _hoisted_6$1);
|
|
8662
|
-
};
|
|
8663
|
-
}
|
|
8664
|
-
});
|
|
8665
|
-
|
|
8666
|
-
const _hoisted_1$6 = {
|
|
8667
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8668
|
-
class: "icon icon-tabler icon-tabler-pinned",
|
|
8669
|
-
width: "24",
|
|
8670
|
-
height: "24",
|
|
8671
|
-
viewBox: "0 0 24 24",
|
|
8672
|
-
"stroke-width": "2",
|
|
8673
|
-
stroke: "currentColor",
|
|
8674
|
-
fill: "none",
|
|
8675
|
-
"stroke-linecap": "round",
|
|
8676
|
-
"stroke-linejoin": "round"
|
|
8677
|
-
};
|
|
8678
|
-
const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
8679
|
-
stroke: "none",
|
|
8680
|
-
d: "M0 0h24v24H0z",
|
|
8681
|
-
fill: "none"
|
|
8682
|
-
}, null, -1);
|
|
8683
|
-
const _hoisted_3$1 = /* @__PURE__ */ vue.createElementVNode("path", { d: "M9 4v6l-2 4v2h10v-2l-2 -4v-6" }, null, -1);
|
|
8684
|
-
const _hoisted_4$1 = /* @__PURE__ */ vue.createElementVNode("line", {
|
|
8685
|
-
x1: "12",
|
|
8686
|
-
y1: "16",
|
|
8687
|
-
x2: "12",
|
|
8688
|
-
y2: "21"
|
|
8689
|
-
}, null, -1);
|
|
8690
|
-
const _hoisted_5$1 = /* @__PURE__ */ vue.createElementVNode("line", {
|
|
8691
|
-
x1: "8",
|
|
8692
|
-
y1: "4",
|
|
8693
|
-
x2: "16",
|
|
8694
|
-
y2: "4"
|
|
8695
|
-
}, null, -1);
|
|
8696
|
-
const _hoisted_6 = [
|
|
8697
|
-
_hoisted_2$4,
|
|
8698
|
-
_hoisted_3$1,
|
|
8699
|
-
_hoisted_4$1,
|
|
8700
|
-
_hoisted_5$1
|
|
8701
|
-
];
|
|
8702
|
-
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
8703
|
-
...{
|
|
8704
|
-
name: "MEditorPinnedIcon"
|
|
8705
|
-
},
|
|
8706
|
-
__name: "PinnedIcon",
|
|
8707
|
-
setup(__props) {
|
|
8708
|
-
return (_ctx, _cache) => {
|
|
8709
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, _hoisted_6);
|
|
8710
|
-
};
|
|
8711
|
-
}
|
|
8712
|
-
});
|
|
8713
|
-
|
|
8714
|
-
const _hoisted_1$5 = /* @__PURE__ */ vue.createElementVNode("span", null, "可选组件", -1);
|
|
8715
|
-
const _hoisted_2$3 = { style: { "margin-right": "10px" } };
|
|
8793
|
+
const _hoisted_1$5 = { class: "m-editor-float-box-body" };
|
|
8716
8794
|
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
8717
|
-
|
|
8718
|
-
name: "MEditorNodeListMenuTitle"
|
|
8719
|
-
},
|
|
8720
|
-
__name: "NodeListMenuTitle",
|
|
8795
|
+
__name: "FloatingBox",
|
|
8721
8796
|
props: {
|
|
8722
|
-
|
|
8797
|
+
visible: { type: Boolean, default: false },
|
|
8798
|
+
position: { default: () => ({ left: 0, top: 0 }) },
|
|
8799
|
+
rect: { default: () => ({ width: "auto", height: "auto" }) },
|
|
8800
|
+
title: { default: "" }
|
|
8723
8801
|
},
|
|
8724
|
-
emits: ["
|
|
8725
|
-
setup(__props, { emit: __emit }) {
|
|
8802
|
+
emits: ["update:visible"],
|
|
8803
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8726
8804
|
const props = __props;
|
|
8727
8805
|
const emit = __emit;
|
|
8728
|
-
const
|
|
8729
|
-
|
|
8806
|
+
const target = vue.ref();
|
|
8807
|
+
const dragTarget = vue.ref();
|
|
8808
|
+
const style = vue.computed(() => ({
|
|
8809
|
+
left: `${props.position.left}px`,
|
|
8810
|
+
top: `${props.position.top}px`,
|
|
8811
|
+
width: typeof props.rect.width === "string" ? props.rect.width : `${props.rect.width}px`,
|
|
8812
|
+
height: typeof props.rect.height === "string" ? props.rect.height : `${props.rect.height}px`
|
|
8813
|
+
}));
|
|
8814
|
+
let moveable = null;
|
|
8815
|
+
const initMoveable = () => {
|
|
8816
|
+
moveable = new Moveable(globalThis.document.body, {
|
|
8817
|
+
className: "m-editor-floating-box-moveable",
|
|
8818
|
+
target: target.value,
|
|
8819
|
+
draggable: true,
|
|
8820
|
+
resizable: true,
|
|
8821
|
+
edge: true,
|
|
8822
|
+
keepRatio: false,
|
|
8823
|
+
origin: false,
|
|
8824
|
+
snappable: true,
|
|
8825
|
+
dragTarget: dragTarget.value,
|
|
8826
|
+
dragTargetSelf: false,
|
|
8827
|
+
linePadding: 10,
|
|
8828
|
+
controlPadding: 10
|
|
8829
|
+
});
|
|
8830
|
+
moveable.on("drag", (e) => {
|
|
8831
|
+
e.target.style.transform = e.transform;
|
|
8832
|
+
});
|
|
8833
|
+
moveable.on("resize", (e) => {
|
|
8834
|
+
e.target.style.width = `${e.width}px`;
|
|
8835
|
+
e.target.style.height = `${e.height}px`;
|
|
8836
|
+
e.target.style.transform = e.drag.transform;
|
|
8837
|
+
});
|
|
8838
|
+
};
|
|
8839
|
+
const destroyMoveable = () => {
|
|
8840
|
+
moveable?.destroy();
|
|
8841
|
+
moveable = null;
|
|
8730
8842
|
};
|
|
8843
|
+
vue.watch(
|
|
8844
|
+
() => props.visible,
|
|
8845
|
+
async (visible) => {
|
|
8846
|
+
if (visible) {
|
|
8847
|
+
await vue.nextTick();
|
|
8848
|
+
initMoveable();
|
|
8849
|
+
} else {
|
|
8850
|
+
destroyMoveable();
|
|
8851
|
+
}
|
|
8852
|
+
},
|
|
8853
|
+
{
|
|
8854
|
+
immediate: true
|
|
8855
|
+
}
|
|
8856
|
+
);
|
|
8857
|
+
vue.onBeforeUnmount(() => {
|
|
8858
|
+
destroyMoveable();
|
|
8859
|
+
});
|
|
8731
8860
|
const closeHandler = () => {
|
|
8732
|
-
emit("
|
|
8861
|
+
emit("update:visible", false);
|
|
8733
8862
|
};
|
|
8734
|
-
|
|
8735
|
-
|
|
8863
|
+
__expose({
|
|
8864
|
+
target
|
|
8865
|
+
});
|
|
8736
8866
|
return (_ctx, _cache) => {
|
|
8737
|
-
return vue.openBlock(), vue.
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
ref: target
|
|
8867
|
+
return _ctx.visible ? (vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
8868
|
+
key: 0,
|
|
8869
|
+
to: "body"
|
|
8741
8870
|
}, [
|
|
8742
|
-
vue.
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
_hoisted_1$5,
|
|
8756
|
-
vue.createElementVNode("div", _hoisted_2$3, [
|
|
8757
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
8758
|
-
text: "",
|
|
8759
|
-
size: "small",
|
|
8760
|
-
onClick: closeHandler
|
|
8761
|
-
}, {
|
|
8762
|
-
default: vue.withCtx(() => [
|
|
8763
|
-
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Close) }, null, 8, ["icon"])
|
|
8871
|
+
vue.createElementVNode("div", {
|
|
8872
|
+
ref_key: "target",
|
|
8873
|
+
ref: target,
|
|
8874
|
+
class: "m-editor-float-box",
|
|
8875
|
+
style: vue.normalizeStyle(style.value)
|
|
8876
|
+
}, [
|
|
8877
|
+
vue.createElementVNode("div", {
|
|
8878
|
+
ref_key: "dragTarget",
|
|
8879
|
+
ref: dragTarget,
|
|
8880
|
+
class: "m-editor-float-box-title"
|
|
8881
|
+
}, [
|
|
8882
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
8883
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.title), 1)
|
|
8764
8884
|
]),
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8885
|
+
vue.createElementVNode("div", null, [
|
|
8886
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
8887
|
+
text: "",
|
|
8888
|
+
size: "small",
|
|
8889
|
+
icon: vue.unref(iconsVue.Close),
|
|
8890
|
+
onClick: closeHandler
|
|
8891
|
+
}, null, 8, ["icon"])
|
|
8892
|
+
])
|
|
8893
|
+
], 512),
|
|
8894
|
+
vue.createElementVNode("div", _hoisted_1$5, [
|
|
8895
|
+
vue.renderSlot(_ctx.$slots, "body")
|
|
8896
|
+
])
|
|
8897
|
+
], 4)
|
|
8898
|
+
])) : vue.createCommentVNode("", true);
|
|
8769
8899
|
};
|
|
8770
8900
|
}
|
|
8771
8901
|
});
|
|
8772
8902
|
|
|
8773
|
-
const PINNED_STATUE_CACHE_KEY = "tmagic-pinned-node-list-pinned-status";
|
|
8774
8903
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
8775
8904
|
__name: "NodeListMenu",
|
|
8776
|
-
props: {
|
|
8777
|
-
isMultiSelect: { type: Boolean }
|
|
8778
|
-
},
|
|
8779
8905
|
setup(__props) {
|
|
8780
|
-
const props = __props;
|
|
8781
|
-
const menu = vue.ref();
|
|
8782
|
-
const nodeList = vue.ref([]);
|
|
8783
|
-
const pinned = vue.ref(Boolean(globalThis.localStorage.getItem(PINNED_STATUE_CACHE_KEY)));
|
|
8784
|
-
const firstShow = vue.ref(true);
|
|
8785
8906
|
const services = vue.inject("services");
|
|
8786
8907
|
const editorService = services?.editorService;
|
|
8787
|
-
const
|
|
8908
|
+
const visible = vue.ref(false);
|
|
8909
|
+
const buttonVisible = vue.ref(false);
|
|
8910
|
+
const button = vue.ref();
|
|
8911
|
+
const box = vue.ref();
|
|
8788
8912
|
const stage = vue.computed(() => editorService?.get("stage"));
|
|
8789
8913
|
const page = vue.computed(() => editorService?.get("page"));
|
|
8790
|
-
const
|
|
8791
|
-
|
|
8792
|
-
const
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
}
|
|
8796
|
-
if (pinned.value) {
|
|
8797
|
-
return;
|
|
8798
|
-
}
|
|
8799
|
-
nodeList.value = [];
|
|
8800
|
-
menu.value?.hide();
|
|
8801
|
-
};
|
|
8802
|
-
const clearTimeoutLazy = () => {
|
|
8803
|
-
globalThis.setTimeout(() => {
|
|
8804
|
-
if (timeout) {
|
|
8805
|
-
globalThis.clearTimeout(timeout);
|
|
8806
|
-
}
|
|
8807
|
-
}, 300);
|
|
8808
|
-
};
|
|
8914
|
+
const nodes = vue.computed(() => editorService?.get("nodes") || []);
|
|
8915
|
+
const nodeData = vue.computed(() => !page.value ? [] : [page.value]);
|
|
8916
|
+
const { nodeStatusMap } = useNodeStatus(services);
|
|
8917
|
+
const filterNodeMethod = (value, data) => data.id === value;
|
|
8918
|
+
const { filterTextChangeHandler } = useFilter(nodeData, nodeStatusMap, filterNodeMethod);
|
|
8809
8919
|
const unWatch = vue.watch(
|
|
8810
8920
|
stage,
|
|
8811
8921
|
(stage2) => {
|
|
8812
8922
|
if (!stage2)
|
|
8813
8923
|
return;
|
|
8814
|
-
stage2.on("
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
if (props.isMultiSelect || stage2.getDragStatus() !== StageCore.StageDragStatus.END) {
|
|
8820
|
-
return;
|
|
8821
|
-
}
|
|
8822
|
-
timeout = globalThis.setTimeout(() => {
|
|
8823
|
-
const els = stage2.renderer.getElementsFromPoint(event) || [];
|
|
8824
|
-
const nodes = utils.getNodes(
|
|
8825
|
-
els.map((el) => el.id),
|
|
8826
|
-
page.value?.items
|
|
8827
|
-
);
|
|
8828
|
-
if (pinned.value && nodes.length === 0) {
|
|
8829
|
-
return;
|
|
8830
|
-
}
|
|
8831
|
-
nodeList.value = nodes;
|
|
8832
|
-
if (nodeList.value.length > 1) {
|
|
8833
|
-
menu.value?.show(pinned.value && !firstShow.value ? void 0 : event);
|
|
8834
|
-
firstShow.value = false;
|
|
8835
|
-
}
|
|
8836
|
-
}, 1500);
|
|
8837
|
-
});
|
|
8838
|
-
stage2.on("mouseleave", () => {
|
|
8839
|
-
clearTimeoutLazy();
|
|
8924
|
+
stage2.on("select", (el, event) => {
|
|
8925
|
+
const els = stage2.renderer.getElementsFromPoint(event) || [];
|
|
8926
|
+
const ids = els.map((el2) => el2.id).filter((id) => Boolean(id));
|
|
8927
|
+
buttonVisible.value = ids.length > 3;
|
|
8928
|
+
filterTextChangeHandler(ids);
|
|
8840
8929
|
});
|
|
8841
8930
|
unWatch();
|
|
8842
8931
|
},
|
|
@@ -8844,75 +8933,75 @@
|
|
|
8844
8933
|
immediate: true
|
|
8845
8934
|
}
|
|
8846
8935
|
);
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
return map;
|
|
8855
|
-
});
|
|
8856
|
-
const menuData = vue.computed(
|
|
8857
|
-
() => nodeList.value.map((node2) => {
|
|
8858
|
-
let text = node2.name;
|
|
8859
|
-
let icon;
|
|
8860
|
-
if (node2.type) {
|
|
8861
|
-
const item = componentMap.value[node2.type];
|
|
8862
|
-
text += ` (${item?.text})`;
|
|
8863
|
-
icon = item?.icon;
|
|
8936
|
+
vue.watch(
|
|
8937
|
+
nodes,
|
|
8938
|
+
(nodes2) => {
|
|
8939
|
+
if (!nodeStatusMap.value)
|
|
8940
|
+
return;
|
|
8941
|
+
for (const [id, status] of nodeStatusMap.value.entries()) {
|
|
8942
|
+
status.selected = nodes2.some((node) => node.id === id);
|
|
8864
8943
|
}
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
icon,
|
|
8870
|
-
handler: async () => {
|
|
8871
|
-
await editorService?.select(node2);
|
|
8872
|
-
stage.value?.select(node2.id);
|
|
8873
|
-
}
|
|
8874
|
-
};
|
|
8875
|
-
})
|
|
8944
|
+
},
|
|
8945
|
+
{
|
|
8946
|
+
immediate: true
|
|
8947
|
+
}
|
|
8876
8948
|
);
|
|
8877
|
-
const
|
|
8878
|
-
|
|
8949
|
+
const clickHandler = async (event, data) => {
|
|
8950
|
+
await editorService?.select(data.id);
|
|
8951
|
+
stage.value?.select(data.id);
|
|
8879
8952
|
};
|
|
8880
|
-
const
|
|
8881
|
-
|
|
8953
|
+
const menuPosition = vue.ref({
|
|
8954
|
+
left: 0,
|
|
8955
|
+
top: 0
|
|
8956
|
+
});
|
|
8957
|
+
vue.watch(visible, async (visible2) => {
|
|
8958
|
+
if (!button.value || !visible2) {
|
|
8882
8959
|
return;
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
};
|
|
8892
|
-
vue.watch(pinned, () => {
|
|
8893
|
-
globalThis.localStorage.setItem(PINNED_STATUE_CACHE_KEY, pinned.value.toString());
|
|
8960
|
+
}
|
|
8961
|
+
await vue.nextTick();
|
|
8962
|
+
const rect = button.value.getBoundingClientRect();
|
|
8963
|
+
const height = box.value?.target?.clientHeight || 0;
|
|
8964
|
+
menuPosition.value = {
|
|
8965
|
+
left: rect.left + rect.width + 5,
|
|
8966
|
+
top: rect.top - height / 2 + rect.height / 2
|
|
8967
|
+
};
|
|
8894
8968
|
});
|
|
8895
8969
|
return (_ctx, _cache) => {
|
|
8896
|
-
return vue.openBlock(), vue.
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8970
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
8971
|
+
page.value && buttonVisible.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
8972
|
+
key: 0,
|
|
8973
|
+
content: "点击查看当前位置下的组件"
|
|
8974
|
+
}, {
|
|
8975
|
+
default: vue.withCtx(() => [
|
|
8976
|
+
vue.createElementVNode("div", {
|
|
8977
|
+
ref_key: "button",
|
|
8978
|
+
ref: button,
|
|
8979
|
+
class: "m-editor-stage-float-button",
|
|
8980
|
+
onClick: _cache[0] || (_cache[0] = ($event) => visible.value = true)
|
|
8981
|
+
}, "可选组件", 512)
|
|
8982
|
+
]),
|
|
8983
|
+
_: 1
|
|
8984
|
+
})) : vue.createCommentVNode("", true),
|
|
8985
|
+
page.value && vue.unref(nodeStatusMap) && buttonVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$9, {
|
|
8986
|
+
key: 1,
|
|
8987
|
+
ref_key: "box",
|
|
8988
|
+
ref: box,
|
|
8989
|
+
visible: visible.value,
|
|
8990
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
|
|
8991
|
+
title: "当前位置下的组件",
|
|
8992
|
+
position: menuPosition.value
|
|
8993
|
+
}, {
|
|
8994
|
+
body: vue.withCtx(() => [
|
|
8995
|
+
vue.createVNode(_sfc_main$o, {
|
|
8996
|
+
class: "m-editor-node-list-menu magic-editor-layer-tree",
|
|
8997
|
+
data: nodeData.value,
|
|
8998
|
+
"node-status-map": vue.unref(nodeStatusMap),
|
|
8999
|
+
onNodeClick: clickHandler
|
|
9000
|
+
}, null, 8, ["data", "node-status-map"])
|
|
9001
|
+
]),
|
|
9002
|
+
_: 1
|
|
9003
|
+
}, 8, ["visible", "position"])) : vue.createCommentVNode("", true)
|
|
9004
|
+
], 64);
|
|
8916
9005
|
};
|
|
8917
9006
|
}
|
|
8918
9007
|
});
|
|
@@ -8974,7 +9063,6 @@
|
|
|
8974
9063
|
const services = vue.inject("services");
|
|
8975
9064
|
const editorService = services?.editorService;
|
|
8976
9065
|
const menu = vue.ref();
|
|
8977
|
-
const canPaste = vue.ref(false);
|
|
8978
9066
|
const canCenter = vue.ref(false);
|
|
8979
9067
|
const node = vue.computed(() => editorService?.get("node"));
|
|
8980
9068
|
const nodes = vue.computed(() => editorService?.get("nodes"));
|
|
@@ -9072,14 +9160,12 @@
|
|
|
9072
9160
|
},
|
|
9073
9161
|
{ immediate: true }
|
|
9074
9162
|
);
|
|
9075
|
-
const show =
|
|
9163
|
+
const show = (e) => {
|
|
9076
9164
|
menu.value?.show(e);
|
|
9077
|
-
const data = await storageService.getItem(COPY_STORAGE_KEY);
|
|
9078
|
-
canPaste.value = data !== "undefined" && !!data;
|
|
9079
9165
|
};
|
|
9080
9166
|
__expose({ show });
|
|
9081
9167
|
return (_ctx, _cache) => {
|
|
9082
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9168
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$i, {
|
|
9083
9169
|
"menu-data": menuData.value,
|
|
9084
9170
|
ref_key: "menu",
|
|
9085
9171
|
ref: menu
|
|
@@ -9236,7 +9322,7 @@
|
|
|
9236
9322
|
}
|
|
9237
9323
|
};
|
|
9238
9324
|
return (_ctx, _cache) => {
|
|
9239
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9325
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$a, {
|
|
9240
9326
|
class: "m-editor-stage",
|
|
9241
9327
|
ref_key: "stageWrap",
|
|
9242
9328
|
ref: stageWrap,
|
|
@@ -9262,17 +9348,14 @@
|
|
|
9262
9348
|
onDrop: dropHandler,
|
|
9263
9349
|
onDragover: dragoverHandler
|
|
9264
9350
|
}, null, 36),
|
|
9351
|
+
vue.createVNode(_sfc_main$8),
|
|
9265
9352
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
9266
9353
|
vue.createVNode(_sfc_main$6, {
|
|
9267
9354
|
ref_key: "menu",
|
|
9268
9355
|
ref: menu,
|
|
9269
9356
|
"is-multi-select": isMultiSelect.value,
|
|
9270
9357
|
"stage-content-menu": _ctx.stageContentMenu
|
|
9271
|
-
}, null, 8, ["is-multi-select", "stage-content-menu"])
|
|
9272
|
-
vue.createVNode(_sfc_main$8, {
|
|
9273
|
-
ref: "nodeList",
|
|
9274
|
-
"is-multi-select": isMultiSelect.value
|
|
9275
|
-
}, null, 8, ["is-multi-select"])
|
|
9358
|
+
}, null, 8, ["is-multi-select", "stage-content-menu"])
|
|
9276
9359
|
]))
|
|
9277
9360
|
]),
|
|
9278
9361
|
_: 1
|
|
@@ -9418,14 +9501,14 @@
|
|
|
9418
9501
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9419
9502
|
onClick: addPage
|
|
9420
9503
|
}, [
|
|
9421
|
-
vue.createVNode(_sfc_main$
|
|
9504
|
+
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
9422
9505
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2)),
|
|
9423
9506
|
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9424
9507
|
key: 2,
|
|
9425
9508
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9426
9509
|
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
9427
9510
|
}, [
|
|
9428
|
-
vue.createVNode(_sfc_main$
|
|
9511
|
+
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
9429
9512
|
])) : vue.createCommentVNode("", true),
|
|
9430
9513
|
pageLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9431
9514
|
key: 3,
|
|
@@ -9441,7 +9524,7 @@
|
|
|
9441
9524
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9442
9525
|
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
9443
9526
|
}, [
|
|
9444
|
-
vue.createVNode(_sfc_main$
|
|
9527
|
+
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
9445
9528
|
])) : vue.createCommentVNode("", true)
|
|
9446
9529
|
], 512);
|
|
9447
9530
|
};
|
|
@@ -9513,7 +9596,7 @@
|
|
|
9513
9596
|
default: vue.withCtx(() => [
|
|
9514
9597
|
vue.createElementVNode("div", null, [
|
|
9515
9598
|
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
9516
|
-
vue.createVNode(_sfc_main$
|
|
9599
|
+
vue.createVNode(_sfc_main$t, {
|
|
9517
9600
|
data: {
|
|
9518
9601
|
type: "button",
|
|
9519
9602
|
text: "复制",
|
|
@@ -9521,7 +9604,7 @@
|
|
|
9521
9604
|
handler: () => copy(item)
|
|
9522
9605
|
}
|
|
9523
9606
|
}, null, 8, ["data"]),
|
|
9524
|
-
vue.createVNode(_sfc_main$
|
|
9607
|
+
vue.createVNode(_sfc_main$t, {
|
|
9525
9608
|
data: {
|
|
9526
9609
|
type: "button",
|
|
9527
9610
|
text: "删除",
|
|
@@ -9588,7 +9671,13 @@
|
|
|
9588
9671
|
paramsColConfig: void 0
|
|
9589
9672
|
});
|
|
9590
9673
|
constructor() {
|
|
9591
|
-
super([
|
|
9674
|
+
super([
|
|
9675
|
+
{ name: "setCodeDslById", isAsync: true },
|
|
9676
|
+
{ name: "setEditStatus", isAsync: true },
|
|
9677
|
+
{ name: "setCombineIds", isAsync: true },
|
|
9678
|
+
{ name: "setUndeleteableList", isAsync: true },
|
|
9679
|
+
{ name: "deleteCodeDslByIds", isAsync: true }
|
|
9680
|
+
]);
|
|
9592
9681
|
}
|
|
9593
9682
|
/**
|
|
9594
9683
|
* 设置活动的代码块dsl数据源
|
|
@@ -9791,42 +9880,6 @@
|
|
|
9791
9880
|
}
|
|
9792
9881
|
const componentListService = new ComponentList();
|
|
9793
9882
|
|
|
9794
|
-
class Dep extends BaseService {
|
|
9795
|
-
watcher = new dep.Watcher({ initialTargets: vue.reactive({}) });
|
|
9796
|
-
removeTargets(type = dep.DepTargetType.DEFAULT) {
|
|
9797
|
-
this.watcher.removeTargets(type);
|
|
9798
|
-
this.emit("remove-target");
|
|
9799
|
-
}
|
|
9800
|
-
getTargets(type = dep.DepTargetType.DEFAULT) {
|
|
9801
|
-
return this.watcher.getTargets(type);
|
|
9802
|
-
}
|
|
9803
|
-
getTarget(id) {
|
|
9804
|
-
return this.watcher.getTarget(id);
|
|
9805
|
-
}
|
|
9806
|
-
addTarget(target) {
|
|
9807
|
-
this.watcher.addTarget(target);
|
|
9808
|
-
this.emit("add-target", target);
|
|
9809
|
-
}
|
|
9810
|
-
removeTarget(id) {
|
|
9811
|
-
this.watcher.removeTarget(id);
|
|
9812
|
-
this.emit("remove-target");
|
|
9813
|
-
}
|
|
9814
|
-
clearTargets() {
|
|
9815
|
-
this.watcher.clearTargets();
|
|
9816
|
-
}
|
|
9817
|
-
collect(nodes, deep = false) {
|
|
9818
|
-
this.watcher.collect(nodes, deep);
|
|
9819
|
-
this.emit("collected", nodes, deep);
|
|
9820
|
-
}
|
|
9821
|
-
clear(nodes) {
|
|
9822
|
-
return this.watcher.clear(nodes);
|
|
9823
|
-
}
|
|
9824
|
-
hasTarget(id) {
|
|
9825
|
-
return this.watcher.hasTarget(id);
|
|
9826
|
-
}
|
|
9827
|
-
}
|
|
9828
|
-
const depService = new Dep();
|
|
9829
|
-
|
|
9830
9883
|
let eventMap = vue.reactive({});
|
|
9831
9884
|
let methodMap = vue.reactive({});
|
|
9832
9885
|
class Events extends BaseService {
|
|
@@ -10046,7 +10099,8 @@
|
|
|
10046
10099
|
containerHighlightClassName: StageCore.CONTAINER_HIGHLIGHT_CLASS_NAME,
|
|
10047
10100
|
containerHighlightDuration: 800,
|
|
10048
10101
|
containerHighlightType: StageCore.ContainerHighlightType.DEFAULT,
|
|
10049
|
-
codeOptions: () => ({})
|
|
10102
|
+
codeOptions: () => ({}),
|
|
10103
|
+
renderType: StageCore.RenderType.IFRAME
|
|
10050
10104
|
};
|
|
10051
10105
|
|
|
10052
10106
|
const initServiceState = (props, {
|
|
@@ -10184,13 +10238,13 @@
|
|
|
10184
10238
|
const stage = editorService.get("stage");
|
|
10185
10239
|
return stage?.renderer.runtime?.getApp?.();
|
|
10186
10240
|
};
|
|
10187
|
-
const
|
|
10241
|
+
const updateDataSourceSchema = () => {
|
|
10188
10242
|
const root = editorService.get("root");
|
|
10189
10243
|
if (root?.dataSources) {
|
|
10190
10244
|
getApp()?.dataSourceManager?.updateSchema(root.dataSources);
|
|
10191
10245
|
}
|
|
10192
10246
|
};
|
|
10193
|
-
const
|
|
10247
|
+
const updateNodeWhenDataSourceChange = (nodes) => {
|
|
10194
10248
|
const root = editorService.get("root");
|
|
10195
10249
|
const stage = editorService.get("stage");
|
|
10196
10250
|
if (!root || !stage)
|
|
@@ -10203,7 +10257,7 @@
|
|
|
10203
10257
|
app.dsl.dataSourceCondDeps = root.dataSourceCondDeps;
|
|
10204
10258
|
app.dsl.dataSources = root.dataSources;
|
|
10205
10259
|
}
|
|
10206
|
-
|
|
10260
|
+
updateDataSourceSchema();
|
|
10207
10261
|
nodes.forEach((node) => {
|
|
10208
10262
|
const deps = Object.values(root.dataSourceDeps || {});
|
|
10209
10263
|
deps.forEach((dep) => {
|
|
@@ -10244,10 +10298,10 @@
|
|
|
10244
10298
|
}
|
|
10245
10299
|
};
|
|
10246
10300
|
const depUpdateHandler = (node) => {
|
|
10247
|
-
|
|
10301
|
+
updateNodeWhenDataSourceChange([node]);
|
|
10248
10302
|
};
|
|
10249
10303
|
const collectedHandler = (nodes) => {
|
|
10250
|
-
|
|
10304
|
+
updateNodeWhenDataSourceChange(nodes);
|
|
10251
10305
|
};
|
|
10252
10306
|
depService.on("add-target", targetAddHandler);
|
|
10253
10307
|
depService.on("remove-target", targetRemoveHandler);
|
|
@@ -10269,7 +10323,7 @@
|
|
|
10269
10323
|
Object.entries(value.codeBlocks).forEach(([id, code]) => {
|
|
10270
10324
|
depService.addTarget(dep.createCodeBlockTarget(id, code));
|
|
10271
10325
|
});
|
|
10272
|
-
|
|
10326
|
+
dataSourceService.get("dataSources").forEach((ds) => {
|
|
10273
10327
|
initDataSourceDepTarget(ds);
|
|
10274
10328
|
});
|
|
10275
10329
|
if (Array.isArray(value.items)) {
|
|
@@ -10314,14 +10368,14 @@
|
|
|
10314
10368
|
editorService.on("remove", nodeRemoveHandler);
|
|
10315
10369
|
editorService.on("update", nodeUpdateHandler);
|
|
10316
10370
|
const codeBlockAddOrUpdateHandler = (id, codeBlock) => {
|
|
10317
|
-
if (depService.hasTarget(id)) {
|
|
10318
|
-
depService.getTarget(id).name = codeBlock.name;
|
|
10371
|
+
if (depService.hasTarget(id, dep.DepTargetType.CODE_BLOCK)) {
|
|
10372
|
+
depService.getTarget(id, dep.DepTargetType.CODE_BLOCK).name = codeBlock.name;
|
|
10319
10373
|
return;
|
|
10320
10374
|
}
|
|
10321
10375
|
depService.addTarget(dep.createCodeBlockTarget(id, codeBlock));
|
|
10322
10376
|
};
|
|
10323
10377
|
const codeBlockRemoveHandler = (id) => {
|
|
10324
|
-
depService.removeTarget(id);
|
|
10378
|
+
depService.removeTarget(id, dep.DepTargetType.CODE_BLOCK);
|
|
10325
10379
|
};
|
|
10326
10380
|
codeBlockService.on("addOrUpdate", codeBlockAddOrUpdateHandler);
|
|
10327
10381
|
codeBlockService.on("remove", codeBlockRemoveHandler);
|
|
@@ -10331,17 +10385,28 @@
|
|
|
10331
10385
|
};
|
|
10332
10386
|
const dataSourceUpdateHandler = (config) => {
|
|
10333
10387
|
const root = editorService.get("root");
|
|
10388
|
+
removeDataSourceTarget(config.id);
|
|
10389
|
+
initDataSourceDepTarget(config);
|
|
10390
|
+
depService.collect(root?.items || [], true);
|
|
10334
10391
|
const targets = depService.getTargets(dep.DepTargetType.DATA_SOURCE);
|
|
10335
10392
|
const nodes = utils.getNodes(Object.keys(targets[config.id].deps), root?.items);
|
|
10336
|
-
|
|
10393
|
+
updateNodeWhenDataSourceChange(nodes);
|
|
10394
|
+
};
|
|
10395
|
+
const removeDataSourceTarget = (id) => {
|
|
10396
|
+
depService.removeTarget(id, dep.DepTargetType.DATA_SOURCE);
|
|
10397
|
+
depService.removeTarget(id, dep.DepTargetType.DATA_SOURCE_COND);
|
|
10398
|
+
depService.removeTarget(id, dep.DepTargetType.DATA_SOURCE_METHOD);
|
|
10337
10399
|
};
|
|
10338
10400
|
const dataSourceRemoveHandler = (id) => {
|
|
10339
|
-
|
|
10401
|
+
removeDataSourceTarget(id);
|
|
10340
10402
|
getApp()?.dataSourceManager?.removeDataSource(id);
|
|
10341
10403
|
};
|
|
10342
10404
|
dataSourceService.on("add", dataSourceAddHandler);
|
|
10343
10405
|
dataSourceService.on("update", dataSourceUpdateHandler);
|
|
10344
10406
|
dataSourceService.on("remove", dataSourceRemoveHandler);
|
|
10407
|
+
if (props.collectorOptions && !depService.hasTarget(dep.DepTargetType.RELATED_COMP_WHEN_COPY)) {
|
|
10408
|
+
depService.addTarget(dep.createRelatedCompTarget(props.collectorOptions));
|
|
10409
|
+
}
|
|
10345
10410
|
vue.onUnmounted(() => {
|
|
10346
10411
|
depService.off("add-target", targetAddHandler);
|
|
10347
10412
|
depService.off("remove-target", targetRemoveHandler);
|
|
@@ -10375,6 +10440,7 @@
|
|
|
10375
10440
|
stageContentMenu: {},
|
|
10376
10441
|
render: { type: Function },
|
|
10377
10442
|
runtimeUrl: {},
|
|
10443
|
+
renderType: {},
|
|
10378
10444
|
autoScrollIntoView: { type: Boolean },
|
|
10379
10445
|
propsConfigs: {},
|
|
10380
10446
|
propsValues: {},
|
|
@@ -10393,7 +10459,8 @@
|
|
|
10393
10459
|
codeOptions: {},
|
|
10394
10460
|
updateDragEl: { type: Function },
|
|
10395
10461
|
disabledDragStart: { type: Boolean },
|
|
10396
|
-
extendFormState: { type: Function }
|
|
10462
|
+
extendFormState: { type: Function },
|
|
10463
|
+
collectorOptions: {}
|
|
10397
10464
|
}, defaultEditorProps),
|
|
10398
10465
|
emits: ["props-panel-mounted", "update:modelValue"],
|
|
10399
10466
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -10431,18 +10498,19 @@
|
|
|
10431
10498
|
containerHighlightClassName: props.containerHighlightClassName,
|
|
10432
10499
|
containerHighlightDuration: props.containerHighlightDuration,
|
|
10433
10500
|
containerHighlightType: props.containerHighlightType,
|
|
10434
|
-
disabledDragStart: props.disabledDragStart
|
|
10501
|
+
disabledDragStart: props.disabledDragStart,
|
|
10502
|
+
renderType: props.renderType
|
|
10435
10503
|
})
|
|
10436
10504
|
);
|
|
10437
10505
|
__expose(services);
|
|
10438
10506
|
return (_ctx, _cache) => {
|
|
10439
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
10507
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$u, null, {
|
|
10440
10508
|
header: vue.withCtx(() => [
|
|
10441
10509
|
vue.renderSlot(_ctx.$slots, "header")
|
|
10442
10510
|
]),
|
|
10443
10511
|
nav: vue.withCtx(() => [
|
|
10444
10512
|
vue.renderSlot(_ctx.$slots, "nav", { editorService: vue.unref(editorService) }, () => [
|
|
10445
|
-
vue.createVNode(_sfc_main$
|
|
10513
|
+
vue.createVNode(_sfc_main$s, { data: _ctx.menu }, null, 8, ["data"])
|
|
10446
10514
|
])
|
|
10447
10515
|
]),
|
|
10448
10516
|
"content-before": vue.withCtx(() => [
|
|
@@ -10453,7 +10521,7 @@
|
|
|
10453
10521
|
]),
|
|
10454
10522
|
sidebar: vue.withCtx(() => [
|
|
10455
10523
|
vue.renderSlot(_ctx.$slots, "sidebar", { editorService: vue.unref(editorService) }, () => [
|
|
10456
|
-
vue.createVNode(_sfc_main$
|
|
10524
|
+
vue.createVNode(_sfc_main$c, {
|
|
10457
10525
|
data: _ctx.sidebar,
|
|
10458
10526
|
"layer-content-menu": _ctx.layerContentMenu
|
|
10459
10527
|
}, {
|
|
@@ -10463,6 +10531,9 @@
|
|
|
10463
10531
|
"layer-node-content": vue.withCtx(({ data }) => [
|
|
10464
10532
|
vue.renderSlot(_ctx.$slots, "layer-node-content", { data })
|
|
10465
10533
|
]),
|
|
10534
|
+
"layer-node-label": vue.withCtx(({ data }) => [
|
|
10535
|
+
vue.renderSlot(_ctx.$slots, "layer-node-label", { data })
|
|
10536
|
+
]),
|
|
10466
10537
|
"layer-node-tool": vue.withCtx(({ data }) => [
|
|
10467
10538
|
vue.renderSlot(_ctx.$slots, "layer-node-tool", { data })
|
|
10468
10539
|
]),
|
|
@@ -10509,7 +10580,7 @@
|
|
|
10509
10580
|
]),
|
|
10510
10581
|
"props-panel": vue.withCtx(() => [
|
|
10511
10582
|
vue.renderSlot(_ctx.$slots, "props-panel", {}, () => [
|
|
10512
|
-
vue.createVNode(_sfc_main$
|
|
10583
|
+
vue.createVNode(_sfc_main$r, {
|
|
10513
10584
|
"extend-state": _ctx.extendFormState,
|
|
10514
10585
|
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
|
|
10515
10586
|
}, {
|
|
@@ -10535,8 +10606,6 @@
|
|
|
10535
10606
|
}
|
|
10536
10607
|
});
|
|
10537
10608
|
|
|
10538
|
-
const index$1 = '';
|
|
10539
|
-
|
|
10540
10609
|
const defaultInstallOpt = {
|
|
10541
10610
|
// eslint-disable-next-line no-eval
|
|
10542
10611
|
parseDSL: (dsl) => eval(dsl)
|
|
@@ -10547,21 +10616,21 @@
|
|
|
10547
10616
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
10548
10617
|
setConfig(option);
|
|
10549
10618
|
app.component(_sfc_main.name, _sfc_main);
|
|
10550
|
-
app.component("m-fields-ui-select", _sfc_main$
|
|
10551
|
-
app.component("m-fields-code-link", _sfc_main$
|
|
10552
|
-
app.component("m-fields-vs-code", _sfc_main$
|
|
10553
|
-
app.component("magic-code-editor", _sfc_main$
|
|
10554
|
-
app.component("m-fields-code-select", _sfc_main$
|
|
10555
|
-
app.component("m-fields-code-select-col", _sfc_main$
|
|
10556
|
-
app.component("m-fields-event-select", _sfc_main$
|
|
10557
|
-
app.component("m-fields-data-source-fields", _sfc_main$
|
|
10558
|
-
app.component("m-fields-data-source-mocks", _sfc_main$
|
|
10559
|
-
app.component("m-fields-key-value", _sfc_main$
|
|
10560
|
-
app.component("m-fields-data-source-input", _sfc_main$
|
|
10561
|
-
app.component("m-fields-data-source-select", _sfc_main$
|
|
10562
|
-
app.component("m-fields-data-source-methods", _sfc_main$
|
|
10563
|
-
app.component("m-fields-data-source-method-select", _sfc_main$
|
|
10564
|
-
app.component("m-fields-data-source-field-select", _sfc_main$
|
|
10619
|
+
app.component("m-fields-ui-select", _sfc_main$y);
|
|
10620
|
+
app.component("m-fields-code-link", _sfc_main$O);
|
|
10621
|
+
app.component("m-fields-vs-code", _sfc_main$P);
|
|
10622
|
+
app.component("magic-code-editor", _sfc_main$Q);
|
|
10623
|
+
app.component("m-fields-code-select", _sfc_main$N);
|
|
10624
|
+
app.component("m-fields-code-select-col", _sfc_main$J);
|
|
10625
|
+
app.component("m-fields-event-select", _sfc_main$B);
|
|
10626
|
+
app.component("m-fields-data-source-fields", _sfc_main$I);
|
|
10627
|
+
app.component("m-fields-data-source-mocks", _sfc_main$D);
|
|
10628
|
+
app.component("m-fields-key-value", _sfc_main$z);
|
|
10629
|
+
app.component("m-fields-data-source-input", _sfc_main$G);
|
|
10630
|
+
app.component("m-fields-data-source-select", _sfc_main$C);
|
|
10631
|
+
app.component("m-fields-data-source-methods", _sfc_main$F);
|
|
10632
|
+
app.component("m-fields-data-source-method-select", _sfc_main$E);
|
|
10633
|
+
app.component("m-fields-data-source-field-select", _sfc_main$H);
|
|
10565
10634
|
}
|
|
10566
10635
|
};
|
|
10567
10636
|
|
|
@@ -10571,40 +10640,40 @@
|
|
|
10571
10640
|
});
|
|
10572
10641
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
10573
10642
|
exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
|
|
10574
|
-
exports.CodeBlockEditor = _sfc_main$
|
|
10575
|
-
exports.CodeBlockList = _sfc_main$
|
|
10576
|
-
exports.CodeBlockListPanel = _sfc_main$
|
|
10643
|
+
exports.CodeBlockEditor = _sfc_main$M;
|
|
10644
|
+
exports.CodeBlockList = _sfc_main$n;
|
|
10645
|
+
exports.CodeBlockListPanel = _sfc_main$m;
|
|
10577
10646
|
exports.CodeDeleteErrorType = CodeDeleteErrorType;
|
|
10578
|
-
exports.CodeSelect = _sfc_main$
|
|
10579
|
-
exports.CodeSelectCol = _sfc_main$
|
|
10647
|
+
exports.CodeSelect = _sfc_main$N;
|
|
10648
|
+
exports.CodeSelectCol = _sfc_main$J;
|
|
10580
10649
|
exports.ColumnLayout = ColumnLayout;
|
|
10581
|
-
exports.ComponentListPanel = _sfc_main$
|
|
10582
|
-
exports.ContentMenu = _sfc_main$
|
|
10583
|
-
exports.DataSourceFieldSelect = _sfc_main$
|
|
10584
|
-
exports.DataSourceFields = _sfc_main$
|
|
10585
|
-
exports.DataSourceInput = _sfc_main$
|
|
10586
|
-
exports.DataSourceMethodSelect = _sfc_main$
|
|
10587
|
-
exports.DataSourceMethods = _sfc_main$
|
|
10588
|
-
exports.DataSourceMocks = _sfc_main$
|
|
10589
|
-
exports.DataSourceSelect = _sfc_main$
|
|
10650
|
+
exports.ComponentListPanel = _sfc_main$d;
|
|
10651
|
+
exports.ContentMenu = _sfc_main$i;
|
|
10652
|
+
exports.DataSourceFieldSelect = _sfc_main$H;
|
|
10653
|
+
exports.DataSourceFields = _sfc_main$I;
|
|
10654
|
+
exports.DataSourceInput = _sfc_main$G;
|
|
10655
|
+
exports.DataSourceMethodSelect = _sfc_main$E;
|
|
10656
|
+
exports.DataSourceMethods = _sfc_main$F;
|
|
10657
|
+
exports.DataSourceMocks = _sfc_main$D;
|
|
10658
|
+
exports.DataSourceSelect = _sfc_main$C;
|
|
10590
10659
|
exports.DragType = DragType;
|
|
10591
|
-
exports.EventSelect = _sfc_main$
|
|
10660
|
+
exports.EventSelect = _sfc_main$B;
|
|
10592
10661
|
exports.Fixed2Other = Fixed2Other;
|
|
10593
10662
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
10594
|
-
exports.Icon = _sfc_main$
|
|
10663
|
+
exports.Icon = _sfc_main$K;
|
|
10595
10664
|
exports.KeyBindingCommand = KeyBindingCommand;
|
|
10596
|
-
exports.KeyValue = _sfc_main$
|
|
10665
|
+
exports.KeyValue = _sfc_main$z;
|
|
10597
10666
|
exports.Keys = Keys;
|
|
10598
10667
|
exports.LayerOffset = LayerOffset;
|
|
10599
|
-
exports.LayerPanel = _sfc_main$
|
|
10668
|
+
exports.LayerPanel = _sfc_main$e;
|
|
10600
10669
|
exports.Layout = Layout;
|
|
10601
|
-
exports.LayoutContainer = _sfc_main$
|
|
10602
|
-
exports.PropsPanel = _sfc_main$
|
|
10603
|
-
exports.Resizer = _sfc_main$
|
|
10604
|
-
exports.SplitView = _sfc_main$
|
|
10605
|
-
exports.TMagicCodeEditor = _sfc_main$
|
|
10670
|
+
exports.LayoutContainer = _sfc_main$w;
|
|
10671
|
+
exports.PropsPanel = _sfc_main$r;
|
|
10672
|
+
exports.Resizer = _sfc_main$x;
|
|
10673
|
+
exports.SplitView = _sfc_main$w;
|
|
10674
|
+
exports.TMagicCodeEditor = _sfc_main$Q;
|
|
10606
10675
|
exports.TMagicEditor = _sfc_main;
|
|
10607
|
-
exports.ToolButton = _sfc_main$
|
|
10676
|
+
exports.ToolButton = _sfc_main$t;
|
|
10608
10677
|
exports.UI_SELECT_MODE_EVENT_NAME = UI_SELECT_MODE_EVENT_NAME;
|
|
10609
10678
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
10610
10679
|
exports.advancedTabConfig = advancedTabConfig;
|