@tmagic/editor 1.5.0-beta.1 → 1.5.0-beta.11
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 +276 -3
- package/dist/tmagic-editor.js +268 -218
- package/dist/tmagic-editor.umd.cjs +496 -421
- package/package.json +13 -14
- package/src/Editor.vue +18 -4
- package/src/components/CodeBlockEditor.vue +5 -5
- package/src/components/SearchInput.vue +1 -0
- package/src/components/Tree.vue +10 -2
- package/src/components/TreeNode.vue +4 -2
- package/src/editorProps.ts +6 -3
- package/src/fields/CodeLink.vue +2 -2
- package/src/fields/CodeSelect.vue +1 -1
- package/src/fields/CodeSelectCol.vue +1 -1
- package/src/fields/CondOpSelect.vue +1 -1
- package/src/fields/DataSourceFieldSelect/FieldSelect.vue +2 -8
- package/src/fields/DataSourceFieldSelect/Index.vue +2 -2
- package/src/fields/DataSourceFields.vue +1 -1
- package/src/fields/DataSourceInput.vue +4 -4
- package/src/fields/DataSourceMethodSelect.vue +1 -1
- package/src/fields/DataSourceMethods.vue +1 -1
- package/src/fields/DataSourceMocks.vue +1 -1
- package/src/fields/DisplayConds.vue +1 -1
- package/src/fields/EventSelect.vue +4 -4
- package/src/fields/PageFragmentSelect.vue +1 -1
- package/src/fields/UISelect.vue +1 -1
- package/src/hooks/use-code-block-edit.ts +1 -1
- package/src/hooks/use-data-source-edit.ts +1 -1
- package/src/hooks/use-data-source-method.ts +3 -3
- package/src/hooks/use-filter.ts +2 -2
- package/src/hooks/use-node-status.ts +3 -3
- package/src/hooks/use-stage.ts +2 -2
- package/src/index.ts +28 -8
- package/src/initService.ts +17 -10
- package/src/layouts/AddPageBox.vue +1 -1
- package/src/layouts/CodeEditor.vue +5 -5
- package/src/layouts/Framework.vue +2 -2
- package/src/layouts/NavMenu.vue +1 -1
- package/src/layouts/PropsPanel.vue +1 -1
- package/src/layouts/page-bar/AddButton.vue +1 -1
- package/src/layouts/page-bar/PageBar.vue +8 -2
- package/src/layouts/page-bar/PageBarScrollContainer.vue +1 -1
- package/src/layouts/page-bar/PageList.vue +8 -2
- package/src/layouts/page-bar/SwitchTypeButton.vue +1 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +1 -1
- package/src/layouts/sidebar/Sidebar.vue +13 -1
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +11 -3
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +11 -2
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +1 -1
- package/src/layouts/sidebar/data-source/DataSourceList.vue +13 -3
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +19 -2
- package/src/layouts/sidebar/layer/LayerNodeTool.vue +1 -1
- package/src/layouts/sidebar/layer/LayerPanel.vue +5 -1
- package/src/layouts/sidebar/layer/use-click.ts +1 -1
- package/src/layouts/sidebar/layer/use-drag.ts +1 -1
- package/src/layouts/sidebar/layer/use-node-status.ts +3 -4
- package/src/layouts/workspace/Breadcrumb.vue +1 -1
- package/src/layouts/workspace/viewer/NodeListMenu.vue +2 -2
- package/src/layouts/workspace/viewer/Stage.vue +9 -5
- package/src/layouts/workspace/viewer/StageOverlay.vue +9 -4
- package/src/layouts/workspace/viewer/ViewerMenu.vue +1 -1
- package/src/services/codeBlock.ts +7 -7
- package/src/services/dataSource.ts +3 -4
- package/src/services/dep.ts +2 -2
- package/src/services/editor.ts +10 -11
- package/src/services/history.ts +1 -1
- package/src/services/props.ts +3 -3
- package/src/services/stageOverlay.ts +15 -7
- package/src/services/storage.ts +2 -2
- package/src/theme/index.scss +3 -0
- package/src/theme/page-bar.scss +2 -1
- package/src/type.ts +14 -11
- package/src/utils/config.ts +5 -5
- package/src/utils/content-menu.ts +3 -3
- package/src/utils/data-source/index.ts +1 -1
- package/src/utils/editor.ts +13 -35
- package/src/utils/operator.ts +2 -1
- package/src/utils/props.ts +1 -1
- package/src/utils/tree.ts +1 -1
- package/types/index.d.ts +1554 -3130
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', 'lodash-es', 'serialize-javascript', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.
|
|
5
|
-
})(this, (function (exports, vue, iconsVue, lodashEs, serialize,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tmagic/design'), require('@tmagic/form'), require('@tmagic/table'), require('vue'), require('@element-plus/icons-vue'), require('lodash-es'), require('serialize-javascript'), require('emmet-monaco-es'), require('monaco-editor'), require('@tmagic/core'), require('@tmagic/utils'), require('moveable'), require('@tmagic/stage'), require('events'), require('gesto'), require('sortablejs'), require('keycon')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tmagic/design', '@tmagic/form', '@tmagic/table', 'vue', '@element-plus/icons-vue', 'lodash-es', 'serialize-javascript', 'emmet-monaco-es', 'monaco-editor', '@tmagic/core', '@tmagic/utils', 'moveable', '@tmagic/stage', 'events', 'gesto', 'sortablejs', 'keycon'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.designPlugin, global.formPlugin, global.tablePlugin, global.Vue, global.iconsVue, global.lodashEs, global.serialize, global.emmetMonacoEs, global.monaco, global.core, global.utils, global.VanillaMoveable, global.StageCore, global.events, global.Gesto, global.Sortable, global.KeyController));
|
|
5
|
+
})(this, (function (exports, designPlugin, formPlugin, tablePlugin, vue, iconsVue, lodashEs, serialize, emmetMonacoEs, monaco, core, utils, VanillaMoveable, StageCore, events, Gesto, Sortable, KeyController) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
setup(__props) {
|
|
36
36
|
const isRelativePath = (str) => /^(\.|(\.\.)?\/)/.test(str);
|
|
37
37
|
return (_ctx, _cache) => {
|
|
38
|
-
return !_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
38
|
+
return !_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicIcon), {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "magic-editor-icon"
|
|
41
41
|
}, {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
vue.createVNode(vue.unref(iconsVue.Edit))
|
|
44
44
|
]),
|
|
45
45
|
_: 1
|
|
46
|
-
})) : typeof _ctx.icon === "string" && (_ctx.icon.startsWith("http") || isRelativePath(_ctx.icon)) ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
46
|
+
})) : typeof _ctx.icon === "string" && (_ctx.icon.startsWith("http") || isRelativePath(_ctx.icon)) ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicIcon), {
|
|
47
47
|
key: 1,
|
|
48
48
|
class: "magic-editor-icon"
|
|
49
49
|
}, {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
55
55
|
key: 2,
|
|
56
56
|
class: vue.normalizeClass(["magic-editor-icon", _ctx.icon])
|
|
57
|
-
}, null, 2)) : (vue.openBlock(), vue.createBlock(vue.unref(
|
|
57
|
+
}, null, 2)) : (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicIcon), {
|
|
58
58
|
key: 3,
|
|
59
59
|
class: "magic-editor-icon"
|
|
60
60
|
}, {
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
let $TMAGIC_EDITOR = {};
|
|
71
|
-
const
|
|
71
|
+
const setEditorConfig = (option) => {
|
|
72
72
|
$TMAGIC_EDITOR = option;
|
|
73
73
|
};
|
|
74
|
-
const
|
|
74
|
+
const getEditorConfig = (key) => $TMAGIC_EDITOR[key];
|
|
75
75
|
|
|
76
76
|
emmetMonacoEs.emmetHTML(monaco__namespace);
|
|
77
77
|
emmetMonacoEs.emmetCSS(monaco__namespace, ["css", "scss"]);
|
|
@@ -119,14 +119,14 @@
|
|
|
119
119
|
}
|
|
120
120
|
return value;
|
|
121
121
|
};
|
|
122
|
-
const
|
|
122
|
+
const parseCode = (v, language) => {
|
|
123
123
|
if (typeof v !== "string") {
|
|
124
124
|
return v;
|
|
125
125
|
}
|
|
126
126
|
if (language === "json") {
|
|
127
127
|
return JSON.parse(v);
|
|
128
128
|
}
|
|
129
|
-
return
|
|
129
|
+
return getEditorConfig("parseDSL")(v);
|
|
130
130
|
};
|
|
131
131
|
let vsEditor = null;
|
|
132
132
|
let vsDiffEditor = null;
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
e.stopPropagation();
|
|
175
175
|
const newValue = getEditorValue();
|
|
176
176
|
values.value = newValue;
|
|
177
|
-
emit("save", props.parse ?
|
|
177
|
+
emit("save", props.parse ? parseCode(newValue, props.language) : newValue);
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
if (props.type !== "diff" && props.autoSave) {
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
const newValue = getEditorValue();
|
|
183
183
|
if (values.value !== newValue) {
|
|
184
184
|
values.value = newValue;
|
|
185
|
-
emit("save", props.parse ?
|
|
185
|
+
emit("save", props.parse ? parseCode(newValue, props.language) : newValue);
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
}
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
class: vue.normalizeClass(`magic-code-editor-wrapper${fullScreen.value ? " full-screen" : ""}`),
|
|
246
246
|
style: vue.normalizeStyle(!fullScreen.value && _ctx.height ? `height: ${_ctx.height}` : "100%")
|
|
247
247
|
}, [
|
|
248
|
-
vue.createVNode(vue.unref(
|
|
248
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
249
249
|
class: "magic-code-editor-full-screen-icon",
|
|
250
250
|
circle: "",
|
|
251
251
|
size: "small",
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
const changeHandler = (v) => {
|
|
369
369
|
if (!props.name || !props.model) return;
|
|
370
370
|
try {
|
|
371
|
-
const parseDSL =
|
|
371
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
372
372
|
props.model[props.name] = parseDSL(`(${v[props.name]})`);
|
|
373
373
|
emit("change", props.model[props.name]);
|
|
374
374
|
} catch (e) {
|
|
@@ -414,7 +414,7 @@
|
|
|
414
414
|
enableToggleMode: false,
|
|
415
415
|
expandAll: true,
|
|
416
416
|
title: (mForm, { model, index }) => {
|
|
417
|
-
if (model.codeType ===
|
|
417
|
+
if (model.codeType === core.HookCodeType.DATA_SOURCE_METHOD) {
|
|
418
418
|
if (Array.isArray(model.codeId)) {
|
|
419
419
|
if (model.codeId.length < 2) {
|
|
420
420
|
return index;
|
|
@@ -435,12 +435,12 @@
|
|
|
435
435
|
name: "codeType",
|
|
436
436
|
span: 6,
|
|
437
437
|
options: [
|
|
438
|
-
{ value:
|
|
439
|
-
{ value:
|
|
438
|
+
{ value: core.HookCodeType.CODE, text: "代码块" },
|
|
439
|
+
{ value: core.HookCodeType.DATA_SOURCE_METHOD, text: "数据源方法" }
|
|
440
440
|
],
|
|
441
441
|
defaultValue: "code",
|
|
442
442
|
onChange: (mForm, v, { model }) => {
|
|
443
|
-
if (v ===
|
|
443
|
+
if (v === core.HookCodeType.DATA_SOURCE_METHOD) {
|
|
444
444
|
model.codeId = [];
|
|
445
445
|
} else {
|
|
446
446
|
model.codeId = "";
|
|
@@ -453,7 +453,7 @@
|
|
|
453
453
|
name: "codeId",
|
|
454
454
|
span: 18,
|
|
455
455
|
labelWidth: 0,
|
|
456
|
-
display: (mForm, { model }) => model.codeType !==
|
|
456
|
+
display: (mForm, { model }) => model.codeType !== core.HookCodeType.DATA_SOURCE_METHOD,
|
|
457
457
|
notEditable: () => !services?.codeBlockService.getEditStatus()
|
|
458
458
|
},
|
|
459
459
|
{
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
name: "codeId",
|
|
462
462
|
span: 18,
|
|
463
463
|
labelWidth: 0,
|
|
464
|
-
display: (mForm, { model }) => model.codeType ===
|
|
464
|
+
display: (mForm, { model }) => model.codeType === core.HookCodeType.DATA_SOURCE_METHOD,
|
|
465
465
|
notEditable: () => !services?.dataSourceService.get("editable")
|
|
466
466
|
}
|
|
467
467
|
]
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
(value) => {
|
|
474
474
|
if (lodashEs.isEmpty(value)) {
|
|
475
475
|
props.model[props.name] = {
|
|
476
|
-
hookType:
|
|
476
|
+
hookType: core.HookType.CODE,
|
|
477
477
|
hookData: []
|
|
478
478
|
};
|
|
479
479
|
}
|
|
@@ -489,9 +489,9 @@
|
|
|
489
489
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
490
490
|
class: vue.normalizeClass(["m-fields-code-select", _ctx.config.className])
|
|
491
491
|
}, [
|
|
492
|
-
vue.createVNode(vue.unref(
|
|
492
|
+
vue.createVNode(vue.unref(designPlugin.TMagicCard), null, {
|
|
493
493
|
default: vue.withCtx(() => [
|
|
494
|
-
vue.createVNode(vue.unref(
|
|
494
|
+
vue.createVNode(vue.unref(formPlugin.MContainer), {
|
|
495
495
|
config: codeConfig.value,
|
|
496
496
|
size: _ctx.size,
|
|
497
497
|
prop: _ctx.prop,
|
|
@@ -840,7 +840,7 @@
|
|
|
840
840
|
items: [
|
|
841
841
|
{
|
|
842
842
|
type: "display-conds",
|
|
843
|
-
name:
|
|
843
|
+
name: core.NODE_CONDS_KEY,
|
|
844
844
|
titlePrefix: "条件组",
|
|
845
845
|
defaultValue: []
|
|
846
846
|
}
|
|
@@ -998,7 +998,6 @@
|
|
|
998
998
|
return pageName;
|
|
999
999
|
};
|
|
1000
1000
|
const generatePageNameByApp = (app, type) => generatePageName(getPageNameList(type === "page" ? getPageList(app) : getPageFragmentList(app)), type);
|
|
1001
|
-
const isFixed = (node) => node.style?.position === "fixed";
|
|
1002
1001
|
const getNodeIndex = (id, parent) => {
|
|
1003
1002
|
const items = parent?.items || [];
|
|
1004
1003
|
return items.findIndex((item) => `${item.id}` === `${id}`);
|
|
@@ -1016,11 +1015,14 @@
|
|
|
1016
1015
|
height = 0;
|
|
1017
1016
|
}
|
|
1018
1017
|
const { height: parentHeight } = parentNode.style;
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1018
|
+
let wrapperHeightDeal = parentHeight;
|
|
1019
|
+
if (stage.mask && stage.renderer) {
|
|
1020
|
+
const { scrollTop = 0, wrapperHeight } = stage.mask;
|
|
1021
|
+
wrapperHeightDeal = utils.calcValueByFontsize(stage.renderer.getDocument(), wrapperHeight);
|
|
1022
|
+
const scrollTopDeal = utils.calcValueByFontsize(stage.renderer.getDocument(), scrollTop);
|
|
1023
|
+
if (utils.isPage(parentNode)) {
|
|
1024
|
+
return (wrapperHeightDeal - height) / 2 + scrollTopDeal;
|
|
1025
|
+
}
|
|
1024
1026
|
}
|
|
1025
1027
|
return (Math.min(parentHeight, wrapperHeightDeal) - height) / 2;
|
|
1026
1028
|
};
|
|
@@ -1135,22 +1137,13 @@
|
|
|
1135
1137
|
return {
|
|
1136
1138
|
...config.style || {},
|
|
1137
1139
|
top: getMiddleTop(config, parent, stage),
|
|
1138
|
-
left: fixNodeLeft(config, parent, stage?.renderer
|
|
1140
|
+
left: fixNodeLeft(config, parent, stage?.renderer?.contentWindow?.document)
|
|
1139
1141
|
};
|
|
1140
1142
|
};
|
|
1141
1143
|
const serializeConfig = (config) => serialize(config, {
|
|
1142
1144
|
space: 2,
|
|
1143
1145
|
unsafe: true
|
|
1144
1146
|
}).replace(/"(\w+)":\s/g, "$1: ");
|
|
1145
|
-
const traverseNode = (node, cb, parents = []) => {
|
|
1146
|
-
cb(node, parents);
|
|
1147
|
-
if (Array.isArray(node.items) && node.items.length) {
|
|
1148
|
-
parents.push(node);
|
|
1149
|
-
node.items.forEach((item) => {
|
|
1150
|
-
traverseNode(item, cb, [...parents]);
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
};
|
|
1154
1147
|
const moveItemsInContainer = (sourceIndices, parent, targetIndex) => {
|
|
1155
1148
|
sourceIndices.sort((a, b) => a - b);
|
|
1156
1149
|
for (let i = sourceIndices.length - 1; i >= 0; i--) {
|
|
@@ -1472,10 +1465,10 @@
|
|
|
1472
1465
|
replaceRelateId(originConfigs, targetConfigs, collectorOptions) {
|
|
1473
1466
|
const relateIdMap = this.getRelateIdMap();
|
|
1474
1467
|
if (Object.keys(relateIdMap).length === 0) return;
|
|
1475
|
-
const target = new
|
|
1468
|
+
const target = new core.Target({
|
|
1476
1469
|
...collectorOptions
|
|
1477
1470
|
});
|
|
1478
|
-
const coperWatcher = new
|
|
1471
|
+
const coperWatcher = new core.Watcher();
|
|
1479
1472
|
coperWatcher.addTarget(target);
|
|
1480
1473
|
coperWatcher.collect(originConfigs, {}, true, collectorOptions.type);
|
|
1481
1474
|
originConfigs.forEach((config) => {
|
|
@@ -1707,7 +1700,7 @@
|
|
|
1707
1700
|
if (item === null) return null;
|
|
1708
1701
|
switch (protocol) {
|
|
1709
1702
|
case "object" /* OBJECT */:
|
|
1710
|
-
return
|
|
1703
|
+
return getEditorConfig("parseDSL")(`(${item})`);
|
|
1711
1704
|
case "json" /* JSON */:
|
|
1712
1705
|
return JSON.parse(item);
|
|
1713
1706
|
case "number" /* NUMBER */:
|
|
@@ -1919,7 +1912,7 @@
|
|
|
1919
1912
|
* 只有容器拥有布局
|
|
1920
1913
|
*/
|
|
1921
1914
|
async getLayout(parent, node) {
|
|
1922
|
-
if (node && typeof node !== "function" && isFixed(node)) return Layout.FIXED;
|
|
1915
|
+
if (node && typeof node !== "function" && StageCore.isFixed(node.style || {})) return Layout.FIXED;
|
|
1923
1916
|
if (parent.layout) {
|
|
1924
1917
|
return parent.layout;
|
|
1925
1918
|
}
|
|
@@ -1944,7 +1937,7 @@
|
|
|
1944
1937
|
historyService.resetState();
|
|
1945
1938
|
}
|
|
1946
1939
|
if (node?.id) {
|
|
1947
|
-
this.get("stage")?.renderer
|
|
1940
|
+
this.get("stage")?.renderer?.runtime?.getApp?.()?.page?.emit(
|
|
1948
1941
|
"editor:select",
|
|
1949
1942
|
{
|
|
1950
1943
|
node,
|
|
@@ -1959,7 +1952,7 @@
|
|
|
1959
1952
|
}
|
|
1960
1953
|
async selectNextNode() {
|
|
1961
1954
|
const node = vue.toRaw(this.get("node"));
|
|
1962
|
-
if (!node || utils.isPage(node) || node.type ===
|
|
1955
|
+
if (!node || utils.isPage(node) || node.type === core.NodeType.ROOT) return node;
|
|
1963
1956
|
const parent = vue.toRaw(this.getParentById(node.id));
|
|
1964
1957
|
if (!parent) return node;
|
|
1965
1958
|
const index = getNodeIndex(node.id, parent);
|
|
@@ -2020,7 +2013,7 @@
|
|
|
2020
2013
|
const curNode = this.get("node");
|
|
2021
2014
|
const stage = this.get("stage");
|
|
2022
2015
|
if (!curNode) throw new Error("当前选中节点为空");
|
|
2023
|
-
if ((parent.type ===
|
|
2016
|
+
if ((parent.type === core.NodeType.ROOT || curNode?.type === core.NodeType.ROOT) && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
2024
2017
|
throw new Error("app下不能添加组件");
|
|
2025
2018
|
}
|
|
2026
2019
|
if (parent.id !== curNode.id && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
@@ -2160,7 +2153,7 @@
|
|
|
2160
2153
|
}
|
|
2161
2154
|
});
|
|
2162
2155
|
if (!newConfig.type) throw new Error("配置缺少type值");
|
|
2163
|
-
if (newConfig.type ===
|
|
2156
|
+
if (newConfig.type === core.NodeType.ROOT) {
|
|
2164
2157
|
this.set("root", newConfig);
|
|
2165
2158
|
return newConfig;
|
|
2166
2159
|
}
|
|
@@ -2198,7 +2191,7 @@
|
|
|
2198
2191
|
async update(config) {
|
|
2199
2192
|
const nodes = Array.isArray(config) ? config : [config];
|
|
2200
2193
|
const newNodes = await Promise.all(nodes.map((node) => this.doUpdate(node)));
|
|
2201
|
-
if (newNodes[0]?.type !==
|
|
2194
|
+
if (newNodes[0]?.type !== core.NodeType.ROOT) {
|
|
2202
2195
|
this.pushHistoryState();
|
|
2203
2196
|
}
|
|
2204
2197
|
this.emit("update", newNodes);
|
|
@@ -2249,10 +2242,10 @@
|
|
|
2249
2242
|
copyWithRelated(config, collectorOptions) {
|
|
2250
2243
|
const copyNodes = Array.isArray(config) ? config : [config];
|
|
2251
2244
|
if (collectorOptions && typeof collectorOptions.isTarget === "function") {
|
|
2252
|
-
const customTarget = new
|
|
2245
|
+
const customTarget = new core.Target({
|
|
2253
2246
|
...collectorOptions
|
|
2254
2247
|
});
|
|
2255
|
-
const coperWatcher = new
|
|
2248
|
+
const coperWatcher = new core.Watcher();
|
|
2256
2249
|
coperWatcher.addTarget(customTarget);
|
|
2257
2250
|
coperWatcher.collect(copyNodes, {}, true, collectorOptions.type);
|
|
2258
2251
|
Object.keys(customTarget.deps).forEach((nodeId) => {
|
|
@@ -2286,7 +2279,7 @@
|
|
|
2286
2279
|
let parent = null;
|
|
2287
2280
|
if (config.length === 1 && config[0].id === node?.id) {
|
|
2288
2281
|
parent = this.get("parent");
|
|
2289
|
-
if (parent?.type ===
|
|
2282
|
+
if (parent?.type === core.NodeType.ROOT) {
|
|
2290
2283
|
parent = this.get("page");
|
|
2291
2284
|
}
|
|
2292
2285
|
}
|
|
@@ -2298,7 +2291,7 @@
|
|
|
2298
2291
|
}
|
|
2299
2292
|
async doPaste(config, position = {}) {
|
|
2300
2293
|
propsService.clearRelateId();
|
|
2301
|
-
const doc = this.get("stage")?.renderer
|
|
2294
|
+
const doc = this.get("stage")?.renderer?.contentWindow?.document;
|
|
2302
2295
|
const pasteConfigs = beforePaste(position, lodashEs.cloneDeep(config), doc);
|
|
2303
2296
|
return pasteConfigs;
|
|
2304
2297
|
}
|
|
@@ -2312,7 +2305,7 @@
|
|
|
2312
2305
|
}
|
|
2313
2306
|
if (!node.style) return config;
|
|
2314
2307
|
const stage = this.get("stage");
|
|
2315
|
-
const doc = stage?.renderer
|
|
2308
|
+
const doc = stage?.renderer?.contentWindow?.document;
|
|
2316
2309
|
if (doc) {
|
|
2317
2310
|
const el = utils.getElById()(doc, node.id);
|
|
2318
2311
|
const parentEl = layout === Layout.FIXED ? doc.body : el?.offsetParent;
|
|
@@ -2587,9 +2580,9 @@
|
|
|
2587
2580
|
async toggleFixedPosition(dist, src, root) {
|
|
2588
2581
|
const newConfig = lodashEs.cloneDeep(dist);
|
|
2589
2582
|
if (!utils.isPop(src) && newConfig.style?.position) {
|
|
2590
|
-
if (isFixed(newConfig) && !isFixed(src)) {
|
|
2583
|
+
if (StageCore.isFixed(newConfig.style) && !StageCore.isFixed(src.style || {})) {
|
|
2591
2584
|
newConfig.style = change2Fixed(newConfig, root);
|
|
2592
|
-
} else if (!isFixed(newConfig) && isFixed(src)) {
|
|
2585
|
+
} else if (!StageCore.isFixed(newConfig.style) && StageCore.isFixed(src.style || {})) {
|
|
2593
2586
|
newConfig.style = await Fixed2Other(newConfig, root, this.getLayout);
|
|
2594
2587
|
}
|
|
2595
2588
|
}
|
|
@@ -2651,7 +2644,7 @@
|
|
|
2651
2644
|
}
|
|
2652
2645
|
const root = editorService.get("root");
|
|
2653
2646
|
if ((utils.isPage(pasteConfig) || utils.isPageFragment(pasteConfig)) && root) {
|
|
2654
|
-
pasteConfig.name = generatePageNameByApp(root, utils.isPage(pasteConfig) ?
|
|
2647
|
+
pasteConfig.name = generatePageNameByApp(root, utils.isPage(pasteConfig) ? core.NodeType.PAGE : core.NodeType.PAGE_FRAGMENT);
|
|
2655
2648
|
}
|
|
2656
2649
|
return pasteConfig;
|
|
2657
2650
|
});
|
|
@@ -3189,7 +3182,7 @@
|
|
|
3189
3182
|
setup(__props, { emit: __emit }) {
|
|
3190
3183
|
const props = __props;
|
|
3191
3184
|
const emit = __emit;
|
|
3192
|
-
const form
|
|
3185
|
+
const form = vue.ref();
|
|
3193
3186
|
const getFormConfig = (items = []) => [
|
|
3194
3187
|
{
|
|
3195
3188
|
type: "fieldset",
|
|
@@ -3212,16 +3205,16 @@
|
|
|
3212
3205
|
);
|
|
3213
3206
|
const onParamsChangeHandler = async () => {
|
|
3214
3207
|
try {
|
|
3215
|
-
const value = await form
|
|
3208
|
+
const value = await form.value?.submitForm(true);
|
|
3216
3209
|
emit("change", value);
|
|
3217
3210
|
} catch (e) {
|
|
3218
3211
|
error(e);
|
|
3219
3212
|
}
|
|
3220
3213
|
};
|
|
3221
3214
|
return (_ctx, _cache) => {
|
|
3222
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
3215
|
+
return vue.openBlock(), vue.createBlock(vue.unref(formPlugin.MForm), {
|
|
3223
3216
|
ref_key: "form",
|
|
3224
|
-
ref: form
|
|
3217
|
+
ref: form,
|
|
3225
3218
|
config: codeParamsConfig.value,
|
|
3226
3219
|
"init-values": _ctx.model,
|
|
3227
3220
|
disabled: _ctx.disabled,
|
|
@@ -3234,7 +3227,7 @@
|
|
|
3234
3227
|
});
|
|
3235
3228
|
|
|
3236
3229
|
const _hoisted_1$u = { class: "m-fields-code-select-col" };
|
|
3237
|
-
const _hoisted_2$
|
|
3230
|
+
const _hoisted_2$g = { class: "code-select-container" };
|
|
3238
3231
|
const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
3239
3232
|
...{
|
|
3240
3233
|
name: "MFieldsCodeSelectCol"
|
|
@@ -3258,7 +3251,7 @@
|
|
|
3258
3251
|
const eventBus = vue.inject("eventBus");
|
|
3259
3252
|
const emit = __emit;
|
|
3260
3253
|
const props = __props;
|
|
3261
|
-
const notEditable = vue.computed(() =>
|
|
3254
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.config.notEditable, props));
|
|
3262
3255
|
const hasCodeBlockSidePanel = vue.computed(
|
|
3263
3256
|
() => (services?.uiService.get("sideBarItems") || []).find((item) => item.$key === SideItemKey.CODE_BLOCK)
|
|
3264
3257
|
);
|
|
@@ -3299,7 +3292,7 @@
|
|
|
3299
3292
|
onChange: (formState, codeId, { model }) => {
|
|
3300
3293
|
paramsConfig.value = getParamItemsConfig(codeId);
|
|
3301
3294
|
if (paramsConfig.value.length) {
|
|
3302
|
-
model.params =
|
|
3295
|
+
model.params = formPlugin.createValues(formState, paramsConfig.value, {}, model.params);
|
|
3303
3296
|
} else {
|
|
3304
3297
|
model.params = {};
|
|
3305
3298
|
}
|
|
@@ -3315,15 +3308,15 @@
|
|
|
3315
3308
|
};
|
|
3316
3309
|
return (_ctx, _cache) => {
|
|
3317
3310
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
|
|
3318
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3319
|
-
vue.createVNode(vue.unref(
|
|
3311
|
+
vue.createElementVNode("div", _hoisted_2$g, [
|
|
3312
|
+
vue.createVNode(vue.unref(formPlugin.MContainer), {
|
|
3320
3313
|
class: "select",
|
|
3321
3314
|
config: selectConfig,
|
|
3322
3315
|
model: _ctx.model,
|
|
3323
3316
|
size: _ctx.size,
|
|
3324
3317
|
onChange: onParamsChangeHandler
|
|
3325
3318
|
}, null, 8, ["model", "size"]),
|
|
3326
|
-
_ctx.model[_ctx.name] && hasCodeBlockSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
3319
|
+
_ctx.model[_ctx.name] && hasCodeBlockSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
3327
3320
|
key: 0,
|
|
3328
3321
|
class: "m-fields-select-action-button",
|
|
3329
3322
|
size: _ctx.size,
|
|
@@ -3371,7 +3364,7 @@
|
|
|
3371
3364
|
const emit = __emit;
|
|
3372
3365
|
const { dataSourceService } = vue.inject("services") || {};
|
|
3373
3366
|
const props = __props;
|
|
3374
|
-
const optionComponent =
|
|
3367
|
+
const optionComponent = designPlugin.getDesignConfig("components")?.option;
|
|
3375
3368
|
const options = vue.computed(() => {
|
|
3376
3369
|
const [id, ...fieldNames] = [...props.config.parentFields || [], ...props.model.field];
|
|
3377
3370
|
const ds = dataSourceService?.getDataSourceById(id);
|
|
@@ -3403,7 +3396,7 @@
|
|
|
3403
3396
|
emit("change", v);
|
|
3404
3397
|
};
|
|
3405
3398
|
return (_ctx, _cache) => {
|
|
3406
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
3399
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicSelect), {
|
|
3407
3400
|
modelValue: _ctx.model[_ctx.name],
|
|
3408
3401
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3409
3402
|
clearable: "",
|
|
@@ -3458,7 +3451,7 @@
|
|
|
3458
3451
|
const props = __props;
|
|
3459
3452
|
const target = vue.ref();
|
|
3460
3453
|
const titleEl = vue.ref();
|
|
3461
|
-
const zIndex =
|
|
3454
|
+
const zIndex = designPlugin.useZIndex();
|
|
3462
3455
|
const curZIndex = vue.ref(0);
|
|
3463
3456
|
const titleHeight = vue.ref(0);
|
|
3464
3457
|
const bodyHeight = vue.computed(() => {
|
|
@@ -3585,7 +3578,7 @@
|
|
|
3585
3578
|
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.title), 1)
|
|
3586
3579
|
]),
|
|
3587
3580
|
vue.createElementVNode("div", null, [
|
|
3588
|
-
vue.createVNode(vue.unref(
|
|
3581
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
3589
3582
|
link: "",
|
|
3590
3583
|
size: "small",
|
|
3591
3584
|
onClick: closeHandler
|
|
@@ -3615,7 +3608,7 @@
|
|
|
3615
3608
|
const codeBlockEditor = vue.ref();
|
|
3616
3609
|
const createCodeBlock = async () => {
|
|
3617
3610
|
if (!codeBlockService) {
|
|
3618
|
-
|
|
3611
|
+
designPlugin.tMagicMessage.error("新增代码块失败");
|
|
3619
3612
|
return;
|
|
3620
3613
|
}
|
|
3621
3614
|
codeConfig.value = {
|
|
@@ -3632,7 +3625,7 @@
|
|
|
3632
3625
|
const editCode = async (id) => {
|
|
3633
3626
|
const codeBlock = await codeBlockService?.getCodeContentById(id);
|
|
3634
3627
|
if (!codeBlock) {
|
|
3635
|
-
|
|
3628
|
+
designPlugin.tMagicMessage.error("获取代码块内容失败");
|
|
3636
3629
|
return;
|
|
3637
3630
|
}
|
|
3638
3631
|
let codeContent = codeBlock.content;
|
|
@@ -3690,7 +3683,7 @@
|
|
|
3690
3683
|
editCode: async (model, methodName) => {
|
|
3691
3684
|
const method = model.methods?.find((method2) => method2.name === methodName);
|
|
3692
3685
|
if (!method) {
|
|
3693
|
-
|
|
3686
|
+
designPlugin.tMagicMessage.error("获取数据源方法失败");
|
|
3694
3687
|
return;
|
|
3695
3688
|
}
|
|
3696
3689
|
let codeContent = method.content || `({ params, dataSource, app }) => {
|
|
@@ -3722,7 +3715,7 @@
|
|
|
3722
3715
|
dataSource.value.methods = [];
|
|
3723
3716
|
}
|
|
3724
3717
|
if (values.content) {
|
|
3725
|
-
const parseDSL =
|
|
3718
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
3726
3719
|
if (typeof values.content === "string") {
|
|
3727
3720
|
values.content = parseDSL(values.content);
|
|
3728
3721
|
}
|
|
@@ -3885,7 +3878,7 @@
|
|
|
3885
3878
|
}
|
|
3886
3879
|
}
|
|
3887
3880
|
);
|
|
3888
|
-
stage.mask
|
|
3881
|
+
stage.mask?.setGuides([
|
|
3889
3882
|
getGuideLineFromCache(getGuideLineKey(H_GUIDE_LINE_STORAGE_KEY)),
|
|
3890
3883
|
getGuideLineFromCache(getGuideLineKey(V_GUIDE_LINE_STORAGE_KEY))
|
|
3891
3884
|
]);
|
|
@@ -4076,7 +4069,7 @@
|
|
|
4076
4069
|
const filter = (text) => {
|
|
4077
4070
|
if (!nodeData.value.length) return;
|
|
4078
4071
|
nodeData.value.forEach((node) => {
|
|
4079
|
-
traverseNode(node, (node2, parents) => {
|
|
4072
|
+
utils.traverseNode(node, (node2, parents) => {
|
|
4080
4073
|
if (!nodeStatusMap.value) return;
|
|
4081
4074
|
const visible = filterIsMatch(text, node2);
|
|
4082
4075
|
if (visible && parents.length) {
|
|
@@ -4154,7 +4147,7 @@
|
|
|
4154
4147
|
const createPageNodeStatus$1 = (nodeData, initialLayerNodeStatus) => {
|
|
4155
4148
|
const map = /* @__PURE__ */ new Map();
|
|
4156
4149
|
nodeData.forEach(
|
|
4157
|
-
(node) => traverseNode(node, (node2) => {
|
|
4150
|
+
(node) => utils.traverseNode(node, (node2) => {
|
|
4158
4151
|
map.set(
|
|
4159
4152
|
node2.id,
|
|
4160
4153
|
initialLayerNodeStatus?.get(node2.id) || {
|
|
@@ -4186,7 +4179,7 @@
|
|
|
4186
4179
|
};
|
|
4187
4180
|
|
|
4188
4181
|
const _hoisted_1$t = { class: "m-editor-data-source-fields" };
|
|
4189
|
-
const _hoisted_2$
|
|
4182
|
+
const _hoisted_2$f = { class: "m-editor-data-source-fields-footer" };
|
|
4190
4183
|
const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
4191
4184
|
...{
|
|
4192
4185
|
name: "MFieldsDataSourceFields"
|
|
@@ -4277,7 +4270,7 @@
|
|
|
4277
4270
|
text: "删除",
|
|
4278
4271
|
buttonType: "danger",
|
|
4279
4272
|
handler: async (row, index) => {
|
|
4280
|
-
await
|
|
4273
|
+
await designPlugin.tMagicMessageBox.confirm(`确定删除${row.title}(${row.name})?`, "提示");
|
|
4281
4274
|
props.model[props.name].splice(index, 1);
|
|
4282
4275
|
emit("change", props.model[props.name]);
|
|
4283
4276
|
}
|
|
@@ -4429,7 +4422,7 @@
|
|
|
4429
4422
|
addFromJsonDialogVisible.value = false;
|
|
4430
4423
|
emit("change", props.model[props.name]);
|
|
4431
4424
|
} catch (e) {
|
|
4432
|
-
|
|
4425
|
+
designPlugin.tMagicMessage.error(e.message);
|
|
4433
4426
|
}
|
|
4434
4427
|
};
|
|
4435
4428
|
const addDialogVisible = vue.useModel(__props, "visible");
|
|
@@ -4439,32 +4432,32 @@
|
|
|
4439
4432
|
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
4440
4433
|
return (_ctx, _cache) => {
|
|
4441
4434
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, [
|
|
4442
|
-
vue.createVNode(vue.unref(
|
|
4435
|
+
vue.createVNode(vue.unref(tablePlugin.MagicTable), {
|
|
4443
4436
|
data: _ctx.model[_ctx.name],
|
|
4444
4437
|
columns: fieldColumns
|
|
4445
4438
|
}, null, 8, ["data"]),
|
|
4446
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4447
|
-
vue.createVNode(vue.unref(
|
|
4439
|
+
vue.createElementVNode("div", _hoisted_2$f, [
|
|
4440
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4448
4441
|
size: "small",
|
|
4449
4442
|
disabled: _ctx.disabled,
|
|
4450
4443
|
plain: "",
|
|
4451
4444
|
onClick: _cache[0] || (_cache[0] = ($event) => newFromJsonHandler())
|
|
4452
4445
|
}, {
|
|
4453
|
-
default: vue.withCtx(() => [
|
|
4446
|
+
default: vue.withCtx(() => _cache[8] || (_cache[8] = [
|
|
4454
4447
|
vue.createTextVNode("快速添加")
|
|
4455
|
-
]),
|
|
4448
|
+
])),
|
|
4456
4449
|
_: 1
|
|
4457
4450
|
}, 8, ["disabled"]),
|
|
4458
|
-
vue.createVNode(vue.unref(
|
|
4451
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4459
4452
|
size: "small",
|
|
4460
4453
|
type: "primary",
|
|
4461
4454
|
disabled: _ctx.disabled,
|
|
4462
4455
|
plain: "",
|
|
4463
4456
|
onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
|
|
4464
4457
|
}, {
|
|
4465
|
-
default: vue.withCtx(() => [
|
|
4458
|
+
default: vue.withCtx(() => _cache[9] || (_cache[9] = [
|
|
4466
4459
|
vue.createTextVNode("添加")
|
|
4467
|
-
]),
|
|
4460
|
+
])),
|
|
4468
4461
|
_: 1
|
|
4469
4462
|
}, 8, ["disabled"])
|
|
4470
4463
|
]),
|
|
@@ -4479,7 +4472,7 @@
|
|
|
4479
4472
|
position: vue.unref(boxPosition)
|
|
4480
4473
|
}, {
|
|
4481
4474
|
body: vue.withCtx(() => [
|
|
4482
|
-
vue.createVNode(vue.unref(
|
|
4475
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
4483
4476
|
"label-width": "80px",
|
|
4484
4477
|
title: fieldTitle.value,
|
|
4485
4478
|
config: dataSourceFieldsConfig,
|
|
@@ -4502,7 +4495,7 @@
|
|
|
4502
4495
|
position: vue.unref(boxPosition)
|
|
4503
4496
|
}, {
|
|
4504
4497
|
body: vue.withCtx(() => [
|
|
4505
|
-
vue.createVNode(vue.unref(
|
|
4498
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
4506
4499
|
config: jsonFromConfig,
|
|
4507
4500
|
values: jsonFromValues.value,
|
|
4508
4501
|
disabled: _ctx.disabled,
|
|
@@ -4535,13 +4528,13 @@
|
|
|
4535
4528
|
const props = __props;
|
|
4536
4529
|
const emit = __emit;
|
|
4537
4530
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
4538
|
-
const optionComponent =
|
|
4531
|
+
const optionComponent = designPlugin.getDesignConfig("components")?.option;
|
|
4539
4532
|
const services = vue.inject("services");
|
|
4540
4533
|
const mForm = vue.inject("mForm");
|
|
4541
4534
|
const eventBus = vue.inject("eventBus");
|
|
4542
4535
|
const dataSources = vue.computed(() => services?.dataSourceService.get("dataSources") || []);
|
|
4543
4536
|
const valueIsKey = vue.computed(() => props.value === "key");
|
|
4544
|
-
const notEditable = vue.computed(() =>
|
|
4537
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.notEditable, props));
|
|
4545
4538
|
const dataSourcesOptions = vue.computed(
|
|
4546
4539
|
() => dataSources.value.map((ds) => ({
|
|
4547
4540
|
text: ds.title || ds.id,
|
|
@@ -4600,7 +4593,7 @@
|
|
|
4600
4593
|
return (_ctx, _cache) => {
|
|
4601
4594
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$s, [
|
|
4602
4595
|
_ctx.checkStrictly ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
4603
|
-
vue.createVNode(vue.unref(
|
|
4596
|
+
vue.createVNode(vue.unref(designPlugin.TMagicSelect), {
|
|
4604
4597
|
"model-value": selectDataSourceId.value,
|
|
4605
4598
|
clearable: "",
|
|
4606
4599
|
filterable: "",
|
|
@@ -4630,7 +4623,7 @@
|
|
|
4630
4623
|
]),
|
|
4631
4624
|
_: 1
|
|
4632
4625
|
}, 8, ["model-value", "size", "disabled"]),
|
|
4633
|
-
vue.createVNode(vue.unref(
|
|
4626
|
+
vue.createVNode(vue.unref(designPlugin.TMagicCascader), {
|
|
4634
4627
|
"model-value": selectFieldsId.value,
|
|
4635
4628
|
clearable: "",
|
|
4636
4629
|
filterable: "",
|
|
@@ -4642,7 +4635,7 @@
|
|
|
4642
4635
|
},
|
|
4643
4636
|
onChange: fieldChangeHandler
|
|
4644
4637
|
}, null, 8, ["model-value", "size", "disabled", "options", "props"])
|
|
4645
|
-
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(
|
|
4638
|
+
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicCascader), {
|
|
4646
4639
|
key: 1,
|
|
4647
4640
|
clearable: "",
|
|
4648
4641
|
filterable: "",
|
|
@@ -4655,12 +4648,12 @@
|
|
|
4655
4648
|
},
|
|
4656
4649
|
onChange: onChangeHandler
|
|
4657
4650
|
}, null, 8, ["model-value", "disabled", "size", "options", "props"])),
|
|
4658
|
-
selectDataSourceId.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
4651
|
+
selectDataSourceId.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
4659
4652
|
key: 2,
|
|
4660
4653
|
content: notEditable.value ? "查看" : "编辑"
|
|
4661
4654
|
}, {
|
|
4662
4655
|
default: vue.withCtx(() => [
|
|
4663
|
-
vue.createVNode(vue.unref(
|
|
4656
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4664
4657
|
class: "m-fields-select-action-button",
|
|
4665
4658
|
size: _ctx.size,
|
|
4666
4659
|
onClick: _cache[0] || (_cache[0] = ($event) => editHandler(selectDataSourceId.value))
|
|
@@ -4777,7 +4770,7 @@
|
|
|
4777
4770
|
if (!keys.length || field?.type && (field.type === "any" || dataSourceFieldType.includes("any") || dataSourceFieldType.includes(field.type))) {
|
|
4778
4771
|
emit("change", value);
|
|
4779
4772
|
} else {
|
|
4780
|
-
|
|
4773
|
+
designPlugin.tMagicMessage.error(`请选择类型为${dataSourceFieldType.join("或")}的字段`);
|
|
4781
4774
|
emit("change", [dsId]);
|
|
4782
4775
|
}
|
|
4783
4776
|
};
|
|
@@ -4802,16 +4795,16 @@
|
|
|
4802
4795
|
"last-values": _ctx.lastValues,
|
|
4803
4796
|
"init-values": _ctx.initValues,
|
|
4804
4797
|
values: _ctx.values,
|
|
4805
|
-
prop:
|
|
4798
|
+
prop: _ctx.prop,
|
|
4806
4799
|
onChange: onChangeHandler
|
|
4807
4800
|
}, null, 40, ["config", "model", "name", "disabled", "size", "last-values", "init-values", "values", "prop"])),
|
|
4808
|
-
_ctx.config.fieldConfig ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
4801
|
+
_ctx.config.fieldConfig ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
4809
4802
|
key: 2,
|
|
4810
4803
|
disabled: showDataSourceFieldSelect.value,
|
|
4811
4804
|
content: "选择数据源"
|
|
4812
4805
|
}, {
|
|
4813
4806
|
default: vue.withCtx(() => [
|
|
4814
|
-
vue.createVNode(vue.unref(
|
|
4807
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4815
4808
|
style: { "margin-left": "5px" },
|
|
4816
4809
|
type: showDataSourceFieldSelect.value ? "primary" : "default",
|
|
4817
4810
|
size: _ctx.size,
|
|
@@ -4831,8 +4824,8 @@
|
|
|
4831
4824
|
});
|
|
4832
4825
|
|
|
4833
4826
|
const _hoisted_1$q = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
4834
|
-
const _hoisted_2$
|
|
4835
|
-
const _hoisted_3$
|
|
4827
|
+
const _hoisted_2$e = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
4828
|
+
const _hoisted_3$4 = { class: "el-input__inner t-input__inner" };
|
|
4836
4829
|
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
4837
4830
|
...{
|
|
4838
4831
|
name: "MFieldsDataSourceInput"
|
|
@@ -5009,7 +5002,7 @@
|
|
|
5009
5002
|
changeHandler(state.value);
|
|
5010
5003
|
};
|
|
5011
5004
|
return (_ctx, _cache) => {
|
|
5012
|
-
return _ctx.disabled || isFocused.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(
|
|
5005
|
+
return _ctx.disabled || isFocused.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(designPlugin.getDesignConfig)("components")?.autocomplete.component || "el-autocomplete"), vue.mergeProps(
|
|
5013
5006
|
{
|
|
5014
5007
|
key: 0,
|
|
5015
5008
|
class: "tmagic-design-auto-complete",
|
|
@@ -5018,7 +5011,7 @@
|
|
|
5018
5011
|
modelValue: state.value,
|
|
5019
5012
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
|
|
5020
5013
|
},
|
|
5021
|
-
vue.unref(
|
|
5014
|
+
vue.unref(designPlugin.getDesignConfig)("components")?.autocomplete.props({
|
|
5022
5015
|
disabled: _ctx.disabled,
|
|
5023
5016
|
size: _ctx.size,
|
|
5024
5017
|
fetchSuggestions: querySearch,
|
|
@@ -5038,7 +5031,7 @@
|
|
|
5038
5031
|
default: vue.withCtx(({ item }) => [
|
|
5039
5032
|
vue.createElementVNode("div", _hoisted_1$q, [
|
|
5040
5033
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
5041
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
5034
|
+
vue.createElementVNode("span", _hoisted_2$e, vue.toDisplayString(item.value), 1)
|
|
5042
5035
|
])
|
|
5043
5036
|
]),
|
|
5044
5037
|
_: 1
|
|
@@ -5050,14 +5043,14 @@
|
|
|
5050
5043
|
vue.createElementVNode("div", {
|
|
5051
5044
|
class: vue.normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
5052
5045
|
}, [
|
|
5053
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
5046
|
+
vue.createElementVNode("div", _hoisted_3$4, [
|
|
5054
5047
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayState.value, (item, index) => {
|
|
5055
5048
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
5056
5049
|
item.type === "text" ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
5057
5050
|
key: index,
|
|
5058
5051
|
style: { "margin-right": "2px" }
|
|
5059
5052
|
}, vue.toDisplayString(item.value), 1)) : vue.createCommentVNode("", true),
|
|
5060
|
-
item.type === "var" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5053
|
+
item.type === "var" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTag), {
|
|
5061
5054
|
key: index,
|
|
5062
5055
|
size: _ctx.size
|
|
5063
5056
|
}, {
|
|
@@ -5080,9 +5073,9 @@
|
|
|
5080
5073
|
});
|
|
5081
5074
|
|
|
5082
5075
|
const _hoisted_1$p = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
5083
|
-
const _hoisted_2$
|
|
5084
|
-
const _hoisted_3$
|
|
5085
|
-
const _hoisted_4$
|
|
5076
|
+
const _hoisted_2$d = { style: { "flex": "1" } };
|
|
5077
|
+
const _hoisted_3$3 = { style: { "flex": "1" } };
|
|
5078
|
+
const _hoisted_4$3 = { class: "dialog-footer" };
|
|
5086
5079
|
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
5087
5080
|
...{
|
|
5088
5081
|
name: "MEditorCodeBlockEditor"
|
|
@@ -5202,10 +5195,10 @@
|
|
|
5202
5195
|
height: "500px",
|
|
5203
5196
|
onChange: (formState, code) => {
|
|
5204
5197
|
try {
|
|
5205
|
-
|
|
5198
|
+
getEditorConfig("parseDSL")(code);
|
|
5206
5199
|
return code;
|
|
5207
5200
|
} catch (error) {
|
|
5208
|
-
|
|
5201
|
+
designPlugin.tMagicMessage.error(error.message);
|
|
5209
5202
|
throw error;
|
|
5210
5203
|
}
|
|
5211
5204
|
}
|
|
@@ -5216,7 +5209,7 @@
|
|
|
5216
5209
|
emit("submit", values);
|
|
5217
5210
|
};
|
|
5218
5211
|
const errorHandler = (error) => {
|
|
5219
|
-
|
|
5212
|
+
designPlugin.tMagicMessage.error(error.message);
|
|
5220
5213
|
};
|
|
5221
5214
|
const formBox = vue.ref();
|
|
5222
5215
|
const changedValue = vue.ref();
|
|
@@ -5228,7 +5221,7 @@
|
|
|
5228
5221
|
done();
|
|
5229
5222
|
return;
|
|
5230
5223
|
}
|
|
5231
|
-
|
|
5224
|
+
designPlugin.tMagicMessageBox.confirm("当前代码块已修改,是否保存?", "提示", {
|
|
5232
5225
|
confirmButtonText: "保存并关闭",
|
|
5233
5226
|
cancelButtonText: "不保存并关闭",
|
|
5234
5227
|
type: "warning",
|
|
@@ -5268,7 +5261,7 @@
|
|
|
5268
5261
|
"before-close": beforeClose
|
|
5269
5262
|
}, {
|
|
5270
5263
|
body: vue.withCtx(() => [
|
|
5271
|
-
vue.createVNode(vue.unref(
|
|
5264
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
5272
5265
|
class: "m-editor-code-block-editor",
|
|
5273
5266
|
ref_key: "formBox",
|
|
5274
5267
|
ref: formBox,
|
|
@@ -5285,15 +5278,15 @@
|
|
|
5285
5278
|
onClosed: closedHandler
|
|
5286
5279
|
}, {
|
|
5287
5280
|
left: vue.withCtx(() => [
|
|
5288
|
-
!_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5281
|
+
!_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
5289
5282
|
key: 0,
|
|
5290
5283
|
type: "primary",
|
|
5291
5284
|
link: "",
|
|
5292
5285
|
onClick: _cache[0] || (_cache[0] = ($event) => difVisible.value = true)
|
|
5293
5286
|
}, {
|
|
5294
|
-
default: vue.withCtx(() => [
|
|
5287
|
+
default: vue.withCtx(() => _cache[6] || (_cache[6] = [
|
|
5295
5288
|
vue.createTextVNode("查看修改")
|
|
5296
|
-
]),
|
|
5289
|
+
])),
|
|
5297
5290
|
_: 1
|
|
5298
5291
|
})) : vue.createCommentVNode("", true)
|
|
5299
5292
|
]),
|
|
@@ -5303,56 +5296,56 @@
|
|
|
5303
5296
|
_: 1
|
|
5304
5297
|
}, 8, ["visible", "width", "height", "title", "position"]),
|
|
5305
5298
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
5306
|
-
vue.createVNode(vue.unref(
|
|
5299
|
+
vue.createVNode(vue.unref(designPlugin.TMagicDialog), {
|
|
5307
5300
|
title: "查看修改",
|
|
5308
5301
|
modelValue: difVisible.value,
|
|
5309
5302
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => difVisible.value = $event),
|
|
5310
5303
|
fullscreen: ""
|
|
5311
5304
|
}, {
|
|
5312
5305
|
footer: vue.withCtx(() => [
|
|
5313
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
5314
|
-
vue.createVNode(vue.unref(
|
|
5306
|
+
vue.createElementVNode("span", _hoisted_4$3, [
|
|
5307
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5315
5308
|
size: "small",
|
|
5316
5309
|
onClick: _cache[4] || (_cache[4] = ($event) => difVisible.value = false)
|
|
5317
5310
|
}, {
|
|
5318
|
-
default: vue.withCtx(() => [
|
|
5311
|
+
default: vue.withCtx(() => _cache[9] || (_cache[9] = [
|
|
5319
5312
|
vue.createTextVNode("取消")
|
|
5320
|
-
]),
|
|
5313
|
+
])),
|
|
5321
5314
|
_: 1
|
|
5322
5315
|
}),
|
|
5323
|
-
vue.createVNode(vue.unref(
|
|
5316
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5324
5317
|
size: "small",
|
|
5325
5318
|
type: "primary",
|
|
5326
5319
|
onClick: diffChange
|
|
5327
5320
|
}, {
|
|
5328
|
-
default: vue.withCtx(() => [
|
|
5321
|
+
default: vue.withCtx(() => _cache[10] || (_cache[10] = [
|
|
5329
5322
|
vue.createTextVNode("确定")
|
|
5330
|
-
]),
|
|
5323
|
+
])),
|
|
5331
5324
|
_: 1
|
|
5332
5325
|
})
|
|
5333
5326
|
])
|
|
5334
5327
|
]),
|
|
5335
5328
|
default: vue.withCtx(() => [
|
|
5336
5329
|
vue.createElementVNode("div", _hoisted_1$p, [
|
|
5337
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5338
|
-
vue.createVNode(vue.unref(
|
|
5330
|
+
vue.createElementVNode("div", _hoisted_2$d, [
|
|
5331
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTag), {
|
|
5339
5332
|
size: "small",
|
|
5340
5333
|
type: "info"
|
|
5341
5334
|
}, {
|
|
5342
|
-
default: vue.withCtx(() => [
|
|
5335
|
+
default: vue.withCtx(() => _cache[7] || (_cache[7] = [
|
|
5343
5336
|
vue.createTextVNode("修改前")
|
|
5344
|
-
]),
|
|
5337
|
+
])),
|
|
5345
5338
|
_: 1
|
|
5346
5339
|
})
|
|
5347
5340
|
]),
|
|
5348
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
5349
|
-
vue.createVNode(vue.unref(
|
|
5341
|
+
vue.createElementVNode("div", _hoisted_3$3, [
|
|
5342
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTag), {
|
|
5350
5343
|
size: "small",
|
|
5351
5344
|
type: "success"
|
|
5352
5345
|
}, {
|
|
5353
|
-
default: vue.withCtx(() => [
|
|
5346
|
+
default: vue.withCtx(() => _cache[8] || (_cache[8] = [
|
|
5354
5347
|
vue.createTextVNode("修改后")
|
|
5355
|
-
]),
|
|
5348
|
+
])),
|
|
5356
5349
|
_: 1
|
|
5357
5350
|
})
|
|
5358
5351
|
])
|
|
@@ -5377,7 +5370,7 @@
|
|
|
5377
5370
|
});
|
|
5378
5371
|
|
|
5379
5372
|
const _hoisted_1$o = { class: "m-editor-data-source-methods" };
|
|
5380
|
-
const _hoisted_2$
|
|
5373
|
+
const _hoisted_2$c = { class: "m-editor-data-source-methods-footer" };
|
|
5381
5374
|
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
5382
5375
|
...{
|
|
5383
5376
|
name: "MFieldsDataSourceMethods"
|
|
@@ -5449,21 +5442,21 @@
|
|
|
5449
5442
|
};
|
|
5450
5443
|
return (_ctx, _cache) => {
|
|
5451
5444
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
|
|
5452
|
-
vue.createVNode(vue.unref(
|
|
5445
|
+
vue.createVNode(vue.unref(tablePlugin.MagicTable), {
|
|
5453
5446
|
data: _ctx.model[_ctx.name],
|
|
5454
5447
|
columns: methodColumns
|
|
5455
5448
|
}, null, 8, ["data"]),
|
|
5456
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5457
|
-
vue.createVNode(vue.unref(
|
|
5449
|
+
vue.createElementVNode("div", _hoisted_2$c, [
|
|
5450
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5458
5451
|
size: "small",
|
|
5459
5452
|
type: "primary",
|
|
5460
5453
|
disabled: _ctx.disabled,
|
|
5461
5454
|
plain: "",
|
|
5462
5455
|
onClick: createCodeHandler
|
|
5463
5456
|
}, {
|
|
5464
|
-
default: vue.withCtx(() => [
|
|
5457
|
+
default: vue.withCtx(() => _cache[0] || (_cache[0] = [
|
|
5465
5458
|
vue.createTextVNode("添加")
|
|
5466
|
-
]),
|
|
5459
|
+
])),
|
|
5467
5460
|
_: 1
|
|
5468
5461
|
}, 8, ["disabled"])
|
|
5469
5462
|
]),
|
|
@@ -5483,7 +5476,7 @@
|
|
|
5483
5476
|
});
|
|
5484
5477
|
|
|
5485
5478
|
const _hoisted_1$n = { class: "m-fields-data-source-method-select" };
|
|
5486
|
-
const _hoisted_2$
|
|
5479
|
+
const _hoisted_2$b = { class: "data-source-method-select-container" };
|
|
5487
5480
|
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
5488
5481
|
...{
|
|
5489
5482
|
name: "MFieldsDataSourceMethodSelect"
|
|
@@ -5511,7 +5504,7 @@
|
|
|
5511
5504
|
const hasDataSourceSidePanel = vue.computed(
|
|
5512
5505
|
() => (services?.uiService.get("sideBarItems") || []).find((item) => item.$key === SideItemKey.DATA_SOURCE)
|
|
5513
5506
|
);
|
|
5514
|
-
const notEditable = vue.computed(() =>
|
|
5507
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.config.notEditable, props));
|
|
5515
5508
|
const dataSources = vue.computed(() => dataSourceService?.get("dataSources"));
|
|
5516
5509
|
const isCustomMethod = vue.computed(() => {
|
|
5517
5510
|
const [id, name] = props.model[props.name];
|
|
@@ -5531,7 +5524,7 @@
|
|
|
5531
5524
|
const setParamsConfig = (dataSourceMethod, formState = {}) => {
|
|
5532
5525
|
paramsConfig.value = dataSourceMethod ? getParamItemsConfig(dataSourceMethod) : [];
|
|
5533
5526
|
if (paramsConfig.value.length) {
|
|
5534
|
-
props.model.params =
|
|
5527
|
+
props.model.params = formPlugin.createValues(formState, paramsConfig.value, {}, props.model.params);
|
|
5535
5528
|
} else {
|
|
5536
5529
|
props.model.params = {};
|
|
5537
5530
|
}
|
|
@@ -5571,20 +5564,20 @@
|
|
|
5571
5564
|
};
|
|
5572
5565
|
return (_ctx, _cache) => {
|
|
5573
5566
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
5574
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5575
|
-
vue.createVNode(vue.unref(
|
|
5567
|
+
vue.createElementVNode("div", _hoisted_2$b, [
|
|
5568
|
+
vue.createVNode(vue.unref(formPlugin.MContainer), {
|
|
5576
5569
|
class: "select",
|
|
5577
5570
|
config: cascaderConfig.value,
|
|
5578
5571
|
model: _ctx.model,
|
|
5579
5572
|
size: _ctx.size,
|
|
5580
5573
|
onChange: onChangeHandler
|
|
5581
5574
|
}, null, 8, ["config", "model", "size"]),
|
|
5582
|
-
_ctx.model[_ctx.name] && isCustomMethod.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5575
|
+
_ctx.model[_ctx.name] && isCustomMethod.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
5583
5576
|
key: 0,
|
|
5584
5577
|
content: notEditable.value ? "查看" : "编辑"
|
|
5585
5578
|
}, {
|
|
5586
5579
|
default: vue.withCtx(() => [
|
|
5587
|
-
vue.createVNode(vue.unref(
|
|
5580
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5588
5581
|
class: "m-fields-select-action-button",
|
|
5589
5582
|
size: _ctx.size,
|
|
5590
5583
|
onClick: editCodeHandler
|
|
@@ -5615,7 +5608,7 @@
|
|
|
5615
5608
|
});
|
|
5616
5609
|
|
|
5617
5610
|
const _hoisted_1$m = { class: "m-editor-data-source-fields" };
|
|
5618
|
-
const _hoisted_2$
|
|
5611
|
+
const _hoisted_2$a = { class: "m-editor-data-source-fields-footer" };
|
|
5619
5612
|
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
5620
5613
|
...{
|
|
5621
5614
|
name: "MFieldsDataSourceMocks"
|
|
@@ -5727,7 +5720,7 @@
|
|
|
5727
5720
|
label: "是否启用",
|
|
5728
5721
|
prop: "enable",
|
|
5729
5722
|
type: "component",
|
|
5730
|
-
component:
|
|
5723
|
+
component: designPlugin.TMagicSwitch,
|
|
5731
5724
|
props: (row) => ({
|
|
5732
5725
|
modelValue: row.enable,
|
|
5733
5726
|
activeValue: true,
|
|
@@ -5743,7 +5736,7 @@
|
|
|
5743
5736
|
label: "编辑器中使用",
|
|
5744
5737
|
prop: "useInEditor",
|
|
5745
5738
|
type: "component",
|
|
5746
|
-
component:
|
|
5739
|
+
component: designPlugin.TMagicSwitch,
|
|
5747
5740
|
props: (row) => ({
|
|
5748
5741
|
modelValue: row.useInEditor,
|
|
5749
5742
|
activeValue: true,
|
|
@@ -5775,7 +5768,7 @@
|
|
|
5775
5768
|
text: "删除",
|
|
5776
5769
|
buttonType: "danger",
|
|
5777
5770
|
handler: async (row, index) => {
|
|
5778
|
-
await
|
|
5771
|
+
await designPlugin.tMagicMessageBox.confirm(`确定删除${row.title}?`, "提示");
|
|
5779
5772
|
props.model[props.name].splice(index, 1);
|
|
5780
5773
|
emit("change", props.model[props.name]);
|
|
5781
5774
|
}
|
|
@@ -5821,21 +5814,21 @@
|
|
|
5821
5814
|
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
5822
5815
|
return (_ctx, _cache) => {
|
|
5823
5816
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
5824
|
-
vue.createVNode(vue.unref(
|
|
5817
|
+
vue.createVNode(vue.unref(tablePlugin.MagicTable), {
|
|
5825
5818
|
data: _ctx.model[_ctx.name],
|
|
5826
5819
|
columns
|
|
5827
5820
|
}, null, 8, ["data"]),
|
|
5828
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5829
|
-
vue.createVNode(vue.unref(
|
|
5821
|
+
vue.createElementVNode("div", _hoisted_2$a, [
|
|
5822
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5830
5823
|
size: "small",
|
|
5831
5824
|
type: "primary",
|
|
5832
5825
|
disabled: _ctx.disabled,
|
|
5833
5826
|
plain: "",
|
|
5834
5827
|
onClick: _cache[0] || (_cache[0] = ($event) => newHandler())
|
|
5835
5828
|
}, {
|
|
5836
|
-
default: vue.withCtx(() => [
|
|
5829
|
+
default: vue.withCtx(() => _cache[4] || (_cache[4] = [
|
|
5837
5830
|
vue.createTextVNode("添加")
|
|
5838
|
-
]),
|
|
5831
|
+
])),
|
|
5839
5832
|
_: 1
|
|
5840
5833
|
}, 8, ["disabled"])
|
|
5841
5834
|
]),
|
|
@@ -5850,7 +5843,7 @@
|
|
|
5850
5843
|
position: vue.unref(boxPosition)
|
|
5851
5844
|
}, {
|
|
5852
5845
|
body: vue.withCtx(() => [
|
|
5853
|
-
vue.createVNode(vue.unref(
|
|
5846
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
5854
5847
|
ref: "addDialog",
|
|
5855
5848
|
"label-width": "120px",
|
|
5856
5849
|
config: formConfig,
|
|
@@ -5892,7 +5885,7 @@
|
|
|
5892
5885
|
const { dataSourceService, uiService } = vue.inject("services") || {};
|
|
5893
5886
|
const eventBus = vue.inject("eventBus");
|
|
5894
5887
|
const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
|
|
5895
|
-
const notEditable = vue.computed(() =>
|
|
5888
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.config.notEditable, props));
|
|
5896
5889
|
const hasDataSourceSidePanel = vue.computed(
|
|
5897
5890
|
() => (uiService?.get("sideBarItems") || []).find((item) => item.$key === SideItemKey.DATA_SOURCE)
|
|
5898
5891
|
);
|
|
@@ -5926,7 +5919,7 @@
|
|
|
5926
5919
|
};
|
|
5927
5920
|
return (_ctx, _cache) => {
|
|
5928
5921
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
5929
|
-
vue.createVNode(vue.unref(
|
|
5922
|
+
vue.createVNode(vue.unref(formPlugin.MSelect), {
|
|
5930
5923
|
model: _ctx.model,
|
|
5931
5924
|
name: _ctx.name,
|
|
5932
5925
|
size: _ctx.size,
|
|
@@ -5936,12 +5929,12 @@
|
|
|
5936
5929
|
"last-values": _ctx.lastValues,
|
|
5937
5930
|
onChange: changeHandler
|
|
5938
5931
|
}, null, 8, ["model", "name", "size", "prop", "disabled", "config", "last-values"]),
|
|
5939
|
-
_ctx.model[_ctx.name] && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5932
|
+
_ctx.model[_ctx.name] && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
5940
5933
|
key: 0,
|
|
5941
5934
|
content: notEditable.value ? "查看" : "编辑"
|
|
5942
5935
|
}, {
|
|
5943
5936
|
default: vue.withCtx(() => [
|
|
5944
|
-
vue.createVNode(vue.unref(
|
|
5937
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5945
5938
|
class: "m-fields-select-action-button",
|
|
5946
5939
|
size: _ctx.size,
|
|
5947
5940
|
onClick: editHandler
|
|
@@ -5983,7 +5976,7 @@
|
|
|
5983
5976
|
const props = __props;
|
|
5984
5977
|
const { dataSourceService } = vue.inject("services") || {};
|
|
5985
5978
|
const mForm = vue.inject("mForm");
|
|
5986
|
-
const parentFields = vue.computed(() =>
|
|
5979
|
+
const parentFields = vue.computed(() => formPlugin.filterFunction(mForm, props.config.parentFields, props) || []);
|
|
5987
5980
|
const config = vue.computed(() => ({
|
|
5988
5981
|
type: "groupList",
|
|
5989
5982
|
name: props.name,
|
|
@@ -6074,7 +6067,7 @@
|
|
|
6074
6067
|
emit("change", v);
|
|
6075
6068
|
};
|
|
6076
6069
|
return (_ctx, _cache) => {
|
|
6077
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
6070
|
+
return vue.openBlock(), vue.createBlock(vue.unref(formPlugin.MGroupList), {
|
|
6078
6071
|
style: { "width": "100%" },
|
|
6079
6072
|
config: config.value,
|
|
6080
6073
|
name: _ctx.name,
|
|
@@ -6090,7 +6083,7 @@
|
|
|
6090
6083
|
});
|
|
6091
6084
|
|
|
6092
6085
|
const _hoisted_1$k = { class: "m-fields-event-select" };
|
|
6093
|
-
const _hoisted_2$
|
|
6086
|
+
const _hoisted_2$9 = {
|
|
6094
6087
|
key: 1,
|
|
6095
6088
|
class: "fullWidth"
|
|
6096
6089
|
};
|
|
@@ -6148,7 +6141,7 @@
|
|
|
6148
6141
|
}
|
|
6149
6142
|
];
|
|
6150
6143
|
pageFragment.items.forEach((node) => {
|
|
6151
|
-
traverseNode(node, (node2) => {
|
|
6144
|
+
utils.traverseNode(node, (node2) => {
|
|
6152
6145
|
const nodeEvents = node2.type && eventsService.getEvent(node2.type) || [];
|
|
6153
6146
|
events.push({
|
|
6154
6147
|
label: `${node2.name}_${node2.id}`,
|
|
@@ -6190,24 +6183,24 @@
|
|
|
6190
6183
|
name: "actionType",
|
|
6191
6184
|
text: "联动类型",
|
|
6192
6185
|
type: "select",
|
|
6193
|
-
defaultValue:
|
|
6186
|
+
defaultValue: core.ActionType.COMP,
|
|
6194
6187
|
options: () => [
|
|
6195
6188
|
{
|
|
6196
6189
|
text: "组件",
|
|
6197
6190
|
label: "组件",
|
|
6198
|
-
value:
|
|
6191
|
+
value: core.ActionType.COMP
|
|
6199
6192
|
},
|
|
6200
6193
|
{
|
|
6201
6194
|
text: "代码",
|
|
6202
6195
|
label: "代码",
|
|
6203
6196
|
disabled: !Object.keys(codeBlockService?.getCodeDsl() || {}).length,
|
|
6204
|
-
value:
|
|
6197
|
+
value: core.ActionType.CODE
|
|
6205
6198
|
},
|
|
6206
6199
|
{
|
|
6207
6200
|
text: "数据源",
|
|
6208
6201
|
label: "数据源",
|
|
6209
6202
|
disabled: !dataSourceService?.get("dataSources")?.filter((ds) => ds.methods?.length || dataSourceService?.getFormMethod(ds.type).length).length,
|
|
6210
|
-
value:
|
|
6203
|
+
value: core.ActionType.DATA_SOURCE
|
|
6211
6204
|
}
|
|
6212
6205
|
]
|
|
6213
6206
|
};
|
|
@@ -6218,7 +6211,7 @@
|
|
|
6218
6211
|
name: "to",
|
|
6219
6212
|
text: "联动组件",
|
|
6220
6213
|
type: "ui-select",
|
|
6221
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6214
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.COMP,
|
|
6222
6215
|
onChange: (MForm, v, { model }) => {
|
|
6223
6216
|
model.method = "";
|
|
6224
6217
|
return v;
|
|
@@ -6238,7 +6231,7 @@
|
|
|
6238
6231
|
return "select";
|
|
6239
6232
|
},
|
|
6240
6233
|
checkStrictly: () => props.config.src !== "component",
|
|
6241
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6234
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.COMP,
|
|
6242
6235
|
options: (mForm, { model }) => {
|
|
6243
6236
|
const node = editorService?.getNodeById(model.to);
|
|
6244
6237
|
if (!node?.type) return [];
|
|
@@ -6249,7 +6242,7 @@
|
|
|
6249
6242
|
if (pageFragment) {
|
|
6250
6243
|
methods = [];
|
|
6251
6244
|
pageFragment.items.forEach((node2) => {
|
|
6252
|
-
traverseNode(node2, (node3) => {
|
|
6245
|
+
utils.traverseNode(node2, (node3) => {
|
|
6253
6246
|
const nodeMethods = node3.type && eventsService?.getMethod(node3.type) || [];
|
|
6254
6247
|
if (nodeMethods.length) {
|
|
6255
6248
|
methods.push({
|
|
@@ -6277,7 +6270,7 @@
|
|
|
6277
6270
|
text: "代码块",
|
|
6278
6271
|
name: "codeId",
|
|
6279
6272
|
notEditable: () => !codeBlockService?.getEditStatus(),
|
|
6280
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6273
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.CODE
|
|
6281
6274
|
};
|
|
6282
6275
|
return { ...defaultCodeActionConfig, ...props.config.codeActionConfig };
|
|
6283
6276
|
});
|
|
@@ -6287,7 +6280,7 @@
|
|
|
6287
6280
|
text: "数据源方法",
|
|
6288
6281
|
name: "dataSourceMethod",
|
|
6289
6282
|
notEditable: () => !services?.dataSourceService.get("editable"),
|
|
6290
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6283
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.DATA_SOURCE
|
|
6291
6284
|
};
|
|
6292
6285
|
return { ...defaultDataSourceActionConfig, ...props.config.dataSourceActionConfig };
|
|
6293
6286
|
});
|
|
@@ -6378,21 +6371,21 @@
|
|
|
6378
6371
|
model: _ctx.model,
|
|
6379
6372
|
config: tableConfig.value,
|
|
6380
6373
|
onChange: onChangeHandler
|
|
6381
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
6382
|
-
vue.createVNode(vue.unref(
|
|
6374
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
|
|
6375
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6383
6376
|
class: "create-button",
|
|
6384
6377
|
type: "primary",
|
|
6385
6378
|
size: _ctx.size,
|
|
6386
6379
|
disabled: _ctx.disabled,
|
|
6387
6380
|
onClick: _cache[0] || (_cache[0] = ($event) => addEvent())
|
|
6388
6381
|
}, {
|
|
6389
|
-
default: vue.withCtx(() => [
|
|
6382
|
+
default: vue.withCtx(() => _cache[1] || (_cache[1] = [
|
|
6390
6383
|
vue.createTextVNode("添加事件")
|
|
6391
|
-
]),
|
|
6384
|
+
])),
|
|
6392
6385
|
_: 1
|
|
6393
6386
|
}, 8, ["size", "disabled"]),
|
|
6394
6387
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.model[_ctx.name], (cardItem, index) => {
|
|
6395
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
6388
|
+
return vue.openBlock(), vue.createBlock(vue.unref(formPlugin.MPanel), {
|
|
6396
6389
|
key: index,
|
|
6397
6390
|
disabled: _ctx.disabled,
|
|
6398
6391
|
size: _ctx.size,
|
|
@@ -6402,7 +6395,7 @@
|
|
|
6402
6395
|
onChange: onChangeHandler
|
|
6403
6396
|
}, {
|
|
6404
6397
|
header: vue.withCtx(() => [
|
|
6405
|
-
vue.createVNode(vue.unref(
|
|
6398
|
+
vue.createVNode(vue.unref(formPlugin.MContainer), {
|
|
6406
6399
|
class: "fullWidth",
|
|
6407
6400
|
config: eventNameConfig.value,
|
|
6408
6401
|
model: cardItem,
|
|
@@ -6410,7 +6403,7 @@
|
|
|
6410
6403
|
size: _ctx.size,
|
|
6411
6404
|
onChange: onChangeHandler
|
|
6412
6405
|
}, null, 8, ["config", "model", "disabled", "size"]),
|
|
6413
|
-
vue.createVNode(vue.unref(
|
|
6406
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6414
6407
|
style: { "color": "#f56c6c" },
|
|
6415
6408
|
link: "",
|
|
6416
6409
|
icon: vue.unref(iconsVue.Delete),
|
|
@@ -6434,10 +6427,6 @@
|
|
|
6434
6427
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6435
6428
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
6436
6429
|
};
|
|
6437
|
-
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);
|
|
6438
|
-
const _hoisted_4$6 = [
|
|
6439
|
-
_hoisted_2$b
|
|
6440
|
-
];
|
|
6441
6430
|
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
6442
6431
|
...{
|
|
6443
6432
|
name: "MEditorCodeIcon"
|
|
@@ -6445,14 +6434,15 @@
|
|
|
6445
6434
|
__name: "CodeIcon",
|
|
6446
6435
|
setup(__props) {
|
|
6447
6436
|
return (_ctx, _cache) => {
|
|
6448
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$j,
|
|
6437
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$j, _cache[0] || (_cache[0] = [
|
|
6438
|
+
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)
|
|
6439
|
+
]));
|
|
6449
6440
|
};
|
|
6450
6441
|
}
|
|
6451
6442
|
});
|
|
6452
6443
|
|
|
6453
6444
|
const _hoisted_1$i = { class: "m-fields-key-value" };
|
|
6454
|
-
const _hoisted_2$
|
|
6455
|
-
const _hoisted_3$6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
6445
|
+
const _hoisted_2$8 = { key: 0 };
|
|
6456
6446
|
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
6457
6447
|
...{
|
|
6458
6448
|
name: "MFieldsKeyValue"
|
|
@@ -6512,13 +6502,13 @@
|
|
|
6512
6502
|
};
|
|
6513
6503
|
return (_ctx, _cache) => {
|
|
6514
6504
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
|
|
6515
|
-
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
6505
|
+
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$8, [
|
|
6516
6506
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
6517
6507
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6518
6508
|
class: "m-fields-key-value-item",
|
|
6519
6509
|
key: index
|
|
6520
6510
|
}, [
|
|
6521
|
-
vue.createVNode(vue.unref(
|
|
6511
|
+
vue.createVNode(vue.unref(designPlugin.TMagicInput), {
|
|
6522
6512
|
placeholder: "key",
|
|
6523
6513
|
modelValue: records.value[index][0],
|
|
6524
6514
|
"onUpdate:modelValue": ($event) => records.value[index][0] = $event,
|
|
@@ -6526,8 +6516,8 @@
|
|
|
6526
6516
|
size: _ctx.size,
|
|
6527
6517
|
onChange: keyChangeHandler
|
|
6528
6518
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
6529
|
-
|
|
6530
|
-
vue.createVNode(vue.unref(
|
|
6519
|
+
_cache[1] || (_cache[1] = vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1)),
|
|
6520
|
+
vue.createVNode(vue.unref(designPlugin.TMagicInput), {
|
|
6531
6521
|
placeholder: "value",
|
|
6532
6522
|
modelValue: records.value[index][1],
|
|
6533
6523
|
"onUpdate:modelValue": ($event) => records.value[index][1] = $event,
|
|
@@ -6535,7 +6525,7 @@
|
|
|
6535
6525
|
size: _ctx.size,
|
|
6536
6526
|
onChange: valueChangeHandler
|
|
6537
6527
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
6538
|
-
vue.createVNode(vue.unref(
|
|
6528
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6539
6529
|
class: "m-fileds-key-value-delete",
|
|
6540
6530
|
type: "danger",
|
|
6541
6531
|
size: _ctx.size,
|
|
@@ -6547,7 +6537,7 @@
|
|
|
6547
6537
|
}, null, 8, ["size", "disabled", "icon", "onClick"])
|
|
6548
6538
|
]);
|
|
6549
6539
|
}), 128)),
|
|
6550
|
-
vue.createVNode(vue.unref(
|
|
6540
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6551
6541
|
type: "primary",
|
|
6552
6542
|
size: _ctx.size,
|
|
6553
6543
|
disabled: _ctx.disabled,
|
|
@@ -6555,9 +6545,9 @@
|
|
|
6555
6545
|
icon: vue.unref(iconsVue.Plus),
|
|
6556
6546
|
onClick: addHandler
|
|
6557
6547
|
}, {
|
|
6558
|
-
default: vue.withCtx(() => [
|
|
6548
|
+
default: vue.withCtx(() => _cache[2] || (_cache[2] = [
|
|
6559
6549
|
vue.createTextVNode("添加")
|
|
6560
|
-
]),
|
|
6550
|
+
])),
|
|
6561
6551
|
_: 1
|
|
6562
6552
|
}, 8, ["size", "disabled", "icon"])
|
|
6563
6553
|
])) : vue.createCommentVNode("", true),
|
|
@@ -6572,7 +6562,7 @@
|
|
|
6572
6562
|
parse: true,
|
|
6573
6563
|
onSave: save
|
|
6574
6564
|
}, null, 8, ["init-values", "options"])) : vue.createCommentVNode("", true),
|
|
6575
|
-
_ctx.config.advanced ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
6565
|
+
_ctx.config.advanced ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
6576
6566
|
key: 2,
|
|
6577
6567
|
size: "default",
|
|
6578
6568
|
disabled: _ctx.disabled,
|
|
@@ -6586,7 +6576,7 @@
|
|
|
6586
6576
|
});
|
|
6587
6577
|
|
|
6588
6578
|
const _hoisted_1$h = { class: "m-fields-page-fragment-select" };
|
|
6589
|
-
const _hoisted_2$
|
|
6579
|
+
const _hoisted_2$7 = { class: "page-fragment-select-container" };
|
|
6590
6580
|
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
6591
6581
|
...{
|
|
6592
6582
|
name: "MFieldsPageFragmentSelect"
|
|
@@ -6609,7 +6599,7 @@
|
|
|
6609
6599
|
const emit = __emit;
|
|
6610
6600
|
const props = __props;
|
|
6611
6601
|
const pageList = vue.computed(
|
|
6612
|
-
() => services?.editorService.get("root")?.items.filter((item) => item.type ===
|
|
6602
|
+
() => services?.editorService.get("root")?.items.filter((item) => item.type === core.NodeType.PAGE_FRAGMENT)
|
|
6613
6603
|
);
|
|
6614
6604
|
const selectConfig = {
|
|
6615
6605
|
type: "select",
|
|
@@ -6634,7 +6624,7 @@
|
|
|
6634
6624
|
return (_ctx, _cache) => {
|
|
6635
6625
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
6636
6626
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
6637
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
6627
|
+
vue.createElementVNode("div", _hoisted_2$7, [
|
|
6638
6628
|
vue.createVNode(_component_m_form_container, {
|
|
6639
6629
|
class: "select",
|
|
6640
6630
|
config: selectConfig,
|
|
@@ -6741,7 +6731,7 @@
|
|
|
6741
6731
|
class: "m-fields-ui-select",
|
|
6742
6732
|
onClick: cancelHandler
|
|
6743
6733
|
}, [
|
|
6744
|
-
vue.createVNode(vue.unref(
|
|
6734
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6745
6735
|
type: "danger",
|
|
6746
6736
|
icon: vue.unref(iconsVue.Delete),
|
|
6747
6737
|
disabled: _ctx.disabled,
|
|
@@ -6749,19 +6739,19 @@
|
|
|
6749
6739
|
link: "",
|
|
6750
6740
|
style: { "padding": "0" }
|
|
6751
6741
|
}, {
|
|
6752
|
-
default: vue.withCtx(() => [
|
|
6742
|
+
default: vue.withCtx(() => _cache[2] || (_cache[2] = [
|
|
6753
6743
|
vue.createTextVNode("取消")
|
|
6754
|
-
]),
|
|
6744
|
+
])),
|
|
6755
6745
|
_: 1
|
|
6756
6746
|
}, 8, ["icon", "disabled", "size"])
|
|
6757
6747
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
|
|
6758
6748
|
val.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
6759
|
-
vue.createVNode(vue.unref(
|
|
6749
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTooltip), {
|
|
6760
6750
|
content: "清除",
|
|
6761
6751
|
placement: "top"
|
|
6762
6752
|
}, {
|
|
6763
6753
|
default: vue.withCtx(() => [
|
|
6764
|
-
vue.createVNode(vue.unref(
|
|
6754
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6765
6755
|
style: { "padding": "0" },
|
|
6766
6756
|
type: "danger",
|
|
6767
6757
|
icon: vue.unref(iconsVue.Close),
|
|
@@ -6773,12 +6763,12 @@
|
|
|
6773
6763
|
]),
|
|
6774
6764
|
_: 1
|
|
6775
6765
|
}),
|
|
6776
|
-
vue.createVNode(vue.unref(
|
|
6766
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTooltip), {
|
|
6777
6767
|
content: "点击选中组件",
|
|
6778
6768
|
placement: "top"
|
|
6779
6769
|
}, {
|
|
6780
6770
|
default: vue.withCtx(() => [
|
|
6781
|
-
vue.createVNode(vue.unref(
|
|
6771
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6782
6772
|
link: "",
|
|
6783
6773
|
style: { "padding": "0", "margin": "0" },
|
|
6784
6774
|
disabled: _ctx.disabled,
|
|
@@ -6795,22 +6785,22 @@
|
|
|
6795
6785
|
]),
|
|
6796
6786
|
_: 1
|
|
6797
6787
|
})
|
|
6798
|
-
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(
|
|
6788
|
+
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
6799
6789
|
key: 1,
|
|
6800
6790
|
content: "点击此处选择",
|
|
6801
6791
|
placement: "top"
|
|
6802
6792
|
}, {
|
|
6803
6793
|
default: vue.withCtx(() => [
|
|
6804
|
-
vue.createVNode(vue.unref(
|
|
6794
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6805
6795
|
link: "",
|
|
6806
6796
|
style: { "padding": "0", "margin": "0" },
|
|
6807
6797
|
disabled: _ctx.disabled,
|
|
6808
6798
|
size: _ctx.size,
|
|
6809
6799
|
onClick: startSelect
|
|
6810
6800
|
}, {
|
|
6811
|
-
default: vue.withCtx(() => [
|
|
6801
|
+
default: vue.withCtx(() => _cache[3] || (_cache[3] = [
|
|
6812
6802
|
vue.createTextVNode("点击此处选择")
|
|
6813
|
-
]),
|
|
6803
|
+
])),
|
|
6814
6804
|
_: 1
|
|
6815
6805
|
}, 8, ["disabled", "size"])
|
|
6816
6806
|
]),
|
|
@@ -7007,7 +6997,7 @@
|
|
|
7007
6997
|
key: 1,
|
|
7008
6998
|
class: "menu-item-text"
|
|
7009
6999
|
};
|
|
7010
|
-
const _hoisted_2$
|
|
7000
|
+
const _hoisted_2$6 = { class: "el-dropdown-link menubar-menu-button" };
|
|
7011
7001
|
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
7012
7002
|
...{
|
|
7013
7003
|
name: "MEditorToolButton"
|
|
@@ -7076,18 +7066,18 @@
|
|
|
7076
7066
|
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(_ctx.data, $event)),
|
|
7077
7067
|
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(_ctx.data, $event))
|
|
7078
7068
|
}, [
|
|
7079
|
-
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7069
|
+
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDivider), {
|
|
7080
7070
|
key: 0,
|
|
7081
7071
|
direction: _ctx.data.direction || "vertical"
|
|
7082
7072
|
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
7083
|
-
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7073
|
+
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
7084
7074
|
key: 0,
|
|
7085
7075
|
effect: "dark",
|
|
7086
7076
|
placement: "bottom-start",
|
|
7087
7077
|
content: _ctx.data.tooltip
|
|
7088
7078
|
}, {
|
|
7089
7079
|
default: vue.withCtx(() => [
|
|
7090
|
-
vue.createVNode(vue.unref(
|
|
7080
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
7091
7081
|
size: "small",
|
|
7092
7082
|
link: "",
|
|
7093
7083
|
disabled: disabled.value
|
|
@@ -7103,7 +7093,7 @@
|
|
|
7103
7093
|
}, 8, ["disabled"])
|
|
7104
7094
|
]),
|
|
7105
7095
|
_: 1
|
|
7106
|
-
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7096
|
+
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
7107
7097
|
key: 1,
|
|
7108
7098
|
size: "small",
|
|
7109
7099
|
link: "",
|
|
@@ -7119,17 +7109,17 @@
|
|
|
7119
7109
|
]),
|
|
7120
7110
|
_: 1
|
|
7121
7111
|
}, 8, ["disabled", "title"]))
|
|
7122
|
-
], 64)) : _ctx.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7112
|
+
], 64)) : _ctx.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDropdown), {
|
|
7123
7113
|
key: 3,
|
|
7124
7114
|
trigger: "click",
|
|
7125
7115
|
disabled: disabled.value,
|
|
7126
7116
|
onCommand: dropdownHandler
|
|
7127
7117
|
}, {
|
|
7128
7118
|
dropdown: vue.withCtx(() => [
|
|
7129
|
-
_ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7119
|
+
_ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDropdownMenu), { key: 0 }, {
|
|
7130
7120
|
default: vue.withCtx(() => [
|
|
7131
7121
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (subItem, index) => {
|
|
7132
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
7122
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDropdownItem), {
|
|
7133
7123
|
key: index,
|
|
7134
7124
|
command: { data: _ctx.data, subItem }
|
|
7135
7125
|
}, {
|
|
@@ -7144,9 +7134,9 @@
|
|
|
7144
7134
|
})) : vue.createCommentVNode("", true)
|
|
7145
7135
|
]),
|
|
7146
7136
|
default: vue.withCtx(() => [
|
|
7147
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
7137
|
+
vue.createElementVNode("span", _hoisted_2$6, [
|
|
7148
7138
|
vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
|
|
7149
|
-
vue.createVNode(vue.unref(
|
|
7139
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), { class: "el-icon--right" }, {
|
|
7150
7140
|
default: vue.withCtx(() => [
|
|
7151
7141
|
vue.createVNode(vue.unref(iconsVue.ArrowDown))
|
|
7152
7142
|
]),
|
|
@@ -7314,7 +7304,7 @@
|
|
|
7314
7304
|
vue.watch(
|
|
7315
7305
|
() => props.type,
|
|
7316
7306
|
(type) => {
|
|
7317
|
-
if (type ===
|
|
7307
|
+
if (type === core.NodeType.PAGE) {
|
|
7318
7308
|
unWatchPageFragmentLength?.();
|
|
7319
7309
|
unWatchPageFragmentLength = null;
|
|
7320
7310
|
unWatchPageLength = crateWatchLength(pageLength);
|
|
@@ -7342,7 +7332,7 @@
|
|
|
7342
7332
|
}, [
|
|
7343
7333
|
vue.createVNode(_sfc_main$Y, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
7344
7334
|
])) : vue.createCommentVNode("", true),
|
|
7345
|
-
_ctx.type === vue.unref(
|
|
7335
|
+
_ctx.type === vue.unref(core.NodeType).PAGE && pageLength.value || _ctx.type === vue.unref(core.NodeType).PAGE_FRAGMENT && pageFragmentLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
7346
7336
|
key: 1,
|
|
7347
7337
|
class: "m-editor-page-bar-items",
|
|
7348
7338
|
ref_key: "itemsContainer",
|
|
@@ -7386,14 +7376,15 @@
|
|
|
7386
7376
|
};
|
|
7387
7377
|
return (_ctx, _cache) => {
|
|
7388
7378
|
return showPageListButton.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
7389
|
-
vue.createVNode(vue.unref(
|
|
7379
|
+
vue.createVNode(vue.unref(designPlugin.TMagicPopover), {
|
|
7390
7380
|
"popper-class": "page-bar-popover",
|
|
7391
7381
|
placement: "top",
|
|
7382
|
+
trigger: "hover",
|
|
7392
7383
|
width: 160,
|
|
7393
|
-
|
|
7384
|
+
"destroy-on-close": true
|
|
7394
7385
|
}, {
|
|
7395
7386
|
reference: vue.withCtx(() => [
|
|
7396
|
-
vue.createVNode(vue.unref(
|
|
7387
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), { class: "m-editor-page-list-menu-icon" }, {
|
|
7397
7388
|
default: vue.withCtx(() => [
|
|
7398
7389
|
vue.createVNode(vue.unref(iconsVue.Files))
|
|
7399
7390
|
]),
|
|
@@ -7435,11 +7426,11 @@
|
|
|
7435
7426
|
setup(__props, { emit: __emit }) {
|
|
7436
7427
|
const data = [
|
|
7437
7428
|
{
|
|
7438
|
-
type:
|
|
7429
|
+
type: core.NodeType.PAGE,
|
|
7439
7430
|
text: "页面"
|
|
7440
7431
|
},
|
|
7441
7432
|
{
|
|
7442
|
-
type:
|
|
7433
|
+
type: core.NodeType.PAGE_FRAGMENT,
|
|
7443
7434
|
text: "页面片"
|
|
7444
7435
|
}
|
|
7445
7436
|
];
|
|
@@ -7449,7 +7440,7 @@
|
|
|
7449
7440
|
};
|
|
7450
7441
|
return (_ctx, _cache) => {
|
|
7451
7442
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(data, (item) => {
|
|
7452
|
-
return vue.createVNode(vue.unref(
|
|
7443
|
+
return vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
7453
7444
|
class: vue.normalizeClass(["m-editor-page-bar-switch-type-button", { active: _ctx.modelValue === item.type }]),
|
|
7454
7445
|
size: "small",
|
|
7455
7446
|
key: item.type,
|
|
@@ -7468,9 +7459,9 @@
|
|
|
7468
7459
|
});
|
|
7469
7460
|
|
|
7470
7461
|
const _hoisted_1$c = { class: "m-editor-page-bar-tabs" };
|
|
7471
|
-
const _hoisted_2$
|
|
7472
|
-
const _hoisted_3$
|
|
7473
|
-
const _hoisted_4$
|
|
7462
|
+
const _hoisted_2$5 = ["page-id", "onClick"];
|
|
7463
|
+
const _hoisted_3$2 = { class: "m-editor-page-bar-title" };
|
|
7464
|
+
const _hoisted_4$2 = ["title"];
|
|
7474
7465
|
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
7475
7466
|
...{
|
|
7476
7467
|
name: "MEditorPageBar"
|
|
@@ -7481,37 +7472,37 @@
|
|
|
7481
7472
|
pageBarSortOptions: {}
|
|
7482
7473
|
},
|
|
7483
7474
|
setup(__props) {
|
|
7484
|
-
const active = vue.ref(
|
|
7475
|
+
const active = vue.ref(core.NodeType.PAGE);
|
|
7485
7476
|
const services = vue.inject("services");
|
|
7486
7477
|
const editorService = services?.editorService;
|
|
7487
7478
|
const root = vue.computed(() => editorService?.get("root"));
|
|
7488
7479
|
const page = vue.computed(() => editorService?.get("page"));
|
|
7489
7480
|
const pageList = vue.computed(() => getPageList(root.value));
|
|
7490
7481
|
const pageFragmentList = vue.computed(() => getPageFragmentList(root.value));
|
|
7491
|
-
const list = vue.computed(() => active.value ===
|
|
7482
|
+
const list = vue.computed(() => active.value === core.NodeType.PAGE ? pageList.value : pageFragmentList.value);
|
|
7492
7483
|
const activePage = vue.ref("");
|
|
7493
7484
|
const activePageFragment = vue.ref("");
|
|
7494
7485
|
vue.watch(
|
|
7495
7486
|
page,
|
|
7496
7487
|
(page2) => {
|
|
7497
7488
|
if (!page2) {
|
|
7498
|
-
if (active.value ===
|
|
7489
|
+
if (active.value === core.NodeType.PAGE) {
|
|
7499
7490
|
activePage.value = "";
|
|
7500
7491
|
}
|
|
7501
|
-
if (active.value ===
|
|
7492
|
+
if (active.value === core.NodeType.PAGE_FRAGMENT) {
|
|
7502
7493
|
activePageFragment.value = "";
|
|
7503
7494
|
}
|
|
7504
7495
|
return;
|
|
7505
7496
|
}
|
|
7506
7497
|
if (utils.isPage(page2)) {
|
|
7507
7498
|
activePage.value = page2?.id;
|
|
7508
|
-
if (active.value !==
|
|
7509
|
-
active.value =
|
|
7499
|
+
if (active.value !== core.NodeType.PAGE) {
|
|
7500
|
+
active.value = core.NodeType.PAGE;
|
|
7510
7501
|
}
|
|
7511
7502
|
} else if (utils.isPageFragment(page2)) {
|
|
7512
7503
|
activePageFragment.value = page2?.id;
|
|
7513
|
-
if (active.value !==
|
|
7514
|
-
active.value =
|
|
7504
|
+
if (active.value !== core.NodeType.PAGE_FRAGMENT) {
|
|
7505
|
+
active.value = core.NodeType.PAGE_FRAGMENT;
|
|
7515
7506
|
}
|
|
7516
7507
|
}
|
|
7517
7508
|
},
|
|
@@ -7520,7 +7511,7 @@
|
|
|
7520
7511
|
}
|
|
7521
7512
|
);
|
|
7522
7513
|
vue.watch(active, (active2) => {
|
|
7523
|
-
if (active2 ===
|
|
7514
|
+
if (active2 === core.NodeType.PAGE) {
|
|
7524
7515
|
if (!activePage.value && !pageList.value.length) {
|
|
7525
7516
|
editorService?.selectRoot();
|
|
7526
7517
|
return;
|
|
@@ -7528,7 +7519,7 @@
|
|
|
7528
7519
|
switchPage(activePage.value);
|
|
7529
7520
|
return;
|
|
7530
7521
|
}
|
|
7531
|
-
if (active2 ===
|
|
7522
|
+
if (active2 === core.NodeType.PAGE_FRAGMENT) {
|
|
7532
7523
|
if (!activePageFragment.value && !pageFragmentList.value.length) {
|
|
7533
7524
|
editorService?.selectRoot();
|
|
7534
7525
|
return;
|
|
@@ -7577,21 +7568,22 @@
|
|
|
7577
7568
|
"page-id": item.id,
|
|
7578
7569
|
onClick: ($event) => switchPage(item.id)
|
|
7579
7570
|
}, [
|
|
7580
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
7571
|
+
vue.createElementVNode("div", _hoisted_3$2, [
|
|
7581
7572
|
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
7582
7573
|
vue.createElementVNode("span", {
|
|
7583
7574
|
title: item.name
|
|
7584
|
-
}, vue.toDisplayString(item.name || item.id), 9, _hoisted_4$
|
|
7575
|
+
}, vue.toDisplayString(item.name || item.id), 9, _hoisted_4$2)
|
|
7585
7576
|
])
|
|
7586
7577
|
]),
|
|
7587
|
-
vue.createVNode(vue.unref(
|
|
7578
|
+
vue.createVNode(vue.unref(designPlugin.TMagicPopover), {
|
|
7588
7579
|
"popper-class": "page-bar-popover",
|
|
7589
7580
|
placement: "top",
|
|
7581
|
+
trigger: "hover",
|
|
7590
7582
|
width: 160,
|
|
7591
|
-
|
|
7583
|
+
"destroy-on-close": true
|
|
7592
7584
|
}, {
|
|
7593
7585
|
reference: vue.withCtx(() => [
|
|
7594
|
-
vue.createVNode(vue.unref(
|
|
7586
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
7595
7587
|
default: vue.withCtx(() => [
|
|
7596
7588
|
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
7597
7589
|
]),
|
|
@@ -7622,7 +7614,7 @@
|
|
|
7622
7614
|
]),
|
|
7623
7615
|
_: 2
|
|
7624
7616
|
}, 1024)
|
|
7625
|
-
], 10, _hoisted_2$
|
|
7617
|
+
], 10, _hoisted_2$5);
|
|
7626
7618
|
}), 128))
|
|
7627
7619
|
]),
|
|
7628
7620
|
_: 3
|
|
@@ -7633,9 +7625,7 @@
|
|
|
7633
7625
|
});
|
|
7634
7626
|
|
|
7635
7627
|
const _hoisted_1$b = { class: "m-editor-empty-panel" };
|
|
7636
|
-
const _hoisted_2$
|
|
7637
|
-
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
7638
|
-
const _hoisted_4$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面片", -1);
|
|
7628
|
+
const _hoisted_2$4 = { class: "m-editor-empty-content" };
|
|
7639
7629
|
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
7640
7630
|
...{
|
|
7641
7631
|
name: "MEditorAddPageBox"
|
|
@@ -7659,25 +7649,25 @@
|
|
|
7659
7649
|
};
|
|
7660
7650
|
return (_ctx, _cache) => {
|
|
7661
7651
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
7662
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
7652
|
+
vue.createElementVNode("div", _hoisted_2$4, [
|
|
7663
7653
|
vue.createElementVNode("div", {
|
|
7664
7654
|
class: "m-editor-empty-button",
|
|
7665
|
-
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(vue.unref(
|
|
7655
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(vue.unref(core.NodeType).PAGE))
|
|
7666
7656
|
}, [
|
|
7667
7657
|
vue.createElementVNode("div", null, [
|
|
7668
7658
|
vue.createVNode(_sfc_main$Y, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
7669
7659
|
]),
|
|
7670
|
-
|
|
7660
|
+
_cache[2] || (_cache[2] = vue.createElementVNode("p", null, "新增页面", -1))
|
|
7671
7661
|
]),
|
|
7672
7662
|
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
7673
7663
|
key: 0,
|
|
7674
7664
|
class: "m-editor-empty-button",
|
|
7675
|
-
onClick: _cache[1] || (_cache[1] = ($event) => clickHandler(vue.unref(
|
|
7665
|
+
onClick: _cache[1] || (_cache[1] = ($event) => clickHandler(vue.unref(core.NodeType).PAGE_FRAGMENT))
|
|
7676
7666
|
}, [
|
|
7677
7667
|
vue.createElementVNode("div", null, [
|
|
7678
7668
|
vue.createVNode(_sfc_main$Y, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
7679
7669
|
]),
|
|
7680
|
-
|
|
7670
|
+
_cache[3] || (_cache[3] = vue.createElementVNode("p", null, "新增页面片", -1))
|
|
7681
7671
|
])) : vue.createCommentVNode("", true)
|
|
7682
7672
|
])
|
|
7683
7673
|
]);
|
|
@@ -7750,7 +7740,7 @@
|
|
|
7750
7740
|
});
|
|
7751
7741
|
const saveCode = (value) => {
|
|
7752
7742
|
try {
|
|
7753
|
-
const parseDSL =
|
|
7743
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
7754
7744
|
editorService?.set("root", parseDSL(value));
|
|
7755
7745
|
} catch (e) {
|
|
7756
7746
|
console.error(e);
|
|
@@ -7823,7 +7813,7 @@
|
|
|
7823
7813
|
page.value ? {
|
|
7824
7814
|
name: "right",
|
|
7825
7815
|
fn: vue.withCtx(() => [
|
|
7826
|
-
vue.createVNode(vue.unref(
|
|
7816
|
+
vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), null, {
|
|
7827
7817
|
default: vue.withCtx(() => [
|
|
7828
7818
|
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
7829
7819
|
]),
|
|
@@ -7889,7 +7879,7 @@
|
|
|
7889
7879
|
className: "delete",
|
|
7890
7880
|
icon: vue.markRaw(iconsVue.Delete),
|
|
7891
7881
|
tooltip: `刪除(Delete)`,
|
|
7892
|
-
disabled: () => services?.editorService.get("node")?.type ===
|
|
7882
|
+
disabled: () => services?.editorService.get("node")?.type === core.NodeType.PAGE,
|
|
7893
7883
|
handler: () => {
|
|
7894
7884
|
const node = services?.editorService.get("node");
|
|
7895
7885
|
node && services?.editorService.remove(node);
|
|
@@ -8101,7 +8091,7 @@
|
|
|
8101
8091
|
return (_ctx, _cache) => {
|
|
8102
8092
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
8103
8093
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
8104
|
-
vue.createVNode(vue.unref(
|
|
8094
|
+
vue.createVNode(vue.unref(formPlugin.MForm), {
|
|
8105
8095
|
ref_key: "configForm",
|
|
8106
8096
|
ref: configForm,
|
|
8107
8097
|
class: vue.normalizeClass(propsPanelSize.value),
|
|
@@ -8113,7 +8103,7 @@
|
|
|
8113
8103
|
onChange: submit,
|
|
8114
8104
|
onError: errorHandler
|
|
8115
8105
|
}, null, 8, ["class", "popper-class", "size", "init-values", "config", "extend-state"]),
|
|
8116
|
-
!_ctx.disabledShowSrc ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8106
|
+
!_ctx.disabledShowSrc ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
8117
8107
|
key: 0,
|
|
8118
8108
|
class: "m-editor-props-panel-src-icon",
|
|
8119
8109
|
circle: "",
|
|
@@ -8157,10 +8147,11 @@
|
|
|
8157
8147
|
timer && clearTimeout(timer);
|
|
8158
8148
|
timer = setTimeout(() => {
|
|
8159
8149
|
emit("search", filterText.value);
|
|
8150
|
+
timer = null;
|
|
8160
8151
|
}, 300);
|
|
8161
8152
|
};
|
|
8162
8153
|
return (_ctx, _cache) => {
|
|
8163
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
8154
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicInput), {
|
|
8164
8155
|
modelValue: filterText.value,
|
|
8165
8156
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
8166
8157
|
class: "search-input",
|
|
@@ -8170,7 +8161,7 @@
|
|
|
8170
8161
|
onInput: filterTextChangeHandler
|
|
8171
8162
|
}, {
|
|
8172
8163
|
prefix: vue.withCtx(() => [
|
|
8173
|
-
vue.createVNode(vue.unref(
|
|
8164
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), null, {
|
|
8174
8165
|
default: vue.withCtx(() => [
|
|
8175
8166
|
vue.createVNode(vue.unref(iconsVue.Search))
|
|
8176
8167
|
]),
|
|
@@ -8184,9 +8175,9 @@
|
|
|
8184
8175
|
});
|
|
8185
8176
|
|
|
8186
8177
|
const _hoisted_1$9 = ["draggable", "data-node-id", "data-parent-id", "data-parents-id", "data-is-container"];
|
|
8187
|
-
const _hoisted_2$
|
|
8188
|
-
const _hoisted_3$
|
|
8189
|
-
const _hoisted_4$
|
|
8178
|
+
const _hoisted_2$3 = { class: "tree-node-label" };
|
|
8179
|
+
const _hoisted_3$1 = { class: "tree-node-tool" };
|
|
8180
|
+
const _hoisted_4$1 = {
|
|
8190
8181
|
key: 0,
|
|
8191
8182
|
class: "m-editor-tree-node-children"
|
|
8192
8183
|
};
|
|
@@ -8200,7 +8191,8 @@
|
|
|
8200
8191
|
parent: {},
|
|
8201
8192
|
parentsId: { default: () => [] },
|
|
8202
8193
|
nodeStatusMap: {},
|
|
8203
|
-
indent: { default: 0 }
|
|
8194
|
+
indent: { default: 0 },
|
|
8195
|
+
nextLevelIndentIncrement: { default: 11 }
|
|
8204
8196
|
},
|
|
8205
8197
|
emits: ["node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
8206
8198
|
setup(__props, { emit: __emit }) {
|
|
@@ -8274,18 +8266,18 @@
|
|
|
8274
8266
|
onClick: nodeClickHandler
|
|
8275
8267
|
}, [
|
|
8276
8268
|
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
8277
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
8269
|
+
vue.createElementVNode("div", _hoisted_2$3, [
|
|
8278
8270
|
vue.renderSlot(_ctx.$slots, "tree-node-label", { data: _ctx.data }, () => [
|
|
8279
8271
|
vue.createTextVNode(vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1)
|
|
8280
8272
|
])
|
|
8281
8273
|
]),
|
|
8282
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
8274
|
+
vue.createElementVNode("div", _hoisted_3$1, [
|
|
8283
8275
|
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: _ctx.data })
|
|
8284
8276
|
])
|
|
8285
8277
|
])
|
|
8286
8278
|
])
|
|
8287
8279
|
], 38),
|
|
8288
|
-
hasChildren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
8280
|
+
hasChildren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
|
|
8289
8281
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (item) => {
|
|
8290
8282
|
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
8291
8283
|
key: item.id,
|
|
@@ -8293,7 +8285,7 @@
|
|
|
8293
8285
|
parent: _ctx.data,
|
|
8294
8286
|
parentsId: [..._ctx.parentsId, _ctx.data.id],
|
|
8295
8287
|
"node-status-map": _ctx.nodeStatusMap,
|
|
8296
|
-
indent: _ctx.indent +
|
|
8288
|
+
indent: _ctx.indent + _ctx.nextLevelIndentIncrement
|
|
8297
8289
|
}, {
|
|
8298
8290
|
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
8299
8291
|
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
@@ -8328,6 +8320,7 @@
|
|
|
8328
8320
|
data: {},
|
|
8329
8321
|
nodeStatusMap: {},
|
|
8330
8322
|
indent: { default: 0 },
|
|
8323
|
+
nextLevelIndentIncrement: {},
|
|
8331
8324
|
emptyText: { default: "暂无数据" }
|
|
8332
8325
|
},
|
|
8333
8326
|
emits: ["node-dragover", "node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
@@ -8347,6 +8340,7 @@
|
|
|
8347
8340
|
key: item.id,
|
|
8348
8341
|
data: item,
|
|
8349
8342
|
indent: _ctx.indent,
|
|
8343
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8350
8344
|
"node-status-map": _ctx.nodeStatusMap
|
|
8351
8345
|
}, {
|
|
8352
8346
|
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
@@ -8359,7 +8353,7 @@
|
|
|
8359
8353
|
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
8360
8354
|
]),
|
|
8361
8355
|
_: 2
|
|
8362
|
-
}, 1032, ["data", "indent", "node-status-map"]);
|
|
8356
|
+
}, 1032, ["data", "indent", "next-level-indent-increment", "node-status-map"]);
|
|
8363
8357
|
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
8364
8358
|
vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
8365
8359
|
]))
|
|
@@ -8374,6 +8368,8 @@
|
|
|
8374
8368
|
},
|
|
8375
8369
|
__name: "CodeBlockList",
|
|
8376
8370
|
props: {
|
|
8371
|
+
indent: {},
|
|
8372
|
+
nextLevelIndentIncrement: {},
|
|
8377
8373
|
customError: { type: Function }
|
|
8378
8374
|
},
|
|
8379
8375
|
emits: ["edit", "remove"],
|
|
@@ -8384,7 +8380,7 @@
|
|
|
8384
8380
|
const { codeBlockService, depService, editorService } = services || {};
|
|
8385
8381
|
const codeList = vue.computed(
|
|
8386
8382
|
() => Object.entries(codeBlockService?.getCodeDsl() || {}).map(([codeId, code]) => {
|
|
8387
|
-
const target = depService?.getTarget(codeId,
|
|
8383
|
+
const target = depService?.getTarget(codeId, core.DepTargetType.CODE_BLOCK);
|
|
8388
8384
|
const pageList = editorService?.get("root")?.items.map((page) => ({
|
|
8389
8385
|
name: page.devconfig?.tabName || page.name,
|
|
8390
8386
|
type: "node",
|
|
@@ -8446,7 +8442,7 @@
|
|
|
8446
8442
|
const existBinds = Boolean(currentCode?.items?.length);
|
|
8447
8443
|
const undeleteableList = codeBlockService?.getUndeletableList() || [];
|
|
8448
8444
|
if (!existBinds && !undeleteableList.includes(id)) {
|
|
8449
|
-
await
|
|
8445
|
+
await designPlugin.tMagicMessageBox.confirm("确定删除该代码块吗?", "提示", {
|
|
8450
8446
|
confirmButtonText: "确定",
|
|
8451
8447
|
cancelButtonText: "取消",
|
|
8452
8448
|
type: "warning"
|
|
@@ -8456,7 +8452,7 @@
|
|
|
8456
8452
|
if (typeof props.customError === "function") {
|
|
8457
8453
|
props.customError(id, existBinds ? CodeDeleteErrorType.BIND : CodeDeleteErrorType.UNDELETEABLE);
|
|
8458
8454
|
} else {
|
|
8459
|
-
|
|
8455
|
+
designPlugin.tMagicMessage.error("代码块删除失败");
|
|
8460
8456
|
}
|
|
8461
8457
|
}
|
|
8462
8458
|
};
|
|
@@ -8467,6 +8463,8 @@
|
|
|
8467
8463
|
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
8468
8464
|
data: codeList.value,
|
|
8469
8465
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
8466
|
+
indent: _ctx.indent,
|
|
8467
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8470
8468
|
onNodeClick: clickHandler
|
|
8471
8469
|
}, {
|
|
8472
8470
|
"tree-node-label": vue.withCtx(({ data }) => [
|
|
@@ -8479,7 +8477,7 @@
|
|
|
8479
8477
|
}, vue.toDisplayString(data.name) + " " + vue.toDisplayString(data.key ? `(${data.key})` : ""), 3)
|
|
8480
8478
|
]),
|
|
8481
8479
|
"tree-node-tool": vue.withCtx(({ data }) => [
|
|
8482
|
-
data.type === "code" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8480
|
+
data.type === "code" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8483
8481
|
key: 0,
|
|
8484
8482
|
effect: "dark",
|
|
8485
8483
|
content: editable.value ? "编辑" : "查看",
|
|
@@ -8494,7 +8492,7 @@
|
|
|
8494
8492
|
]),
|
|
8495
8493
|
_: 2
|
|
8496
8494
|
}, 1032, ["content"])) : vue.createCommentVNode("", true),
|
|
8497
|
-
data.type === "code" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8495
|
+
data.type === "code" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8498
8496
|
key: 1,
|
|
8499
8497
|
effect: "dark",
|
|
8500
8498
|
content: "删除",
|
|
@@ -8515,7 +8513,7 @@
|
|
|
8515
8513
|
})
|
|
8516
8514
|
]),
|
|
8517
8515
|
_: 3
|
|
8518
|
-
}, 8, ["data", "node-status-map"]);
|
|
8516
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment"]);
|
|
8519
8517
|
};
|
|
8520
8518
|
}
|
|
8521
8519
|
});
|
|
@@ -8527,6 +8525,8 @@
|
|
|
8527
8525
|
},
|
|
8528
8526
|
__name: "CodeBlockListPanel",
|
|
8529
8527
|
props: {
|
|
8528
|
+
indent: {},
|
|
8529
|
+
nextLevelIndentIncrement: {},
|
|
8530
8530
|
customError: { type: Function }
|
|
8531
8531
|
},
|
|
8532
8532
|
setup(__props) {
|
|
@@ -8543,21 +8543,21 @@
|
|
|
8543
8543
|
});
|
|
8544
8544
|
return (_ctx, _cache) => {
|
|
8545
8545
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
8546
|
-
vue.createVNode(vue.unref(
|
|
8546
|
+
vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-layer-panel" }, {
|
|
8547
8547
|
default: vue.withCtx(() => [
|
|
8548
8548
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
8549
8549
|
vue.createElementVNode("div", _hoisted_1$7, [
|
|
8550
8550
|
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
8551
|
-
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8551
|
+
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
8552
8552
|
key: 0,
|
|
8553
8553
|
class: "create-code-button",
|
|
8554
8554
|
type: "primary",
|
|
8555
8555
|
size: "small",
|
|
8556
8556
|
onClick: vue.unref(createCodeBlock)
|
|
8557
8557
|
}, {
|
|
8558
|
-
default: vue.withCtx(() => [
|
|
8558
|
+
default: vue.withCtx(() => _cache[0] || (_cache[0] = [
|
|
8559
8559
|
vue.createTextVNode("新增")
|
|
8560
|
-
]),
|
|
8560
|
+
])),
|
|
8561
8561
|
_: 1
|
|
8562
8562
|
}, 8, ["onClick"])) : vue.createCommentVNode("", true),
|
|
8563
8563
|
vue.renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
@@ -8567,6 +8567,8 @@
|
|
|
8567
8567
|
ref_key: "codeBlockList",
|
|
8568
8568
|
ref: codeBlockList,
|
|
8569
8569
|
"custom-error": _ctx.customError,
|
|
8570
|
+
indent: _ctx.indent,
|
|
8571
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8570
8572
|
onEdit: vue.unref(editCode),
|
|
8571
8573
|
onRemove: vue.unref(deleteCode)
|
|
8572
8574
|
}, {
|
|
@@ -8577,7 +8579,7 @@
|
|
|
8577
8579
|
})
|
|
8578
8580
|
]),
|
|
8579
8581
|
_: 3
|
|
8580
|
-
}, 8, ["custom-error", "onEdit", "onRemove"])
|
|
8582
|
+
}, 8, ["custom-error", "indent", "next-level-indent-increment", "onEdit", "onRemove"])
|
|
8581
8583
|
]),
|
|
8582
8584
|
_: 3
|
|
8583
8585
|
}),
|
|
@@ -8660,7 +8662,7 @@
|
|
|
8660
8662
|
emit("submit", values);
|
|
8661
8663
|
};
|
|
8662
8664
|
const errorHandler = (error) => {
|
|
8663
|
-
|
|
8665
|
+
designPlugin.tMagicMessage.error(error.message);
|
|
8664
8666
|
};
|
|
8665
8667
|
__expose({
|
|
8666
8668
|
show() {
|
|
@@ -8683,7 +8685,7 @@
|
|
|
8683
8685
|
position: vue.unref(boxPosition)
|
|
8684
8686
|
}, {
|
|
8685
8687
|
body: vue.withCtx(() => [
|
|
8686
|
-
vue.createVNode(vue.unref(
|
|
8688
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
8687
8689
|
"label-width": "80px",
|
|
8688
8690
|
title: _ctx.title,
|
|
8689
8691
|
config: dataSourceConfig.value,
|
|
@@ -8705,15 +8707,19 @@
|
|
|
8705
8707
|
name: "MEditorDataSourceList"
|
|
8706
8708
|
},
|
|
8707
8709
|
__name: "DataSourceList",
|
|
8710
|
+
props: {
|
|
8711
|
+
indent: {},
|
|
8712
|
+
nextLevelIndentIncrement: {}
|
|
8713
|
+
},
|
|
8708
8714
|
emits: ["edit", "remove"],
|
|
8709
8715
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8710
8716
|
const emit = __emit;
|
|
8711
8717
|
const { depService, editorService, dataSourceService } = vue.inject("services") || {};
|
|
8712
8718
|
const editable = vue.computed(() => dataSourceService?.get("editable") ?? true);
|
|
8713
8719
|
const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
|
|
8714
|
-
const dsDep = vue.computed(() => depService?.getTargets(
|
|
8715
|
-
const dsMethodDep = vue.computed(() => depService?.getTargets(
|
|
8716
|
-
const dsCondDep = vue.computed(() => depService?.getTargets(
|
|
8720
|
+
const dsDep = vue.computed(() => depService?.getTargets(core.DepTargetType.DATA_SOURCE) || {});
|
|
8721
|
+
const dsMethodDep = vue.computed(() => depService?.getTargets(core.DepTargetType.DATA_SOURCE_METHOD) || {});
|
|
8722
|
+
const dsCondDep = vue.computed(() => depService?.getTargets(core.DepTargetType.DATA_SOURCE_COND) || {});
|
|
8717
8723
|
const getKeyTreeConfig = (dep, type, parentKey) => dep.keys.map((key) => ({
|
|
8718
8724
|
name: key,
|
|
8719
8725
|
id: `${parentKey}_${key}`,
|
|
@@ -8776,7 +8782,7 @@
|
|
|
8776
8782
|
emit("edit", id);
|
|
8777
8783
|
};
|
|
8778
8784
|
const removeHandler = async (id) => {
|
|
8779
|
-
await
|
|
8785
|
+
await designPlugin.tMagicMessageBox.confirm("确定删除?", "提示", {
|
|
8780
8786
|
confirmButtonText: "确定",
|
|
8781
8787
|
cancelButtonText: "取消",
|
|
8782
8788
|
type: "warning"
|
|
@@ -8800,6 +8806,8 @@
|
|
|
8800
8806
|
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
8801
8807
|
data: list.value,
|
|
8802
8808
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
8809
|
+
indent: _ctx.indent,
|
|
8810
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8803
8811
|
onNodeClick: clickHandler
|
|
8804
8812
|
}, {
|
|
8805
8813
|
"tree-node-label": vue.withCtx(({ data }) => [
|
|
@@ -8812,7 +8820,7 @@
|
|
|
8812
8820
|
}, vue.toDisplayString(data.name) + " " + vue.toDisplayString(data.key ? `(${data.key})` : ""), 3)
|
|
8813
8821
|
]),
|
|
8814
8822
|
"tree-node-tool": vue.withCtx(({ data }) => [
|
|
8815
|
-
data.type === "ds" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8823
|
+
data.type === "ds" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8816
8824
|
key: 0,
|
|
8817
8825
|
effect: "dark",
|
|
8818
8826
|
content: editable.value ? "编辑" : "查看",
|
|
@@ -8827,7 +8835,7 @@
|
|
|
8827
8835
|
]),
|
|
8828
8836
|
_: 2
|
|
8829
8837
|
}, 1032, ["content"])) : vue.createCommentVNode("", true),
|
|
8830
|
-
data.type === "ds" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8838
|
+
data.type === "ds" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8831
8839
|
key: 1,
|
|
8832
8840
|
effect: "dark",
|
|
8833
8841
|
content: "删除",
|
|
@@ -8845,7 +8853,7 @@
|
|
|
8845
8853
|
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
8846
8854
|
]),
|
|
8847
8855
|
_: 3
|
|
8848
|
-
}, 8, ["data", "node-status-map"]);
|
|
8856
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment"]);
|
|
8849
8857
|
};
|
|
8850
8858
|
}
|
|
8851
8859
|
});
|
|
@@ -8856,6 +8864,10 @@
|
|
|
8856
8864
|
name: "MEditorDataSourceListPanel"
|
|
8857
8865
|
},
|
|
8858
8866
|
__name: "DataSourceListPanel",
|
|
8867
|
+
props: {
|
|
8868
|
+
indent: {},
|
|
8869
|
+
nextLevelIndentIncrement: {}
|
|
8870
|
+
},
|
|
8859
8871
|
setup(__props) {
|
|
8860
8872
|
const eventBus = vue.inject("eventBus");
|
|
8861
8873
|
const { dataSourceService } = vue.inject("services") || {};
|
|
@@ -8893,24 +8905,25 @@
|
|
|
8893
8905
|
});
|
|
8894
8906
|
return (_ctx, _cache) => {
|
|
8895
8907
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
8896
|
-
vue.createVNode(vue.unref(
|
|
8908
|
+
vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
|
|
8897
8909
|
default: vue.withCtx(() => [
|
|
8898
8910
|
vue.createElementVNode("div", _hoisted_1$6, [
|
|
8899
8911
|
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
8900
|
-
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8912
|
+
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicPopover), {
|
|
8901
8913
|
key: 0,
|
|
8902
8914
|
placement: "right",
|
|
8903
8915
|
trigger: "hover",
|
|
8904
|
-
"popper-class": "data-source-list-panel-add-menu"
|
|
8916
|
+
"popper-class": "data-source-list-panel-add-menu",
|
|
8917
|
+
"destroy-on-close": true
|
|
8905
8918
|
}, {
|
|
8906
8919
|
reference: vue.withCtx(() => [
|
|
8907
|
-
vue.createVNode(vue.unref(
|
|
8920
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
8908
8921
|
type: "primary",
|
|
8909
8922
|
size: "small"
|
|
8910
8923
|
}, {
|
|
8911
|
-
default: vue.withCtx(() => [
|
|
8924
|
+
default: vue.withCtx(() => _cache[0] || (_cache[0] = [
|
|
8912
8925
|
vue.createTextVNode("新增")
|
|
8913
|
-
]),
|
|
8926
|
+
])),
|
|
8914
8927
|
_: 1
|
|
8915
8928
|
})
|
|
8916
8929
|
]),
|
|
@@ -8935,9 +8948,11 @@
|
|
|
8935
8948
|
vue.createVNode(_sfc_main$i, {
|
|
8936
8949
|
ref_key: "dataSourceList",
|
|
8937
8950
|
ref: dataSourceList,
|
|
8951
|
+
indent: _ctx.indent,
|
|
8952
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8938
8953
|
onEdit: vue.unref(editHandler),
|
|
8939
8954
|
onRemove: removeHandler
|
|
8940
|
-
}, null, 8, ["onEdit"])
|
|
8955
|
+
}, null, 8, ["indent", "next-level-indent-increment", "onEdit"])
|
|
8941
8956
|
]),
|
|
8942
8957
|
_: 3
|
|
8943
8958
|
}),
|
|
@@ -8974,7 +8989,7 @@
|
|
|
8974
8989
|
const subMenu = vue.ref();
|
|
8975
8990
|
const visible = vue.ref(false);
|
|
8976
8991
|
const subMenuData = vue.ref([]);
|
|
8977
|
-
const zIndex =
|
|
8992
|
+
const zIndex = designPlugin.useZIndex();
|
|
8978
8993
|
const curZIndex = vue.ref(0);
|
|
8979
8994
|
const menuPosition = vue.ref({
|
|
8980
8995
|
left: 0,
|
|
@@ -9127,18 +9142,6 @@
|
|
|
9127
9142
|
fill: "currentColor",
|
|
9128
9143
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9129
9144
|
};
|
|
9130
|
-
const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
9131
|
-
"fill-rule": "evenodd",
|
|
9132
|
-
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"
|
|
9133
|
-
}, null, -1);
|
|
9134
|
-
const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
9135
|
-
"fill-rule": "evenodd",
|
|
9136
|
-
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"
|
|
9137
|
-
}, null, -1);
|
|
9138
|
-
const _hoisted_4$2 = [
|
|
9139
|
-
_hoisted_2$4,
|
|
9140
|
-
_hoisted_3$2
|
|
9141
|
-
];
|
|
9142
9145
|
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
9143
9146
|
...{
|
|
9144
9147
|
name: "MEditorFolderMinusIcon"
|
|
@@ -9146,7 +9149,16 @@
|
|
|
9146
9149
|
__name: "FolderMinusIcon",
|
|
9147
9150
|
setup(__props) {
|
|
9148
9151
|
return (_ctx, _cache) => {
|
|
9149
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5,
|
|
9152
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5, _cache[0] || (_cache[0] = [
|
|
9153
|
+
vue.createElementVNode("path", {
|
|
9154
|
+
"fill-rule": "evenodd",
|
|
9155
|
+
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"
|
|
9156
|
+
}, null, -1),
|
|
9157
|
+
vue.createElementVNode("path", {
|
|
9158
|
+
"fill-rule": "evenodd",
|
|
9159
|
+
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"
|
|
9160
|
+
}, null, -1)
|
|
9161
|
+
]));
|
|
9150
9162
|
};
|
|
9151
9163
|
}
|
|
9152
9164
|
});
|
|
@@ -9157,7 +9169,7 @@
|
|
|
9157
9169
|
icon: iconsVue.Delete,
|
|
9158
9170
|
display: (services) => {
|
|
9159
9171
|
const node = services?.editorService?.get("node");
|
|
9160
|
-
return node?.type !==
|
|
9172
|
+
return node?.type !== core.NodeType.ROOT && !utils.isPage(node) && !utils.isPageFragment(node);
|
|
9161
9173
|
},
|
|
9162
9174
|
handler: (services) => {
|
|
9163
9175
|
const nodes = services?.editorService?.get("nodes");
|
|
@@ -9185,8 +9197,8 @@
|
|
|
9185
9197
|
const stage = services?.editorService?.get("stage");
|
|
9186
9198
|
const rect = menu.value.$el.getBoundingClientRect();
|
|
9187
9199
|
const parentRect = stage?.container?.getBoundingClientRect();
|
|
9188
|
-
const initialLeft = utils.calcValueByFontsize(stage?.renderer
|
|
9189
|
-
const initialTop = utils.calcValueByFontsize(stage?.renderer
|
|
9200
|
+
const initialLeft = utils.calcValueByFontsize(stage?.renderer?.getDocument(), (rect.left || 0) - (parentRect?.left || 0)) / services.uiService.get("zoom");
|
|
9201
|
+
const initialTop = utils.calcValueByFontsize(stage?.renderer?.getDocument(), (rect.top || 0) - (parentRect?.top || 0)) / services.uiService.get("zoom");
|
|
9190
9202
|
services?.editorService?.paste({ left: initialLeft, top: initialTop });
|
|
9191
9203
|
} else {
|
|
9192
9204
|
services?.editorService?.paste();
|
|
@@ -9746,7 +9758,7 @@
|
|
|
9746
9758
|
draggable: false
|
|
9747
9759
|
});
|
|
9748
9760
|
page.items.forEach(
|
|
9749
|
-
(node) => traverseNode(node, (node2) => {
|
|
9761
|
+
(node) => utils.traverseNode(node, (node2) => {
|
|
9750
9762
|
map.set(
|
|
9751
9763
|
node2.id,
|
|
9752
9764
|
initialLayerNodeStatus?.get(node2.id) || {
|
|
@@ -9801,7 +9813,7 @@
|
|
|
9801
9813
|
services?.editorService.on("add", (newNodes) => {
|
|
9802
9814
|
newNodes.forEach((node) => {
|
|
9803
9815
|
if (utils.isPage(node) || utils.isPageFragment(node)) return;
|
|
9804
|
-
traverseNode(node, (node2) => {
|
|
9816
|
+
utils.traverseNode(node, (node2) => {
|
|
9805
9817
|
nodeStatusMap.value?.set(node2.id, {
|
|
9806
9818
|
visible: true,
|
|
9807
9819
|
expand: Array.isArray(node2.items),
|
|
@@ -9813,7 +9825,7 @@
|
|
|
9813
9825
|
});
|
|
9814
9826
|
services?.editorService.on("remove", (nodes2) => {
|
|
9815
9827
|
nodes2.forEach((node) => {
|
|
9816
|
-
traverseNode(node, (node2) => {
|
|
9828
|
+
utils.traverseNode(node, (node2) => {
|
|
9817
9829
|
nodeStatusMap.value?.delete(node2.id);
|
|
9818
9830
|
});
|
|
9819
9831
|
});
|
|
@@ -9831,6 +9843,8 @@
|
|
|
9831
9843
|
__name: "LayerPanel",
|
|
9832
9844
|
props: {
|
|
9833
9845
|
layerContentMenu: {},
|
|
9846
|
+
indent: {},
|
|
9847
|
+
nextLevelIndentIncrement: {},
|
|
9834
9848
|
customContentMenu: { type: Function }
|
|
9835
9849
|
},
|
|
9836
9850
|
setup(__props) {
|
|
@@ -9869,7 +9883,7 @@
|
|
|
9869
9883
|
highlightHandler: mouseenterHandler
|
|
9870
9884
|
} = useClick(services, isCtrlKeyDown, nodeStatusMap);
|
|
9871
9885
|
return (_ctx, _cache) => {
|
|
9872
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
9886
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
9873
9887
|
default: vue.withCtx(() => [
|
|
9874
9888
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
9875
9889
|
vue.createVNode(_sfc_main$o, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
@@ -9880,6 +9894,8 @@
|
|
|
9880
9894
|
ref: tree,
|
|
9881
9895
|
data: nodeData.value,
|
|
9882
9896
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
9897
|
+
indent: _ctx.indent,
|
|
9898
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
9883
9899
|
onNodeDragover: vue.unref(handleDragOver),
|
|
9884
9900
|
onNodeDragstart: vue.unref(handleDragStart),
|
|
9885
9901
|
onNodeDragleave: vue.unref(handleDragLeave),
|
|
@@ -9900,7 +9916,7 @@
|
|
|
9900
9916
|
vue.renderSlot(_ctx.$slots, "layer-node-label", { data: nodeData2 })
|
|
9901
9917
|
]),
|
|
9902
9918
|
_: 3
|
|
9903
|
-
}, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
9919
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
9904
9920
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
9905
9921
|
vue.createVNode(_sfc_main$e, {
|
|
9906
9922
|
ref_key: "menu",
|
|
@@ -9918,7 +9934,7 @@
|
|
|
9918
9934
|
});
|
|
9919
9935
|
|
|
9920
9936
|
const _hoisted_1$4 = ["onClick", "onDragstart"];
|
|
9921
|
-
const _hoisted_2$
|
|
9937
|
+
const _hoisted_2$2 = ["title"];
|
|
9922
9938
|
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
9923
9939
|
...{
|
|
9924
9940
|
name: "MEditorComponentListPanel"
|
|
@@ -9969,7 +9985,7 @@
|
|
|
9969
9985
|
globalThis.clearTimeout(timeout);
|
|
9970
9986
|
timeout = void 0;
|
|
9971
9987
|
}
|
|
9972
|
-
const doc = stage.value?.renderer
|
|
9988
|
+
const doc = stage.value?.renderer?.getDocument();
|
|
9973
9989
|
if (doc && stageOptions?.containerHighlightClassName) {
|
|
9974
9990
|
utils.removeClassNameByClassName(doc, stageOptions.containerHighlightClassName);
|
|
9975
9991
|
}
|
|
@@ -9990,19 +10006,19 @@
|
|
|
9990
10006
|
timeout = stage.value.delayedMarkContainer(e);
|
|
9991
10007
|
};
|
|
9992
10008
|
return (_ctx, _cache) => {
|
|
9993
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
10009
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicScrollbar), null, {
|
|
9994
10010
|
default: vue.withCtx(() => [
|
|
9995
10011
|
vue.renderSlot(_ctx.$slots, "component-list-panel-header"),
|
|
9996
10012
|
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
9997
10013
|
vue.renderSlot(_ctx.$slots, "component-list", { componentGroupList: list.value }, () => [
|
|
9998
|
-
vue.createVNode(vue.unref(
|
|
10014
|
+
vue.createVNode(vue.unref(designPlugin.TMagicCollapse), {
|
|
9999
10015
|
class: "ui-component-panel",
|
|
10000
10016
|
"model-value": collapseValue.value
|
|
10001
10017
|
}, {
|
|
10002
10018
|
default: vue.withCtx(() => [
|
|
10003
10019
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
10004
10020
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
10005
|
-
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
10021
|
+
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicCollapseItem), {
|
|
10006
10022
|
key: index,
|
|
10007
10023
|
name: `${index}`
|
|
10008
10024
|
}, {
|
|
@@ -10022,7 +10038,7 @@
|
|
|
10022
10038
|
onDrag: dragHandler
|
|
10023
10039
|
}, [
|
|
10024
10040
|
vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
10025
|
-
vue.createVNode(vue.unref(
|
|
10041
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTooltip), {
|
|
10026
10042
|
placement: "right",
|
|
10027
10043
|
disabled: !Boolean(item.desc),
|
|
10028
10044
|
content: item.desc
|
|
@@ -10036,7 +10052,7 @@
|
|
|
10036
10052
|
}, 1032, ["disabled", "content"]),
|
|
10037
10053
|
vue.createElementVNode("span", {
|
|
10038
10054
|
title: item.text
|
|
10039
|
-
}, vue.toDisplayString(item.text), 9, _hoisted_2$
|
|
10055
|
+
}, vue.toDisplayString(item.text), 9, _hoisted_2$2)
|
|
10040
10056
|
])
|
|
10041
10057
|
], 40, _hoisted_1$4);
|
|
10042
10058
|
}), 128))
|
|
@@ -10060,13 +10076,13 @@
|
|
|
10060
10076
|
key: 0,
|
|
10061
10077
|
class: "m-editor-sidebar"
|
|
10062
10078
|
};
|
|
10063
|
-
const _hoisted_2$
|
|
10064
|
-
const _hoisted_3
|
|
10065
|
-
const _hoisted_4
|
|
10079
|
+
const _hoisted_2$1 = { class: "m-editor-sidebar-header" };
|
|
10080
|
+
const _hoisted_3 = ["draggable", "onClick", "onDragend"];
|
|
10081
|
+
const _hoisted_4 = {
|
|
10066
10082
|
key: 1,
|
|
10067
10083
|
class: "magic-editor-tab-panel-title"
|
|
10068
10084
|
};
|
|
10069
|
-
const _hoisted_5
|
|
10085
|
+
const _hoisted_5 = { class: "m-editor-slide-list-box" };
|
|
10070
10086
|
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
10071
10087
|
...{
|
|
10072
10088
|
name: "MEditorSidebar"
|
|
@@ -10079,6 +10095,8 @@
|
|
|
10079
10095
|
items: [SideItemKey.COMPONENT_LIST, SideItemKey.LAYER, SideItemKey.CODE_BLOCK, SideItemKey.DATA_SOURCE]
|
|
10080
10096
|
}) },
|
|
10081
10097
|
layerContentMenu: {},
|
|
10098
|
+
indent: {},
|
|
10099
|
+
nextLevelIndentIncrement: {},
|
|
10082
10100
|
customContentMenu: {}
|
|
10083
10101
|
},
|
|
10084
10102
|
setup(__props, { expose: __expose }) {
|
|
@@ -10119,7 +10137,9 @@
|
|
|
10119
10137
|
text: "已选组件",
|
|
10120
10138
|
props: {
|
|
10121
10139
|
layerContentMenu: props.layerContentMenu,
|
|
10122
|
-
customContentMenu: props.customContentMenu
|
|
10140
|
+
customContentMenu: props.customContentMenu,
|
|
10141
|
+
indent: props.indent,
|
|
10142
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10123
10143
|
},
|
|
10124
10144
|
component: _sfc_main$c,
|
|
10125
10145
|
slots: {}
|
|
@@ -10130,6 +10150,10 @@
|
|
|
10130
10150
|
icon: iconsVue.EditPen,
|
|
10131
10151
|
text: "代码编辑",
|
|
10132
10152
|
component: _sfc_main$k,
|
|
10153
|
+
props: {
|
|
10154
|
+
indent: props.indent,
|
|
10155
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10156
|
+
},
|
|
10133
10157
|
slots: {}
|
|
10134
10158
|
},
|
|
10135
10159
|
[SideItemKey.DATA_SOURCE]: {
|
|
@@ -10138,6 +10162,10 @@
|
|
|
10138
10162
|
icon: iconsVue.Coin,
|
|
10139
10163
|
text: "数据源",
|
|
10140
10164
|
component: _sfc_main$h,
|
|
10165
|
+
props: {
|
|
10166
|
+
indent: props.indent,
|
|
10167
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10168
|
+
},
|
|
10141
10169
|
slots: {}
|
|
10142
10170
|
}
|
|
10143
10171
|
};
|
|
@@ -10192,7 +10220,7 @@
|
|
|
10192
10220
|
return (_ctx, _cache) => {
|
|
10193
10221
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
10194
10222
|
_ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
10195
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
10223
|
+
vue.createElementVNode("div", _hoisted_2$1, [
|
|
10196
10224
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sideBarItems.value, (config, index) => {
|
|
10197
10225
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
10198
10226
|
class: vue.normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
|
|
@@ -10208,8 +10236,8 @@
|
|
|
10208
10236
|
key: 0,
|
|
10209
10237
|
icon: config.icon
|
|
10210
10238
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
10211
|
-
config.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4
|
|
10212
|
-
], 46, _hoisted_3
|
|
10239
|
+
config.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, vue.toDisplayString(config.text), 1)) : vue.createCommentVNode("", true)
|
|
10240
|
+
], 46, _hoisted_3)), [
|
|
10213
10241
|
[vue.vShow, !vue.unref(floatBoxStates)[config.$key]?.status]
|
|
10214
10242
|
]);
|
|
10215
10243
|
}), 128))
|
|
@@ -10364,7 +10392,7 @@
|
|
|
10364
10392
|
}
|
|
10365
10393
|
}, {
|
|
10366
10394
|
body: vue.withCtx(() => [
|
|
10367
|
-
vue.createElementVNode("div", _hoisted_5
|
|
10395
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
10368
10396
|
config && vue.unref(floatBoxStates)[config.$key].status ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.component), vue.mergeProps({
|
|
10369
10397
|
key: 0,
|
|
10370
10398
|
ref_for: true
|
|
@@ -10595,7 +10623,7 @@
|
|
|
10595
10623
|
if (!stage2) return;
|
|
10596
10624
|
vue.nextTick(() => unWatch());
|
|
10597
10625
|
stage2.on("select", (el, event) => {
|
|
10598
|
-
const els = stage2.renderer
|
|
10626
|
+
const els = stage2.renderer?.getElementsFromPoint(event) || [];
|
|
10599
10627
|
const ids = els.map((el2) => utils.getIdFromEl()(el2)).filter((id) => Boolean(id));
|
|
10600
10628
|
buttonVisible.value = ids.length > 3;
|
|
10601
10629
|
filterTextChangeHandler(ids);
|
|
@@ -10639,7 +10667,7 @@
|
|
|
10639
10667
|
});
|
|
10640
10668
|
return (_ctx, _cache) => {
|
|
10641
10669
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
10642
|
-
page.value && buttonVisible.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
10670
|
+
page.value && buttonVisible.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
10643
10671
|
key: 0,
|
|
10644
10672
|
content: "点击查看当前位置下的组件"
|
|
10645
10673
|
}, {
|
|
@@ -10694,7 +10722,7 @@
|
|
|
10694
10722
|
vue.watch(stage, (stage2) => {
|
|
10695
10723
|
if (stage2) {
|
|
10696
10724
|
stage2.on("dblclick", async (event) => {
|
|
10697
|
-
const el = await stage2.actionManager
|
|
10725
|
+
const el = await stage2.actionManager?.getElementFromPoint(event) || null;
|
|
10698
10726
|
services?.stageOverlayService.openOverlay(el);
|
|
10699
10727
|
});
|
|
10700
10728
|
} else {
|
|
@@ -10709,11 +10737,15 @@
|
|
|
10709
10737
|
subStage.mount(stageOverlay2);
|
|
10710
10738
|
const { mask, renderer } = subStage;
|
|
10711
10739
|
const { contentWindow } = renderer;
|
|
10712
|
-
mask
|
|
10740
|
+
mask?.showRule(false);
|
|
10713
10741
|
services?.stageOverlayService.updateOverlay();
|
|
10714
10742
|
contentWindow?.magic.onRuntimeReady({});
|
|
10715
10743
|
}
|
|
10716
10744
|
});
|
|
10745
|
+
vue.onBeforeUnmount(() => {
|
|
10746
|
+
services?.stageOverlayService.get("stage")?.destroy();
|
|
10747
|
+
services?.stageOverlayService.set("stage", null);
|
|
10748
|
+
});
|
|
10717
10749
|
const closeOverlayHandler = () => {
|
|
10718
10750
|
services?.stageOverlayService.closeOverlay();
|
|
10719
10751
|
};
|
|
@@ -10723,7 +10755,7 @@
|
|
|
10723
10755
|
class: "m-editor-stage-overlay",
|
|
10724
10756
|
onClick: closeOverlayHandler
|
|
10725
10757
|
}, [
|
|
10726
|
-
vue.createVNode(vue.unref(
|
|
10758
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), {
|
|
10727
10759
|
class: "m-editor-stage-overlay-close",
|
|
10728
10760
|
size: "20",
|
|
10729
10761
|
onClick: closeOverlayHandler
|
|
@@ -10751,32 +10783,6 @@
|
|
|
10751
10783
|
fill: "none",
|
|
10752
10784
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10753
10785
|
};
|
|
10754
|
-
const _hoisted_2$1 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
10755
|
-
"fill-rule": "evenodd",
|
|
10756
|
-
"clip-rule": "evenodd",
|
|
10757
|
-
d: "M2 4H21V6H2V4Z",
|
|
10758
|
-
fill: "black",
|
|
10759
|
-
"fill-opacity": "0.9"
|
|
10760
|
-
}, null, -1);
|
|
10761
|
-
const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
10762
|
-
"fill-rule": "evenodd",
|
|
10763
|
-
"clip-rule": "evenodd",
|
|
10764
|
-
d: "M5 11H18V13H5V11Z",
|
|
10765
|
-
fill: "black",
|
|
10766
|
-
"fill-opacity": "0.9"
|
|
10767
|
-
}, null, -1);
|
|
10768
|
-
const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
10769
|
-
"fill-rule": "evenodd",
|
|
10770
|
-
"clip-rule": "evenodd",
|
|
10771
|
-
d: "M2 18H21V20H2V18Z",
|
|
10772
|
-
fill: "black",
|
|
10773
|
-
"fill-opacity": "0.9"
|
|
10774
|
-
}, null, -1);
|
|
10775
|
-
const _hoisted_5 = [
|
|
10776
|
-
_hoisted_2$1,
|
|
10777
|
-
_hoisted_3,
|
|
10778
|
-
_hoisted_4
|
|
10779
|
-
];
|
|
10780
10786
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
10781
10787
|
...{
|
|
10782
10788
|
name: "MEditorCenterIcon"
|
|
@@ -10784,7 +10790,29 @@
|
|
|
10784
10790
|
__name: "CenterIcon",
|
|
10785
10791
|
setup(__props) {
|
|
10786
10792
|
return (_ctx, _cache) => {
|
|
10787
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2,
|
|
10793
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [
|
|
10794
|
+
vue.createElementVNode("path", {
|
|
10795
|
+
"fill-rule": "evenodd",
|
|
10796
|
+
"clip-rule": "evenodd",
|
|
10797
|
+
d: "M2 4H21V6H2V4Z",
|
|
10798
|
+
fill: "black",
|
|
10799
|
+
"fill-opacity": "0.9"
|
|
10800
|
+
}, null, -1),
|
|
10801
|
+
vue.createElementVNode("path", {
|
|
10802
|
+
"fill-rule": "evenodd",
|
|
10803
|
+
"clip-rule": "evenodd",
|
|
10804
|
+
d: "M5 11H18V13H5V11Z",
|
|
10805
|
+
fill: "black",
|
|
10806
|
+
"fill-opacity": "0.9"
|
|
10807
|
+
}, null, -1),
|
|
10808
|
+
vue.createElementVNode("path", {
|
|
10809
|
+
"fill-rule": "evenodd",
|
|
10810
|
+
"clip-rule": "evenodd",
|
|
10811
|
+
d: "M2 18H21V20H2V18Z",
|
|
10812
|
+
fill: "black",
|
|
10813
|
+
"fill-opacity": "0.9"
|
|
10814
|
+
}, null, -1)
|
|
10815
|
+
]));
|
|
10788
10816
|
};
|
|
10789
10817
|
}
|
|
10790
10818
|
});
|
|
@@ -10897,7 +10925,7 @@
|
|
|
10897
10925
|
const layout = await editorService.getLayout(parent.value);
|
|
10898
10926
|
const isLayoutConform = [Layout.ABSOLUTE, Layout.FIXED].includes(layout);
|
|
10899
10927
|
const isTypeConform = nodes.value?.every(
|
|
10900
|
-
(selectedNode) => ![
|
|
10928
|
+
(selectedNode) => ![core.NodeType.ROOT, core.NodeType.PAGE, "pop"].includes(`${selectedNode?.type}`)
|
|
10901
10929
|
);
|
|
10902
10930
|
canCenter.value = isLayoutConform && !!isTypeConform;
|
|
10903
10931
|
},
|
|
@@ -10965,6 +10993,9 @@
|
|
|
10965
10993
|
});
|
|
10966
10994
|
});
|
|
10967
10995
|
});
|
|
10996
|
+
vue.onBeforeUnmount(() => {
|
|
10997
|
+
stage?.destroy();
|
|
10998
|
+
});
|
|
10968
10999
|
vue.watch(zoom, (zoom2) => {
|
|
10969
11000
|
if (!stage || !zoom2) return;
|
|
10970
11001
|
stage.setZoom(zoom2);
|
|
@@ -11005,7 +11036,7 @@
|
|
|
11005
11036
|
services?.keybindingService.unregisterEl("stage");
|
|
11006
11037
|
services?.editorService.off("root-change", rootChangeHandler);
|
|
11007
11038
|
});
|
|
11008
|
-
const parseDSL =
|
|
11039
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
11009
11040
|
const contextmenuHandler = (e) => {
|
|
11010
11041
|
e.preventDefault();
|
|
11011
11042
|
menu.value?.show(e);
|
|
@@ -11022,7 +11053,7 @@
|
|
|
11022
11053
|
const config = parseDSL(`(${data})`);
|
|
11023
11054
|
if (!config || config.dragType !== DragType.COMPONENT_LIST) return;
|
|
11024
11055
|
e.preventDefault();
|
|
11025
|
-
const doc = stage?.renderer
|
|
11056
|
+
const doc = stage?.renderer?.contentWindow?.document;
|
|
11026
11057
|
const parentEl = doc?.querySelector(`.${stageOptions?.containerHighlightClassName}`);
|
|
11027
11058
|
let parent = page.value;
|
|
11028
11059
|
const parentId = utils.getIdFromEl()(parentEl);
|
|
@@ -11135,7 +11166,7 @@
|
|
|
11135
11166
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
11136
11167
|
key: item.id
|
|
11137
11168
|
}, [
|
|
11138
|
-
vue.createVNode(vue.unref(
|
|
11169
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
11139
11170
|
link: "",
|
|
11140
11171
|
disabled: item.id === node.value?.id,
|
|
11141
11172
|
onClick: ($event) => select(item)
|
|
@@ -11256,7 +11287,7 @@
|
|
|
11256
11287
|
if (codeDsl[id] && !force) return;
|
|
11257
11288
|
const codeConfigProcessed = lodashEs.cloneDeep(codeConfig);
|
|
11258
11289
|
if (codeConfigProcessed.content) {
|
|
11259
|
-
const parseDSL =
|
|
11290
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
11260
11291
|
if (typeof codeConfigProcessed.content === "string") {
|
|
11261
11292
|
codeConfigProcessed.content = parseDSL(codeConfigProcessed.content);
|
|
11262
11293
|
}
|
|
@@ -11378,10 +11409,10 @@
|
|
|
11378
11409
|
const copyNodes = Array.isArray(config) ? config : [config];
|
|
11379
11410
|
const copyData = {};
|
|
11380
11411
|
if (collectorOptions && typeof collectorOptions.isTarget === "function") {
|
|
11381
|
-
const customTarget = new
|
|
11412
|
+
const customTarget = new core.Target({
|
|
11382
11413
|
...collectorOptions
|
|
11383
11414
|
});
|
|
11384
|
-
const coperWatcher = new
|
|
11415
|
+
const coperWatcher = new core.Watcher();
|
|
11385
11416
|
coperWatcher.addTarget(customTarget);
|
|
11386
11417
|
coperWatcher.collect(copyNodes, {}, true, collectorOptions.type);
|
|
11387
11418
|
Object.keys(customTarget.deps).forEach((nodeId) => {
|
|
@@ -11565,10 +11596,10 @@
|
|
|
11565
11596
|
const copyNodes = Array.isArray(config) ? config : [config];
|
|
11566
11597
|
const copyData = [];
|
|
11567
11598
|
if (collectorOptions && typeof collectorOptions.isTarget === "function") {
|
|
11568
|
-
const customTarget = new
|
|
11599
|
+
const customTarget = new core.Target({
|
|
11569
11600
|
...collectorOptions
|
|
11570
11601
|
});
|
|
11571
|
-
const coperWatcher = new
|
|
11602
|
+
const coperWatcher = new core.Watcher();
|
|
11572
11603
|
coperWatcher.addTarget(customTarget);
|
|
11573
11604
|
coperWatcher.collect(copyNodes, {}, true, collectorOptions.type);
|
|
11574
11605
|
Object.keys(customTarget.deps).forEach((nodeId) => {
|
|
@@ -11607,8 +11638,8 @@
|
|
|
11607
11638
|
|
|
11608
11639
|
const idleTask = new IdleTask();
|
|
11609
11640
|
class Dep extends BaseService {
|
|
11610
|
-
watcher = new
|
|
11611
|
-
removeTargets(type =
|
|
11641
|
+
watcher = new core.Watcher({ initialTargets: vue.reactive({}) });
|
|
11642
|
+
removeTargets(type = core.DepTargetType.DEFAULT) {
|
|
11612
11643
|
this.watcher.removeTargets(type);
|
|
11613
11644
|
const targets = this.watcher.getTargets(type);
|
|
11614
11645
|
if (!targets) return;
|
|
@@ -11616,17 +11647,17 @@
|
|
|
11616
11647
|
this.emit("remove-target", target.id);
|
|
11617
11648
|
}
|
|
11618
11649
|
}
|
|
11619
|
-
getTargets(type =
|
|
11650
|
+
getTargets(type = core.DepTargetType.DEFAULT) {
|
|
11620
11651
|
return this.watcher.getTargets(type);
|
|
11621
11652
|
}
|
|
11622
|
-
getTarget(id, type =
|
|
11653
|
+
getTarget(id, type = core.DepTargetType.DEFAULT) {
|
|
11623
11654
|
return this.watcher.getTarget(id, type);
|
|
11624
11655
|
}
|
|
11625
11656
|
addTarget(target) {
|
|
11626
11657
|
this.watcher.addTarget(target);
|
|
11627
11658
|
this.emit("add-target", target);
|
|
11628
11659
|
}
|
|
11629
|
-
removeTarget(id, type =
|
|
11660
|
+
removeTarget(id, type = core.DepTargetType.DEFAULT) {
|
|
11630
11661
|
this.watcher.removeTarget(id, type);
|
|
11631
11662
|
this.emit("remove-target", id);
|
|
11632
11663
|
}
|
|
@@ -11674,10 +11705,10 @@
|
|
|
11674
11705
|
clearByType(type, nodes) {
|
|
11675
11706
|
return this.watcher.clearByType(type, nodes);
|
|
11676
11707
|
}
|
|
11677
|
-
hasTarget(id, type =
|
|
11708
|
+
hasTarget(id, type = core.DepTargetType.DEFAULT) {
|
|
11678
11709
|
return this.watcher.hasTarget(id, type);
|
|
11679
11710
|
}
|
|
11680
|
-
hasSpecifiedTypeTarget(type =
|
|
11711
|
+
hasSpecifiedTypeTarget(type = core.DepTargetType.DEFAULT) {
|
|
11681
11712
|
return this.watcher.hasSpecifiedTypeTarget(type);
|
|
11682
11713
|
}
|
|
11683
11714
|
on(eventName, listener) {
|
|
@@ -11965,6 +11996,10 @@
|
|
|
11965
11996
|
const subStage = this.get("stage");
|
|
11966
11997
|
const wrapDiv = this.get("wrapDiv");
|
|
11967
11998
|
subStage?.destroy();
|
|
11999
|
+
for (let i = 0, l = wrapDiv.children.length; i < l; i++) {
|
|
12000
|
+
const child = wrapDiv.children[i];
|
|
12001
|
+
child.remove();
|
|
12002
|
+
}
|
|
11968
12003
|
wrapDiv.remove();
|
|
11969
12004
|
this.set("stage", null);
|
|
11970
12005
|
this.set("sourceEl", null);
|
|
@@ -11990,7 +12025,7 @@
|
|
|
11990
12025
|
autoScrollIntoView: false,
|
|
11991
12026
|
render: async (stage) => {
|
|
11992
12027
|
this.copyDocumentElement();
|
|
11993
|
-
const rootEls = stage.renderer
|
|
12028
|
+
const rootEls = stage.renderer?.getDocument()?.body.children;
|
|
11994
12029
|
if (rootEls) {
|
|
11995
12030
|
Array.from(rootEls).forEach((element) => {
|
|
11996
12031
|
if (["SCRIPT", "STYLE"].includes(element.tagName)) {
|
|
@@ -12019,8 +12054,8 @@
|
|
|
12019
12054
|
copyDocumentElement() {
|
|
12020
12055
|
const subStage = this.get("stage");
|
|
12021
12056
|
const stage = editorService.get("stage");
|
|
12022
|
-
const doc = subStage?.renderer
|
|
12023
|
-
const documentElement = stage?.renderer
|
|
12057
|
+
const doc = subStage?.renderer?.getDocument();
|
|
12058
|
+
const documentElement = stage?.renderer?.getDocument()?.documentElement;
|
|
12024
12059
|
if (doc && documentElement) {
|
|
12025
12060
|
doc.replaceChild(documentElement.cloneNode(true), doc.documentElement);
|
|
12026
12061
|
}
|
|
@@ -12038,12 +12073,13 @@
|
|
|
12038
12073
|
height: ${sourceEl?.scrollHeight}px;
|
|
12039
12074
|
background-color: #fff;
|
|
12040
12075
|
`;
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12076
|
+
for (let i = 0, l = wrapDiv.children.length; i < l; i++) {
|
|
12077
|
+
const child = wrapDiv.children[i];
|
|
12078
|
+
child.remove();
|
|
12079
|
+
}
|
|
12044
12080
|
wrapDiv.appendChild(contentEl);
|
|
12045
12081
|
setTimeout(() => {
|
|
12046
|
-
subStage?.renderer
|
|
12082
|
+
subStage?.renderer?.contentWindow?.magic.onPageElUpdate(wrapDiv);
|
|
12047
12083
|
});
|
|
12048
12084
|
if (await stageOptions?.canSelect?.(contentEl)) {
|
|
12049
12085
|
const id = utils.getIdFromEl()(contentEl);
|
|
@@ -12249,9 +12285,9 @@
|
|
|
12249
12285
|
value.dataSources = value.dataSources || [];
|
|
12250
12286
|
codeBlockService.setCodeDsl(value.codeBlocks);
|
|
12251
12287
|
dataSourceService.set("dataSources", value.dataSources);
|
|
12252
|
-
depService.removeTargets(
|
|
12288
|
+
depService.removeTargets(core.DepTargetType.CODE_BLOCK);
|
|
12253
12289
|
Object.entries(value.codeBlocks).forEach(([id, code]) => {
|
|
12254
|
-
depService.addTarget(
|
|
12290
|
+
depService.addTarget(core.createCodeBlockTarget(id, code));
|
|
12255
12291
|
});
|
|
12256
12292
|
dataSourceService.get("dataSources").forEach((ds) => {
|
|
12257
12293
|
initDataSourceDepTarget(ds);
|
|
@@ -12283,7 +12319,7 @@
|
|
|
12283
12319
|
};
|
|
12284
12320
|
const getApp = () => {
|
|
12285
12321
|
const stage = editorService.get("stage");
|
|
12286
|
-
return stage?.renderer
|
|
12322
|
+
return stage?.renderer?.runtime?.getApp?.();
|
|
12287
12323
|
};
|
|
12288
12324
|
const updateDataSourceSchema = () => {
|
|
12289
12325
|
const root = editorService.get("root");
|
|
@@ -12294,13 +12330,13 @@
|
|
|
12294
12330
|
const targetAddHandler = (target) => {
|
|
12295
12331
|
const root = editorService.get("root");
|
|
12296
12332
|
if (!root) return;
|
|
12297
|
-
if (target.type ===
|
|
12333
|
+
if (target.type === core.DepTargetType.DATA_SOURCE) {
|
|
12298
12334
|
if (!root.dataSourceDeps) {
|
|
12299
12335
|
root.dataSourceDeps = {};
|
|
12300
12336
|
}
|
|
12301
12337
|
root.dataSourceDeps[target.id] = target.deps;
|
|
12302
12338
|
}
|
|
12303
|
-
if (target.type ===
|
|
12339
|
+
if (target.type === core.DepTargetType.DATA_SOURCE_COND) {
|
|
12304
12340
|
if (!root.dataSourceCondDeps) {
|
|
12305
12341
|
root.dataSourceCondDeps = {};
|
|
12306
12342
|
}
|
|
@@ -12316,7 +12352,7 @@
|
|
|
12316
12352
|
delete root.dataSourceCondDeps[id];
|
|
12317
12353
|
}
|
|
12318
12354
|
};
|
|
12319
|
-
const collectedHandler = (nodes, deep) => {
|
|
12355
|
+
const collectedHandler = lodashEs.debounce((nodes, deep) => {
|
|
12320
12356
|
const root = editorService.get("root");
|
|
12321
12357
|
const stage = editorService.get("stage");
|
|
12322
12358
|
if (!root || !stage) return;
|
|
@@ -12331,7 +12367,7 @@
|
|
|
12331
12367
|
const allNodes = [];
|
|
12332
12368
|
if (deep) {
|
|
12333
12369
|
nodes.forEach((node) => {
|
|
12334
|
-
traverseNode(node, (node2) => {
|
|
12370
|
+
utils.traverseNode(node, (node2) => {
|
|
12335
12371
|
if (!allNodes.includes(node2)) {
|
|
12336
12372
|
allNodes.push(node2);
|
|
12337
12373
|
}
|
|
@@ -12351,14 +12387,14 @@
|
|
|
12351
12387
|
});
|
|
12352
12388
|
});
|
|
12353
12389
|
});
|
|
12354
|
-
};
|
|
12390
|
+
}, 300);
|
|
12355
12391
|
depService.on("add-target", targetAddHandler);
|
|
12356
12392
|
depService.on("remove-target", targetRemoveHandler);
|
|
12357
12393
|
depService.on("collected", collectedHandler);
|
|
12358
12394
|
const initDataSourceDepTarget = (ds) => {
|
|
12359
|
-
depService.addTarget(
|
|
12360
|
-
depService.addTarget(
|
|
12361
|
-
depService.addTarget(
|
|
12395
|
+
depService.addTarget(core.createDataSourceTarget(ds, vue.reactive({})));
|
|
12396
|
+
depService.addTarget(core.createDataSourceMethodTarget(ds, vue.reactive({})));
|
|
12397
|
+
depService.addTarget(core.createDataSourceCondTarget(ds, vue.reactive({})));
|
|
12362
12398
|
};
|
|
12363
12399
|
const collectIdle = (nodes, deep) => {
|
|
12364
12400
|
nodes.forEach((node) => {
|
|
@@ -12390,14 +12426,14 @@
|
|
|
12390
12426
|
editorService.on("remove", nodeRemoveHandler);
|
|
12391
12427
|
editorService.on("update", nodeUpdateHandler);
|
|
12392
12428
|
const codeBlockAddOrUpdateHandler = (id, codeBlock) => {
|
|
12393
|
-
if (depService.hasTarget(id,
|
|
12394
|
-
depService.getTarget(id,
|
|
12429
|
+
if (depService.hasTarget(id, core.DepTargetType.CODE_BLOCK)) {
|
|
12430
|
+
depService.getTarget(id, core.DepTargetType.CODE_BLOCK).name = codeBlock.name;
|
|
12395
12431
|
return;
|
|
12396
12432
|
}
|
|
12397
|
-
depService.addTarget(
|
|
12433
|
+
depService.addTarget(core.createCodeBlockTarget(id, codeBlock));
|
|
12398
12434
|
};
|
|
12399
12435
|
const codeBlockRemoveHandler = (id) => {
|
|
12400
|
-
depService.removeTarget(id,
|
|
12436
|
+
depService.removeTarget(id, core.DepTargetType.CODE_BLOCK);
|
|
12401
12437
|
};
|
|
12402
12438
|
codeBlockService.on("addOrUpdate", codeBlockAddOrUpdateHandler);
|
|
12403
12439
|
codeBlockService.on("remove", codeBlockRemoveHandler);
|
|
@@ -12412,9 +12448,9 @@
|
|
|
12412
12448
|
collectIdle(root?.items || [], true);
|
|
12413
12449
|
};
|
|
12414
12450
|
const removeDataSourceTarget = (id) => {
|
|
12415
|
-
depService.removeTarget(id,
|
|
12416
|
-
depService.removeTarget(id,
|
|
12417
|
-
depService.removeTarget(id,
|
|
12451
|
+
depService.removeTarget(id, core.DepTargetType.DATA_SOURCE);
|
|
12452
|
+
depService.removeTarget(id, core.DepTargetType.DATA_SOURCE_COND);
|
|
12453
|
+
depService.removeTarget(id, core.DepTargetType.DATA_SOURCE_METHOD);
|
|
12418
12454
|
};
|
|
12419
12455
|
const dataSourceRemoveHandler = (id) => {
|
|
12420
12456
|
removeDataSourceTarget(id);
|
|
@@ -12475,6 +12511,8 @@
|
|
|
12475
12511
|
disabledPageFragment: { type: Boolean },
|
|
12476
12512
|
disabledStageOverlay: { type: Boolean },
|
|
12477
12513
|
disabledShowSrc: { type: Boolean },
|
|
12514
|
+
treeIndent: {},
|
|
12515
|
+
treeNextLevelIndentIncrement: {},
|
|
12478
12516
|
render: { type: Function },
|
|
12479
12517
|
updateDragEl: { type: Function },
|
|
12480
12518
|
canSelect: { type: Function },
|
|
@@ -12551,7 +12589,9 @@
|
|
|
12551
12589
|
vue.createVNode(_sfc_main$a, {
|
|
12552
12590
|
data: _ctx.sidebar,
|
|
12553
12591
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
12554
|
-
"custom-content-menu": _ctx.customContentMenu
|
|
12592
|
+
"custom-content-menu": _ctx.customContentMenu,
|
|
12593
|
+
indent: _ctx.treeIndent,
|
|
12594
|
+
"next-level-indent-increment": _ctx.treeNextLevelIndentIncrement
|
|
12555
12595
|
}, {
|
|
12556
12596
|
"layer-panel-header": vue.withCtx(() => [
|
|
12557
12597
|
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
@@ -12593,7 +12633,7 @@
|
|
|
12593
12633
|
vue.renderSlot(_ctx.$slots, "data-source-panel-search")
|
|
12594
12634
|
]),
|
|
12595
12635
|
_: 3
|
|
12596
|
-
}, 8, ["data", "layer-content-menu", "custom-content-menu"])
|
|
12636
|
+
}, 8, ["data", "layer-content-menu", "custom-content-menu", "indent", "next-level-indent-increment"])
|
|
12597
12637
|
])
|
|
12598
12638
|
]),
|
|
12599
12639
|
workspace: vue.withCtx(() => [
|
|
@@ -12663,8 +12703,11 @@
|
|
|
12663
12703
|
const index = {
|
|
12664
12704
|
install: (app, opt) => {
|
|
12665
12705
|
const option = Object.assign(defaultInstallOpt, opt || {});
|
|
12706
|
+
app.use(designPlugin, opt || {});
|
|
12707
|
+
app.use(formPlugin, opt || {});
|
|
12708
|
+
app.use(tablePlugin);
|
|
12666
12709
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
12667
|
-
|
|
12710
|
+
setEditorConfig(option);
|
|
12668
12711
|
app.component(`${_sfc_main.name || "MEditor"}`, _sfc_main);
|
|
12669
12712
|
app.component("magic-code-editor", _sfc_main$X);
|
|
12670
12713
|
app.component("m-fields-ui-select", _sfc_main$B);
|
|
@@ -12687,10 +12730,14 @@
|
|
|
12687
12730
|
}
|
|
12688
12731
|
};
|
|
12689
12732
|
|
|
12733
|
+
exports.designPlugin = designPlugin;
|
|
12734
|
+
exports.formPlugin = formPlugin;
|
|
12735
|
+
exports.tablePlugin = tablePlugin;
|
|
12690
12736
|
Object.defineProperty(exports, "DepTargetType", {
|
|
12691
12737
|
enumerable: true,
|
|
12692
|
-
get: () =>
|
|
12738
|
+
get: () => core.DepTargetType
|
|
12693
12739
|
});
|
|
12740
|
+
exports.StageCore = StageCore;
|
|
12694
12741
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
12695
12742
|
exports.COPY_CODE_STORAGE_KEY = COPY_CODE_STORAGE_KEY;
|
|
12696
12743
|
exports.COPY_DS_STORAGE_KEY = COPY_DS_STORAGE_KEY;
|
|
@@ -12764,9 +12811,9 @@
|
|
|
12764
12811
|
exports.generatePageNameByApp = generatePageNameByApp;
|
|
12765
12812
|
exports.getAddParent = getAddParent;
|
|
12766
12813
|
exports.getCascaderOptionsFromFields = getCascaderOptionsFromFields;
|
|
12767
|
-
exports.getConfig = getConfig;
|
|
12768
12814
|
exports.getDefaultConfig = getDefaultConfig;
|
|
12769
12815
|
exports.getDisplayField = getDisplayField;
|
|
12816
|
+
exports.getEditorConfig = getEditorConfig;
|
|
12770
12817
|
exports.getFormConfig = getFormConfig;
|
|
12771
12818
|
exports.getFormValue = getFormValue;
|
|
12772
12819
|
exports.getGuideLineFromCache = getGuideLineFromCache;
|
|
@@ -12779,7 +12826,6 @@
|
|
|
12779
12826
|
exports.getRelativeStyle = getRelativeStyle;
|
|
12780
12827
|
exports.historyService = historyService;
|
|
12781
12828
|
exports.info = info;
|
|
12782
|
-
exports.isFixed = isFixed;
|
|
12783
12829
|
exports.log = log;
|
|
12784
12830
|
exports.moveItemsInContainer = moveItemsInContainer;
|
|
12785
12831
|
exports.numberOptions = numberOptions;
|
|
@@ -12787,12 +12833,11 @@
|
|
|
12787
12833
|
exports.removeDataSourceFieldPrefix = removeDataSourceFieldPrefix;
|
|
12788
12834
|
exports.serializeConfig = serializeConfig;
|
|
12789
12835
|
exports.setChildrenLayout = setChildrenLayout;
|
|
12790
|
-
exports.
|
|
12836
|
+
exports.setEditorConfig = setEditorConfig;
|
|
12791
12837
|
exports.setLayout = setLayout;
|
|
12792
12838
|
exports.stageOverlayService = stageOverlayService;
|
|
12793
12839
|
exports.storageService = storageService;
|
|
12794
12840
|
exports.styleTabConfig = styleTabConfig;
|
|
12795
|
-
exports.traverseNode = traverseNode;
|
|
12796
12841
|
exports.uiService = uiService;
|
|
12797
12842
|
exports.updateStatus = updateStatus;
|
|
12798
12843
|
exports.useCodeBlockEdit = useCodeBlockEdit;
|
|
@@ -12806,6 +12851,36 @@
|
|
|
12806
12851
|
exports.useStage = useStage;
|
|
12807
12852
|
exports.useWindowRect = useWindowRect;
|
|
12808
12853
|
exports.warn = warn;
|
|
12854
|
+
Object.keys(designPlugin).forEach(k => {
|
|
12855
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12856
|
+
enumerable: true,
|
|
12857
|
+
get: () => designPlugin[k]
|
|
12858
|
+
});
|
|
12859
|
+
});
|
|
12860
|
+
Object.keys(formPlugin).forEach(k => {
|
|
12861
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12862
|
+
enumerable: true,
|
|
12863
|
+
get: () => formPlugin[k]
|
|
12864
|
+
});
|
|
12865
|
+
});
|
|
12866
|
+
Object.keys(tablePlugin).forEach(k => {
|
|
12867
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12868
|
+
enumerable: true,
|
|
12869
|
+
get: () => tablePlugin[k]
|
|
12870
|
+
});
|
|
12871
|
+
});
|
|
12872
|
+
Object.keys(utils).forEach(k => {
|
|
12873
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12874
|
+
enumerable: true,
|
|
12875
|
+
get: () => utils[k]
|
|
12876
|
+
});
|
|
12877
|
+
});
|
|
12878
|
+
Object.keys(StageCore).forEach(k => {
|
|
12879
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12880
|
+
enumerable: true,
|
|
12881
|
+
get: () => StageCore[k]
|
|
12882
|
+
});
|
|
12883
|
+
});
|
|
12809
12884
|
|
|
12810
12885
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
12811
12886
|
|