@tmagic/editor 1.5.0-beta.3 → 1.5.0-beta.5
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 +274 -2
- package/dist/tmagic-editor.js +103 -46
- package/dist/tmagic-editor.umd.cjs +325 -242
- package/package.json +7 -9
- package/src/Editor.vue +8 -2
- 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 +5 -2
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- package/src/hooks/use-node-status.ts +1 -1
- package/src/hooks/use-stage.ts +2 -6
- package/src/index.ts +27 -7
- package/src/initService.ts +11 -3
- 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 +1 -1
- package/src/layouts/page-bar/PageBarScrollContainer.vue +1 -1
- package/src/layouts/page-bar/PageList.vue +1 -1
- package/src/layouts/page-bar/SwitchTypeButton.vue +1 -1
- package/src/layouts/sidebar/Sidebar.vue +12 -0
- 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 +12 -1
- 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 +1 -1
- package/src/layouts/workspace/Breadcrumb.vue +1 -1
- package/src/layouts/workspace/viewer/NodeListMenu.vue +1 -1
- package/src/layouts/workspace/viewer/Stage.vue +7 -3
- package/src/layouts/workspace/viewer/StageOverlay.vue +6 -1
- 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 +7 -8
- package/src/services/history.ts +1 -1
- package/src/services/props.ts +3 -3
- package/src/services/storage.ts +2 -2
- package/src/theme/index.scss +3 -0
- package/src/type.ts +13 -10
- package/src/utils/config.ts +5 -5
- package/src/utils/content-menu.ts +1 -1
- package/src/utils/data-source/index.ts +1 -1
- package/src/utils/editor.ts +2 -8
- 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 +53 -29
|
@@ -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}`);
|
|
@@ -1475,10 +1474,10 @@
|
|
|
1475
1474
|
replaceRelateId(originConfigs, targetConfigs, collectorOptions) {
|
|
1476
1475
|
const relateIdMap = this.getRelateIdMap();
|
|
1477
1476
|
if (Object.keys(relateIdMap).length === 0) return;
|
|
1478
|
-
const target = new
|
|
1477
|
+
const target = new core.Target({
|
|
1479
1478
|
...collectorOptions
|
|
1480
1479
|
});
|
|
1481
|
-
const coperWatcher = new
|
|
1480
|
+
const coperWatcher = new core.Watcher();
|
|
1482
1481
|
coperWatcher.addTarget(target);
|
|
1483
1482
|
coperWatcher.collect(originConfigs, {}, true, collectorOptions.type);
|
|
1484
1483
|
originConfigs.forEach((config) => {
|
|
@@ -1710,7 +1709,7 @@
|
|
|
1710
1709
|
if (item === null) return null;
|
|
1711
1710
|
switch (protocol) {
|
|
1712
1711
|
case "object" /* OBJECT */:
|
|
1713
|
-
return
|
|
1712
|
+
return getEditorConfig("parseDSL")(`(${item})`);
|
|
1714
1713
|
case "json" /* JSON */:
|
|
1715
1714
|
return JSON.parse(item);
|
|
1716
1715
|
case "number" /* NUMBER */:
|
|
@@ -1922,7 +1921,7 @@
|
|
|
1922
1921
|
* 只有容器拥有布局
|
|
1923
1922
|
*/
|
|
1924
1923
|
async getLayout(parent, node) {
|
|
1925
|
-
if (node && typeof node !== "function" && isFixed(node)) return Layout.FIXED;
|
|
1924
|
+
if (node && typeof node !== "function" && StageCore.isFixed(node.style || {})) return Layout.FIXED;
|
|
1926
1925
|
if (parent.layout) {
|
|
1927
1926
|
return parent.layout;
|
|
1928
1927
|
}
|
|
@@ -1962,7 +1961,7 @@
|
|
|
1962
1961
|
}
|
|
1963
1962
|
async selectNextNode() {
|
|
1964
1963
|
const node = vue.toRaw(this.get("node"));
|
|
1965
|
-
if (!node || utils.isPage(node) || node.type ===
|
|
1964
|
+
if (!node || utils.isPage(node) || node.type === core.NodeType.ROOT) return node;
|
|
1966
1965
|
const parent = vue.toRaw(this.getParentById(node.id));
|
|
1967
1966
|
if (!parent) return node;
|
|
1968
1967
|
const index = getNodeIndex(node.id, parent);
|
|
@@ -2023,7 +2022,7 @@
|
|
|
2023
2022
|
const curNode = this.get("node");
|
|
2024
2023
|
const stage = this.get("stage");
|
|
2025
2024
|
if (!curNode) throw new Error("当前选中节点为空");
|
|
2026
|
-
if ((parent.type ===
|
|
2025
|
+
if ((parent.type === core.NodeType.ROOT || curNode?.type === core.NodeType.ROOT) && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
2027
2026
|
throw new Error("app下不能添加组件");
|
|
2028
2027
|
}
|
|
2029
2028
|
if (parent.id !== curNode.id && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
@@ -2163,7 +2162,7 @@
|
|
|
2163
2162
|
}
|
|
2164
2163
|
});
|
|
2165
2164
|
if (!newConfig.type) throw new Error("配置缺少type值");
|
|
2166
|
-
if (newConfig.type ===
|
|
2165
|
+
if (newConfig.type === core.NodeType.ROOT) {
|
|
2167
2166
|
this.set("root", newConfig);
|
|
2168
2167
|
return newConfig;
|
|
2169
2168
|
}
|
|
@@ -2201,7 +2200,7 @@
|
|
|
2201
2200
|
async update(config) {
|
|
2202
2201
|
const nodes = Array.isArray(config) ? config : [config];
|
|
2203
2202
|
const newNodes = await Promise.all(nodes.map((node) => this.doUpdate(node)));
|
|
2204
|
-
if (newNodes[0]?.type !==
|
|
2203
|
+
if (newNodes[0]?.type !== core.NodeType.ROOT) {
|
|
2205
2204
|
this.pushHistoryState();
|
|
2206
2205
|
}
|
|
2207
2206
|
this.emit("update", newNodes);
|
|
@@ -2252,10 +2251,10 @@
|
|
|
2252
2251
|
copyWithRelated(config, collectorOptions) {
|
|
2253
2252
|
const copyNodes = Array.isArray(config) ? config : [config];
|
|
2254
2253
|
if (collectorOptions && typeof collectorOptions.isTarget === "function") {
|
|
2255
|
-
const customTarget = new
|
|
2254
|
+
const customTarget = new core.Target({
|
|
2256
2255
|
...collectorOptions
|
|
2257
2256
|
});
|
|
2258
|
-
const coperWatcher = new
|
|
2257
|
+
const coperWatcher = new core.Watcher();
|
|
2259
2258
|
coperWatcher.addTarget(customTarget);
|
|
2260
2259
|
coperWatcher.collect(copyNodes, {}, true, collectorOptions.type);
|
|
2261
2260
|
Object.keys(customTarget.deps).forEach((nodeId) => {
|
|
@@ -2289,7 +2288,7 @@
|
|
|
2289
2288
|
let parent = null;
|
|
2290
2289
|
if (config.length === 1 && config[0].id === node?.id) {
|
|
2291
2290
|
parent = this.get("parent");
|
|
2292
|
-
if (parent?.type ===
|
|
2291
|
+
if (parent?.type === core.NodeType.ROOT) {
|
|
2293
2292
|
parent = this.get("page");
|
|
2294
2293
|
}
|
|
2295
2294
|
}
|
|
@@ -2590,9 +2589,9 @@
|
|
|
2590
2589
|
async toggleFixedPosition(dist, src, root) {
|
|
2591
2590
|
const newConfig = lodashEs.cloneDeep(dist);
|
|
2592
2591
|
if (!utils.isPop(src) && newConfig.style?.position) {
|
|
2593
|
-
if (isFixed(newConfig) && !isFixed(src)) {
|
|
2592
|
+
if (StageCore.isFixed(newConfig.style) && !StageCore.isFixed(src.style || {})) {
|
|
2594
2593
|
newConfig.style = change2Fixed(newConfig, root);
|
|
2595
|
-
} else if (!isFixed(newConfig) && isFixed(src)) {
|
|
2594
|
+
} else if (!StageCore.isFixed(newConfig.style) && StageCore.isFixed(src.style || {})) {
|
|
2596
2595
|
newConfig.style = await Fixed2Other(newConfig, root, this.getLayout);
|
|
2597
2596
|
}
|
|
2598
2597
|
}
|
|
@@ -2654,7 +2653,7 @@
|
|
|
2654
2653
|
}
|
|
2655
2654
|
const root = editorService.get("root");
|
|
2656
2655
|
if ((utils.isPage(pasteConfig) || utils.isPageFragment(pasteConfig)) && root) {
|
|
2657
|
-
pasteConfig.name = generatePageNameByApp(root, utils.isPage(pasteConfig) ?
|
|
2656
|
+
pasteConfig.name = generatePageNameByApp(root, utils.isPage(pasteConfig) ? core.NodeType.PAGE : core.NodeType.PAGE_FRAGMENT);
|
|
2658
2657
|
}
|
|
2659
2658
|
return pasteConfig;
|
|
2660
2659
|
});
|
|
@@ -3192,7 +3191,7 @@
|
|
|
3192
3191
|
setup(__props, { emit: __emit }) {
|
|
3193
3192
|
const props = __props;
|
|
3194
3193
|
const emit = __emit;
|
|
3195
|
-
const form
|
|
3194
|
+
const form = vue.ref();
|
|
3196
3195
|
const getFormConfig = (items = []) => [
|
|
3197
3196
|
{
|
|
3198
3197
|
type: "fieldset",
|
|
@@ -3215,16 +3214,16 @@
|
|
|
3215
3214
|
);
|
|
3216
3215
|
const onParamsChangeHandler = async () => {
|
|
3217
3216
|
try {
|
|
3218
|
-
const value = await form
|
|
3217
|
+
const value = await form.value?.submitForm(true);
|
|
3219
3218
|
emit("change", value);
|
|
3220
3219
|
} catch (e) {
|
|
3221
3220
|
error(e);
|
|
3222
3221
|
}
|
|
3223
3222
|
};
|
|
3224
3223
|
return (_ctx, _cache) => {
|
|
3225
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
3224
|
+
return vue.openBlock(), vue.createBlock(vue.unref(formPlugin.MForm), {
|
|
3226
3225
|
ref_key: "form",
|
|
3227
|
-
ref: form
|
|
3226
|
+
ref: form,
|
|
3228
3227
|
config: codeParamsConfig.value,
|
|
3229
3228
|
"init-values": _ctx.model,
|
|
3230
3229
|
disabled: _ctx.disabled,
|
|
@@ -3261,7 +3260,7 @@
|
|
|
3261
3260
|
const eventBus = vue.inject("eventBus");
|
|
3262
3261
|
const emit = __emit;
|
|
3263
3262
|
const props = __props;
|
|
3264
|
-
const notEditable = vue.computed(() =>
|
|
3263
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.config.notEditable, props));
|
|
3265
3264
|
const hasCodeBlockSidePanel = vue.computed(
|
|
3266
3265
|
() => (services?.uiService.get("sideBarItems") || []).find((item) => item.$key === SideItemKey.CODE_BLOCK)
|
|
3267
3266
|
);
|
|
@@ -3302,7 +3301,7 @@
|
|
|
3302
3301
|
onChange: (formState, codeId, { model }) => {
|
|
3303
3302
|
paramsConfig.value = getParamItemsConfig(codeId);
|
|
3304
3303
|
if (paramsConfig.value.length) {
|
|
3305
|
-
model.params =
|
|
3304
|
+
model.params = formPlugin.createValues(formState, paramsConfig.value, {}, model.params);
|
|
3306
3305
|
} else {
|
|
3307
3306
|
model.params = {};
|
|
3308
3307
|
}
|
|
@@ -3319,14 +3318,14 @@
|
|
|
3319
3318
|
return (_ctx, _cache) => {
|
|
3320
3319
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
|
|
3321
3320
|
vue.createElementVNode("div", _hoisted_2$j, [
|
|
3322
|
-
vue.createVNode(vue.unref(
|
|
3321
|
+
vue.createVNode(vue.unref(formPlugin.MContainer), {
|
|
3323
3322
|
class: "select",
|
|
3324
3323
|
config: selectConfig,
|
|
3325
3324
|
model: _ctx.model,
|
|
3326
3325
|
size: _ctx.size,
|
|
3327
3326
|
onChange: onParamsChangeHandler
|
|
3328
3327
|
}, null, 8, ["model", "size"]),
|
|
3329
|
-
_ctx.model[_ctx.name] && hasCodeBlockSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
3328
|
+
_ctx.model[_ctx.name] && hasCodeBlockSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
3330
3329
|
key: 0,
|
|
3331
3330
|
class: "m-fields-select-action-button",
|
|
3332
3331
|
size: _ctx.size,
|
|
@@ -3374,7 +3373,7 @@
|
|
|
3374
3373
|
const emit = __emit;
|
|
3375
3374
|
const { dataSourceService } = vue.inject("services") || {};
|
|
3376
3375
|
const props = __props;
|
|
3377
|
-
const optionComponent =
|
|
3376
|
+
const optionComponent = designPlugin.getDesignConfig("components")?.option;
|
|
3378
3377
|
const options = vue.computed(() => {
|
|
3379
3378
|
const [id, ...fieldNames] = [...props.config.parentFields || [], ...props.model.field];
|
|
3380
3379
|
const ds = dataSourceService?.getDataSourceById(id);
|
|
@@ -3406,7 +3405,7 @@
|
|
|
3406
3405
|
emit("change", v);
|
|
3407
3406
|
};
|
|
3408
3407
|
return (_ctx, _cache) => {
|
|
3409
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
3408
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicSelect), {
|
|
3410
3409
|
modelValue: _ctx.model[_ctx.name],
|
|
3411
3410
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3412
3411
|
clearable: "",
|
|
@@ -3461,7 +3460,7 @@
|
|
|
3461
3460
|
const props = __props;
|
|
3462
3461
|
const target = vue.ref();
|
|
3463
3462
|
const titleEl = vue.ref();
|
|
3464
|
-
const zIndex =
|
|
3463
|
+
const zIndex = designPlugin.useZIndex();
|
|
3465
3464
|
const curZIndex = vue.ref(0);
|
|
3466
3465
|
const titleHeight = vue.ref(0);
|
|
3467
3466
|
const bodyHeight = vue.computed(() => {
|
|
@@ -3588,7 +3587,7 @@
|
|
|
3588
3587
|
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.title), 1)
|
|
3589
3588
|
]),
|
|
3590
3589
|
vue.createElementVNode("div", null, [
|
|
3591
|
-
vue.createVNode(vue.unref(
|
|
3590
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
3592
3591
|
link: "",
|
|
3593
3592
|
size: "small",
|
|
3594
3593
|
onClick: closeHandler
|
|
@@ -3618,7 +3617,7 @@
|
|
|
3618
3617
|
const codeBlockEditor = vue.ref();
|
|
3619
3618
|
const createCodeBlock = async () => {
|
|
3620
3619
|
if (!codeBlockService) {
|
|
3621
|
-
|
|
3620
|
+
designPlugin.tMagicMessage.error("新增代码块失败");
|
|
3622
3621
|
return;
|
|
3623
3622
|
}
|
|
3624
3623
|
codeConfig.value = {
|
|
@@ -3635,7 +3634,7 @@
|
|
|
3635
3634
|
const editCode = async (id) => {
|
|
3636
3635
|
const codeBlock = await codeBlockService?.getCodeContentById(id);
|
|
3637
3636
|
if (!codeBlock) {
|
|
3638
|
-
|
|
3637
|
+
designPlugin.tMagicMessage.error("获取代码块内容失败");
|
|
3639
3638
|
return;
|
|
3640
3639
|
}
|
|
3641
3640
|
let codeContent = codeBlock.content;
|
|
@@ -3693,7 +3692,7 @@
|
|
|
3693
3692
|
editCode: async (model, methodName) => {
|
|
3694
3693
|
const method = model.methods?.find((method2) => method2.name === methodName);
|
|
3695
3694
|
if (!method) {
|
|
3696
|
-
|
|
3695
|
+
designPlugin.tMagicMessage.error("获取数据源方法失败");
|
|
3697
3696
|
return;
|
|
3698
3697
|
}
|
|
3699
3698
|
let codeContent = method.content || `({ params, dataSource, app }) => {
|
|
@@ -3725,7 +3724,7 @@
|
|
|
3725
3724
|
dataSource.value.methods = [];
|
|
3726
3725
|
}
|
|
3727
3726
|
if (values.content) {
|
|
3728
|
-
const parseDSL =
|
|
3727
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
3729
3728
|
if (typeof values.content === "string") {
|
|
3730
3729
|
values.content = parseDSL(values.content);
|
|
3731
3730
|
}
|
|
@@ -3944,9 +3943,6 @@
|
|
|
3944
3943
|
globalThis.localStorage.removeItem(storageKey);
|
|
3945
3944
|
}
|
|
3946
3945
|
});
|
|
3947
|
-
vue.onBeforeUnmount(() => {
|
|
3948
|
-
stage.destroy();
|
|
3949
|
-
});
|
|
3950
3946
|
return stage;
|
|
3951
3947
|
};
|
|
3952
3948
|
|
|
@@ -4283,7 +4279,7 @@
|
|
|
4283
4279
|
text: "删除",
|
|
4284
4280
|
buttonType: "danger",
|
|
4285
4281
|
handler: async (row, index) => {
|
|
4286
|
-
await
|
|
4282
|
+
await designPlugin.tMagicMessageBox.confirm(`确定删除${row.title}(${row.name})?`, "提示");
|
|
4287
4283
|
props.model[props.name].splice(index, 1);
|
|
4288
4284
|
emit("change", props.model[props.name]);
|
|
4289
4285
|
}
|
|
@@ -4435,7 +4431,7 @@
|
|
|
4435
4431
|
addFromJsonDialogVisible.value = false;
|
|
4436
4432
|
emit("change", props.model[props.name]);
|
|
4437
4433
|
} catch (e) {
|
|
4438
|
-
|
|
4434
|
+
designPlugin.tMagicMessage.error(e.message);
|
|
4439
4435
|
}
|
|
4440
4436
|
};
|
|
4441
4437
|
const addDialogVisible = vue.useModel(__props, "visible");
|
|
@@ -4445,12 +4441,12 @@
|
|
|
4445
4441
|
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
4446
4442
|
return (_ctx, _cache) => {
|
|
4447
4443
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, [
|
|
4448
|
-
vue.createVNode(vue.unref(
|
|
4444
|
+
vue.createVNode(vue.unref(tablePlugin.MagicTable), {
|
|
4449
4445
|
data: _ctx.model[_ctx.name],
|
|
4450
4446
|
columns: fieldColumns
|
|
4451
4447
|
}, null, 8, ["data"]),
|
|
4452
4448
|
vue.createElementVNode("div", _hoisted_2$i, [
|
|
4453
|
-
vue.createVNode(vue.unref(
|
|
4449
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4454
4450
|
size: "small",
|
|
4455
4451
|
disabled: _ctx.disabled,
|
|
4456
4452
|
plain: "",
|
|
@@ -4461,7 +4457,7 @@
|
|
|
4461
4457
|
]),
|
|
4462
4458
|
_: 1
|
|
4463
4459
|
}, 8, ["disabled"]),
|
|
4464
|
-
vue.createVNode(vue.unref(
|
|
4460
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4465
4461
|
size: "small",
|
|
4466
4462
|
type: "primary",
|
|
4467
4463
|
disabled: _ctx.disabled,
|
|
@@ -4485,7 +4481,7 @@
|
|
|
4485
4481
|
position: vue.unref(boxPosition)
|
|
4486
4482
|
}, {
|
|
4487
4483
|
body: vue.withCtx(() => [
|
|
4488
|
-
vue.createVNode(vue.unref(
|
|
4484
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
4489
4485
|
"label-width": "80px",
|
|
4490
4486
|
title: fieldTitle.value,
|
|
4491
4487
|
config: dataSourceFieldsConfig,
|
|
@@ -4508,7 +4504,7 @@
|
|
|
4508
4504
|
position: vue.unref(boxPosition)
|
|
4509
4505
|
}, {
|
|
4510
4506
|
body: vue.withCtx(() => [
|
|
4511
|
-
vue.createVNode(vue.unref(
|
|
4507
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
4512
4508
|
config: jsonFromConfig,
|
|
4513
4509
|
values: jsonFromValues.value,
|
|
4514
4510
|
disabled: _ctx.disabled,
|
|
@@ -4541,13 +4537,13 @@
|
|
|
4541
4537
|
const props = __props;
|
|
4542
4538
|
const emit = __emit;
|
|
4543
4539
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
4544
|
-
const optionComponent =
|
|
4540
|
+
const optionComponent = designPlugin.getDesignConfig("components")?.option;
|
|
4545
4541
|
const services = vue.inject("services");
|
|
4546
4542
|
const mForm = vue.inject("mForm");
|
|
4547
4543
|
const eventBus = vue.inject("eventBus");
|
|
4548
4544
|
const dataSources = vue.computed(() => services?.dataSourceService.get("dataSources") || []);
|
|
4549
4545
|
const valueIsKey = vue.computed(() => props.value === "key");
|
|
4550
|
-
const notEditable = vue.computed(() =>
|
|
4546
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.notEditable, props));
|
|
4551
4547
|
const dataSourcesOptions = vue.computed(
|
|
4552
4548
|
() => dataSources.value.map((ds) => ({
|
|
4553
4549
|
text: ds.title || ds.id,
|
|
@@ -4606,7 +4602,7 @@
|
|
|
4606
4602
|
return (_ctx, _cache) => {
|
|
4607
4603
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$s, [
|
|
4608
4604
|
_ctx.checkStrictly ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
4609
|
-
vue.createVNode(vue.unref(
|
|
4605
|
+
vue.createVNode(vue.unref(designPlugin.TMagicSelect), {
|
|
4610
4606
|
"model-value": selectDataSourceId.value,
|
|
4611
4607
|
clearable: "",
|
|
4612
4608
|
filterable: "",
|
|
@@ -4636,7 +4632,7 @@
|
|
|
4636
4632
|
]),
|
|
4637
4633
|
_: 1
|
|
4638
4634
|
}, 8, ["model-value", "size", "disabled"]),
|
|
4639
|
-
vue.createVNode(vue.unref(
|
|
4635
|
+
vue.createVNode(vue.unref(designPlugin.TMagicCascader), {
|
|
4640
4636
|
"model-value": selectFieldsId.value,
|
|
4641
4637
|
clearable: "",
|
|
4642
4638
|
filterable: "",
|
|
@@ -4648,7 +4644,7 @@
|
|
|
4648
4644
|
},
|
|
4649
4645
|
onChange: fieldChangeHandler
|
|
4650
4646
|
}, null, 8, ["model-value", "size", "disabled", "options", "props"])
|
|
4651
|
-
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(
|
|
4647
|
+
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicCascader), {
|
|
4652
4648
|
key: 1,
|
|
4653
4649
|
clearable: "",
|
|
4654
4650
|
filterable: "",
|
|
@@ -4661,12 +4657,12 @@
|
|
|
4661
4657
|
},
|
|
4662
4658
|
onChange: onChangeHandler
|
|
4663
4659
|
}, null, 8, ["model-value", "disabled", "size", "options", "props"])),
|
|
4664
|
-
selectDataSourceId.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
4660
|
+
selectDataSourceId.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
4665
4661
|
key: 2,
|
|
4666
4662
|
content: notEditable.value ? "查看" : "编辑"
|
|
4667
4663
|
}, {
|
|
4668
4664
|
default: vue.withCtx(() => [
|
|
4669
|
-
vue.createVNode(vue.unref(
|
|
4665
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4670
4666
|
class: "m-fields-select-action-button",
|
|
4671
4667
|
size: _ctx.size,
|
|
4672
4668
|
onClick: _cache[0] || (_cache[0] = ($event) => editHandler(selectDataSourceId.value))
|
|
@@ -4783,7 +4779,7 @@
|
|
|
4783
4779
|
if (!keys.length || field?.type && (field.type === "any" || dataSourceFieldType.includes("any") || dataSourceFieldType.includes(field.type))) {
|
|
4784
4780
|
emit("change", value);
|
|
4785
4781
|
} else {
|
|
4786
|
-
|
|
4782
|
+
designPlugin.tMagicMessage.error(`请选择类型为${dataSourceFieldType.join("或")}的字段`);
|
|
4787
4783
|
emit("change", [dsId]);
|
|
4788
4784
|
}
|
|
4789
4785
|
};
|
|
@@ -4811,13 +4807,13 @@
|
|
|
4811
4807
|
prop: _ctx.prop,
|
|
4812
4808
|
onChange: onChangeHandler
|
|
4813
4809
|
}, null, 40, ["config", "model", "name", "disabled", "size", "last-values", "init-values", "values", "prop"])),
|
|
4814
|
-
_ctx.config.fieldConfig ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
4810
|
+
_ctx.config.fieldConfig ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
4815
4811
|
key: 2,
|
|
4816
4812
|
disabled: showDataSourceFieldSelect.value,
|
|
4817
4813
|
content: "选择数据源"
|
|
4818
4814
|
}, {
|
|
4819
4815
|
default: vue.withCtx(() => [
|
|
4820
|
-
vue.createVNode(vue.unref(
|
|
4816
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
4821
4817
|
style: { "margin-left": "5px" },
|
|
4822
4818
|
type: showDataSourceFieldSelect.value ? "primary" : "default",
|
|
4823
4819
|
size: _ctx.size,
|
|
@@ -5015,7 +5011,7 @@
|
|
|
5015
5011
|
changeHandler(state.value);
|
|
5016
5012
|
};
|
|
5017
5013
|
return (_ctx, _cache) => {
|
|
5018
|
-
return _ctx.disabled || isFocused.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(
|
|
5014
|
+
return _ctx.disabled || isFocused.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(designPlugin.getDesignConfig)("components")?.autocomplete.component || "el-autocomplete"), vue.mergeProps(
|
|
5019
5015
|
{
|
|
5020
5016
|
key: 0,
|
|
5021
5017
|
class: "tmagic-design-auto-complete",
|
|
@@ -5024,7 +5020,7 @@
|
|
|
5024
5020
|
modelValue: state.value,
|
|
5025
5021
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
|
|
5026
5022
|
},
|
|
5027
|
-
vue.unref(
|
|
5023
|
+
vue.unref(designPlugin.getDesignConfig)("components")?.autocomplete.props({
|
|
5028
5024
|
disabled: _ctx.disabled,
|
|
5029
5025
|
size: _ctx.size,
|
|
5030
5026
|
fetchSuggestions: querySearch,
|
|
@@ -5063,7 +5059,7 @@
|
|
|
5063
5059
|
key: index,
|
|
5064
5060
|
style: { "margin-right": "2px" }
|
|
5065
5061
|
}, vue.toDisplayString(item.value), 1)) : vue.createCommentVNode("", true),
|
|
5066
|
-
item.type === "var" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5062
|
+
item.type === "var" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTag), {
|
|
5067
5063
|
key: index,
|
|
5068
5064
|
size: _ctx.size
|
|
5069
5065
|
}, {
|
|
@@ -5208,10 +5204,10 @@
|
|
|
5208
5204
|
height: "500px",
|
|
5209
5205
|
onChange: (formState, code) => {
|
|
5210
5206
|
try {
|
|
5211
|
-
|
|
5207
|
+
getEditorConfig("parseDSL")(code);
|
|
5212
5208
|
return code;
|
|
5213
5209
|
} catch (error) {
|
|
5214
|
-
|
|
5210
|
+
designPlugin.tMagicMessage.error(error.message);
|
|
5215
5211
|
throw error;
|
|
5216
5212
|
}
|
|
5217
5213
|
}
|
|
@@ -5222,7 +5218,7 @@
|
|
|
5222
5218
|
emit("submit", values);
|
|
5223
5219
|
};
|
|
5224
5220
|
const errorHandler = (error) => {
|
|
5225
|
-
|
|
5221
|
+
designPlugin.tMagicMessage.error(error.message);
|
|
5226
5222
|
};
|
|
5227
5223
|
const formBox = vue.ref();
|
|
5228
5224
|
const changedValue = vue.ref();
|
|
@@ -5234,7 +5230,7 @@
|
|
|
5234
5230
|
done();
|
|
5235
5231
|
return;
|
|
5236
5232
|
}
|
|
5237
|
-
|
|
5233
|
+
designPlugin.tMagicMessageBox.confirm("当前代码块已修改,是否保存?", "提示", {
|
|
5238
5234
|
confirmButtonText: "保存并关闭",
|
|
5239
5235
|
cancelButtonText: "不保存并关闭",
|
|
5240
5236
|
type: "warning",
|
|
@@ -5274,7 +5270,7 @@
|
|
|
5274
5270
|
"before-close": beforeClose
|
|
5275
5271
|
}, {
|
|
5276
5272
|
body: vue.withCtx(() => [
|
|
5277
|
-
vue.createVNode(vue.unref(
|
|
5273
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
5278
5274
|
class: "m-editor-code-block-editor",
|
|
5279
5275
|
ref_key: "formBox",
|
|
5280
5276
|
ref: formBox,
|
|
@@ -5291,7 +5287,7 @@
|
|
|
5291
5287
|
onClosed: closedHandler
|
|
5292
5288
|
}, {
|
|
5293
5289
|
left: vue.withCtx(() => [
|
|
5294
|
-
!_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5290
|
+
!_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
5295
5291
|
key: 0,
|
|
5296
5292
|
type: "primary",
|
|
5297
5293
|
link: "",
|
|
@@ -5309,7 +5305,7 @@
|
|
|
5309
5305
|
_: 1
|
|
5310
5306
|
}, 8, ["visible", "width", "height", "title", "position"]),
|
|
5311
5307
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
5312
|
-
vue.createVNode(vue.unref(
|
|
5308
|
+
vue.createVNode(vue.unref(designPlugin.TMagicDialog), {
|
|
5313
5309
|
title: "查看修改",
|
|
5314
5310
|
modelValue: difVisible.value,
|
|
5315
5311
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => difVisible.value = $event),
|
|
@@ -5317,7 +5313,7 @@
|
|
|
5317
5313
|
}, {
|
|
5318
5314
|
footer: vue.withCtx(() => [
|
|
5319
5315
|
vue.createElementVNode("span", _hoisted_4$7, [
|
|
5320
|
-
vue.createVNode(vue.unref(
|
|
5316
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5321
5317
|
size: "small",
|
|
5322
5318
|
onClick: _cache[4] || (_cache[4] = ($event) => difVisible.value = false)
|
|
5323
5319
|
}, {
|
|
@@ -5326,7 +5322,7 @@
|
|
|
5326
5322
|
]),
|
|
5327
5323
|
_: 1
|
|
5328
5324
|
}),
|
|
5329
|
-
vue.createVNode(vue.unref(
|
|
5325
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5330
5326
|
size: "small",
|
|
5331
5327
|
type: "primary",
|
|
5332
5328
|
onClick: diffChange
|
|
@@ -5341,7 +5337,7 @@
|
|
|
5341
5337
|
default: vue.withCtx(() => [
|
|
5342
5338
|
vue.createElementVNode("div", _hoisted_1$p, [
|
|
5343
5339
|
vue.createElementVNode("div", _hoisted_2$g, [
|
|
5344
|
-
vue.createVNode(vue.unref(
|
|
5340
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTag), {
|
|
5345
5341
|
size: "small",
|
|
5346
5342
|
type: "info"
|
|
5347
5343
|
}, {
|
|
@@ -5352,7 +5348,7 @@
|
|
|
5352
5348
|
})
|
|
5353
5349
|
]),
|
|
5354
5350
|
vue.createElementVNode("div", _hoisted_3$7, [
|
|
5355
|
-
vue.createVNode(vue.unref(
|
|
5351
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTag), {
|
|
5356
5352
|
size: "small",
|
|
5357
5353
|
type: "success"
|
|
5358
5354
|
}, {
|
|
@@ -5455,12 +5451,12 @@
|
|
|
5455
5451
|
};
|
|
5456
5452
|
return (_ctx, _cache) => {
|
|
5457
5453
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
|
|
5458
|
-
vue.createVNode(vue.unref(
|
|
5454
|
+
vue.createVNode(vue.unref(tablePlugin.MagicTable), {
|
|
5459
5455
|
data: _ctx.model[_ctx.name],
|
|
5460
5456
|
columns: methodColumns
|
|
5461
5457
|
}, null, 8, ["data"]),
|
|
5462
5458
|
vue.createElementVNode("div", _hoisted_2$f, [
|
|
5463
|
-
vue.createVNode(vue.unref(
|
|
5459
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5464
5460
|
size: "small",
|
|
5465
5461
|
type: "primary",
|
|
5466
5462
|
disabled: _ctx.disabled,
|
|
@@ -5517,7 +5513,7 @@
|
|
|
5517
5513
|
const hasDataSourceSidePanel = vue.computed(
|
|
5518
5514
|
() => (services?.uiService.get("sideBarItems") || []).find((item) => item.$key === SideItemKey.DATA_SOURCE)
|
|
5519
5515
|
);
|
|
5520
|
-
const notEditable = vue.computed(() =>
|
|
5516
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.config.notEditable, props));
|
|
5521
5517
|
const dataSources = vue.computed(() => dataSourceService?.get("dataSources"));
|
|
5522
5518
|
const isCustomMethod = vue.computed(() => {
|
|
5523
5519
|
const [id, name] = props.model[props.name];
|
|
@@ -5537,7 +5533,7 @@
|
|
|
5537
5533
|
const setParamsConfig = (dataSourceMethod, formState = {}) => {
|
|
5538
5534
|
paramsConfig.value = dataSourceMethod ? getParamItemsConfig(dataSourceMethod) : [];
|
|
5539
5535
|
if (paramsConfig.value.length) {
|
|
5540
|
-
props.model.params =
|
|
5536
|
+
props.model.params = formPlugin.createValues(formState, paramsConfig.value, {}, props.model.params);
|
|
5541
5537
|
} else {
|
|
5542
5538
|
props.model.params = {};
|
|
5543
5539
|
}
|
|
@@ -5578,19 +5574,19 @@
|
|
|
5578
5574
|
return (_ctx, _cache) => {
|
|
5579
5575
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
5580
5576
|
vue.createElementVNode("div", _hoisted_2$e, [
|
|
5581
|
-
vue.createVNode(vue.unref(
|
|
5577
|
+
vue.createVNode(vue.unref(formPlugin.MContainer), {
|
|
5582
5578
|
class: "select",
|
|
5583
5579
|
config: cascaderConfig.value,
|
|
5584
5580
|
model: _ctx.model,
|
|
5585
5581
|
size: _ctx.size,
|
|
5586
5582
|
onChange: onChangeHandler
|
|
5587
5583
|
}, null, 8, ["config", "model", "size"]),
|
|
5588
|
-
_ctx.model[_ctx.name] && isCustomMethod.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5584
|
+
_ctx.model[_ctx.name] && isCustomMethod.value && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
5589
5585
|
key: 0,
|
|
5590
5586
|
content: notEditable.value ? "查看" : "编辑"
|
|
5591
5587
|
}, {
|
|
5592
5588
|
default: vue.withCtx(() => [
|
|
5593
|
-
vue.createVNode(vue.unref(
|
|
5589
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5594
5590
|
class: "m-fields-select-action-button",
|
|
5595
5591
|
size: _ctx.size,
|
|
5596
5592
|
onClick: editCodeHandler
|
|
@@ -5733,7 +5729,7 @@
|
|
|
5733
5729
|
label: "是否启用",
|
|
5734
5730
|
prop: "enable",
|
|
5735
5731
|
type: "component",
|
|
5736
|
-
component:
|
|
5732
|
+
component: designPlugin.TMagicSwitch,
|
|
5737
5733
|
props: (row) => ({
|
|
5738
5734
|
modelValue: row.enable,
|
|
5739
5735
|
activeValue: true,
|
|
@@ -5749,7 +5745,7 @@
|
|
|
5749
5745
|
label: "编辑器中使用",
|
|
5750
5746
|
prop: "useInEditor",
|
|
5751
5747
|
type: "component",
|
|
5752
|
-
component:
|
|
5748
|
+
component: designPlugin.TMagicSwitch,
|
|
5753
5749
|
props: (row) => ({
|
|
5754
5750
|
modelValue: row.useInEditor,
|
|
5755
5751
|
activeValue: true,
|
|
@@ -5781,7 +5777,7 @@
|
|
|
5781
5777
|
text: "删除",
|
|
5782
5778
|
buttonType: "danger",
|
|
5783
5779
|
handler: async (row, index) => {
|
|
5784
|
-
await
|
|
5780
|
+
await designPlugin.tMagicMessageBox.confirm(`确定删除${row.title}?`, "提示");
|
|
5785
5781
|
props.model[props.name].splice(index, 1);
|
|
5786
5782
|
emit("change", props.model[props.name]);
|
|
5787
5783
|
}
|
|
@@ -5827,12 +5823,12 @@
|
|
|
5827
5823
|
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
5828
5824
|
return (_ctx, _cache) => {
|
|
5829
5825
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
5830
|
-
vue.createVNode(vue.unref(
|
|
5826
|
+
vue.createVNode(vue.unref(tablePlugin.MagicTable), {
|
|
5831
5827
|
data: _ctx.model[_ctx.name],
|
|
5832
5828
|
columns
|
|
5833
5829
|
}, null, 8, ["data"]),
|
|
5834
5830
|
vue.createElementVNode("div", _hoisted_2$d, [
|
|
5835
|
-
vue.createVNode(vue.unref(
|
|
5831
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5836
5832
|
size: "small",
|
|
5837
5833
|
type: "primary",
|
|
5838
5834
|
disabled: _ctx.disabled,
|
|
@@ -5856,7 +5852,7 @@
|
|
|
5856
5852
|
position: vue.unref(boxPosition)
|
|
5857
5853
|
}, {
|
|
5858
5854
|
body: vue.withCtx(() => [
|
|
5859
|
-
vue.createVNode(vue.unref(
|
|
5855
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
5860
5856
|
ref: "addDialog",
|
|
5861
5857
|
"label-width": "120px",
|
|
5862
5858
|
config: formConfig,
|
|
@@ -5898,7 +5894,7 @@
|
|
|
5898
5894
|
const { dataSourceService, uiService } = vue.inject("services") || {};
|
|
5899
5895
|
const eventBus = vue.inject("eventBus");
|
|
5900
5896
|
const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
|
|
5901
|
-
const notEditable = vue.computed(() =>
|
|
5897
|
+
const notEditable = vue.computed(() => formPlugin.filterFunction(mForm, props.config.notEditable, props));
|
|
5902
5898
|
const hasDataSourceSidePanel = vue.computed(
|
|
5903
5899
|
() => (uiService?.get("sideBarItems") || []).find((item) => item.$key === SideItemKey.DATA_SOURCE)
|
|
5904
5900
|
);
|
|
@@ -5932,7 +5928,7 @@
|
|
|
5932
5928
|
};
|
|
5933
5929
|
return (_ctx, _cache) => {
|
|
5934
5930
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
5935
|
-
vue.createVNode(vue.unref(
|
|
5931
|
+
vue.createVNode(vue.unref(formPlugin.MSelect), {
|
|
5936
5932
|
model: _ctx.model,
|
|
5937
5933
|
name: _ctx.name,
|
|
5938
5934
|
size: _ctx.size,
|
|
@@ -5942,12 +5938,12 @@
|
|
|
5942
5938
|
"last-values": _ctx.lastValues,
|
|
5943
5939
|
onChange: changeHandler
|
|
5944
5940
|
}, null, 8, ["model", "name", "size", "prop", "disabled", "config", "last-values"]),
|
|
5945
|
-
_ctx.model[_ctx.name] && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
5941
|
+
_ctx.model[_ctx.name] && hasDataSourceSidePanel.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
5946
5942
|
key: 0,
|
|
5947
5943
|
content: notEditable.value ? "查看" : "编辑"
|
|
5948
5944
|
}, {
|
|
5949
5945
|
default: vue.withCtx(() => [
|
|
5950
|
-
vue.createVNode(vue.unref(
|
|
5946
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
5951
5947
|
class: "m-fields-select-action-button",
|
|
5952
5948
|
size: _ctx.size,
|
|
5953
5949
|
onClick: editHandler
|
|
@@ -5989,7 +5985,7 @@
|
|
|
5989
5985
|
const props = __props;
|
|
5990
5986
|
const { dataSourceService } = vue.inject("services") || {};
|
|
5991
5987
|
const mForm = vue.inject("mForm");
|
|
5992
|
-
const parentFields = vue.computed(() =>
|
|
5988
|
+
const parentFields = vue.computed(() => formPlugin.filterFunction(mForm, props.config.parentFields, props) || []);
|
|
5993
5989
|
const config = vue.computed(() => ({
|
|
5994
5990
|
type: "groupList",
|
|
5995
5991
|
name: props.name,
|
|
@@ -6080,7 +6076,7 @@
|
|
|
6080
6076
|
emit("change", v);
|
|
6081
6077
|
};
|
|
6082
6078
|
return (_ctx, _cache) => {
|
|
6083
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
6079
|
+
return vue.openBlock(), vue.createBlock(vue.unref(formPlugin.MGroupList), {
|
|
6084
6080
|
style: { "width": "100%" },
|
|
6085
6081
|
config: config.value,
|
|
6086
6082
|
name: _ctx.name,
|
|
@@ -6196,24 +6192,24 @@
|
|
|
6196
6192
|
name: "actionType",
|
|
6197
6193
|
text: "联动类型",
|
|
6198
6194
|
type: "select",
|
|
6199
|
-
defaultValue:
|
|
6195
|
+
defaultValue: core.ActionType.COMP,
|
|
6200
6196
|
options: () => [
|
|
6201
6197
|
{
|
|
6202
6198
|
text: "组件",
|
|
6203
6199
|
label: "组件",
|
|
6204
|
-
value:
|
|
6200
|
+
value: core.ActionType.COMP
|
|
6205
6201
|
},
|
|
6206
6202
|
{
|
|
6207
6203
|
text: "代码",
|
|
6208
6204
|
label: "代码",
|
|
6209
6205
|
disabled: !Object.keys(codeBlockService?.getCodeDsl() || {}).length,
|
|
6210
|
-
value:
|
|
6206
|
+
value: core.ActionType.CODE
|
|
6211
6207
|
},
|
|
6212
6208
|
{
|
|
6213
6209
|
text: "数据源",
|
|
6214
6210
|
label: "数据源",
|
|
6215
6211
|
disabled: !dataSourceService?.get("dataSources")?.filter((ds) => ds.methods?.length || dataSourceService?.getFormMethod(ds.type).length).length,
|
|
6216
|
-
value:
|
|
6212
|
+
value: core.ActionType.DATA_SOURCE
|
|
6217
6213
|
}
|
|
6218
6214
|
]
|
|
6219
6215
|
};
|
|
@@ -6224,7 +6220,7 @@
|
|
|
6224
6220
|
name: "to",
|
|
6225
6221
|
text: "联动组件",
|
|
6226
6222
|
type: "ui-select",
|
|
6227
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6223
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.COMP,
|
|
6228
6224
|
onChange: (MForm, v, { model }) => {
|
|
6229
6225
|
model.method = "";
|
|
6230
6226
|
return v;
|
|
@@ -6244,7 +6240,7 @@
|
|
|
6244
6240
|
return "select";
|
|
6245
6241
|
},
|
|
6246
6242
|
checkStrictly: () => props.config.src !== "component",
|
|
6247
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6243
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.COMP,
|
|
6248
6244
|
options: (mForm, { model }) => {
|
|
6249
6245
|
const node = editorService?.getNodeById(model.to);
|
|
6250
6246
|
if (!node?.type) return [];
|
|
@@ -6283,7 +6279,7 @@
|
|
|
6283
6279
|
text: "代码块",
|
|
6284
6280
|
name: "codeId",
|
|
6285
6281
|
notEditable: () => !codeBlockService?.getEditStatus(),
|
|
6286
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6282
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.CODE
|
|
6287
6283
|
};
|
|
6288
6284
|
return { ...defaultCodeActionConfig, ...props.config.codeActionConfig };
|
|
6289
6285
|
});
|
|
@@ -6293,7 +6289,7 @@
|
|
|
6293
6289
|
text: "数据源方法",
|
|
6294
6290
|
name: "dataSourceMethod",
|
|
6295
6291
|
notEditable: () => !services?.dataSourceService.get("editable"),
|
|
6296
|
-
display: (mForm, { model }) => model.actionType ===
|
|
6292
|
+
display: (mForm, { model }) => model.actionType === core.ActionType.DATA_SOURCE
|
|
6297
6293
|
};
|
|
6298
6294
|
return { ...defaultDataSourceActionConfig, ...props.config.dataSourceActionConfig };
|
|
6299
6295
|
});
|
|
@@ -6385,7 +6381,7 @@
|
|
|
6385
6381
|
config: tableConfig.value,
|
|
6386
6382
|
onChange: onChangeHandler
|
|
6387
6383
|
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
|
|
6388
|
-
vue.createVNode(vue.unref(
|
|
6384
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6389
6385
|
class: "create-button",
|
|
6390
6386
|
type: "primary",
|
|
6391
6387
|
size: _ctx.size,
|
|
@@ -6398,7 +6394,7 @@
|
|
|
6398
6394
|
_: 1
|
|
6399
6395
|
}, 8, ["size", "disabled"]),
|
|
6400
6396
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.model[_ctx.name], (cardItem, index) => {
|
|
6401
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
6397
|
+
return vue.openBlock(), vue.createBlock(vue.unref(formPlugin.MPanel), {
|
|
6402
6398
|
key: index,
|
|
6403
6399
|
disabled: _ctx.disabled,
|
|
6404
6400
|
size: _ctx.size,
|
|
@@ -6408,7 +6404,7 @@
|
|
|
6408
6404
|
onChange: onChangeHandler
|
|
6409
6405
|
}, {
|
|
6410
6406
|
header: vue.withCtx(() => [
|
|
6411
|
-
vue.createVNode(vue.unref(
|
|
6407
|
+
vue.createVNode(vue.unref(formPlugin.MContainer), {
|
|
6412
6408
|
class: "fullWidth",
|
|
6413
6409
|
config: eventNameConfig.value,
|
|
6414
6410
|
model: cardItem,
|
|
@@ -6416,7 +6412,7 @@
|
|
|
6416
6412
|
size: _ctx.size,
|
|
6417
6413
|
onChange: onChangeHandler
|
|
6418
6414
|
}, null, 8, ["config", "model", "disabled", "size"]),
|
|
6419
|
-
vue.createVNode(vue.unref(
|
|
6415
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6420
6416
|
style: { "color": "#f56c6c" },
|
|
6421
6417
|
link: "",
|
|
6422
6418
|
icon: vue.unref(iconsVue.Delete),
|
|
@@ -6524,7 +6520,7 @@
|
|
|
6524
6520
|
class: "m-fields-key-value-item",
|
|
6525
6521
|
key: index
|
|
6526
6522
|
}, [
|
|
6527
|
-
vue.createVNode(vue.unref(
|
|
6523
|
+
vue.createVNode(vue.unref(designPlugin.TMagicInput), {
|
|
6528
6524
|
placeholder: "key",
|
|
6529
6525
|
modelValue: records.value[index][0],
|
|
6530
6526
|
"onUpdate:modelValue": ($event) => records.value[index][0] = $event,
|
|
@@ -6533,7 +6529,7 @@
|
|
|
6533
6529
|
onChange: keyChangeHandler
|
|
6534
6530
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
6535
6531
|
_hoisted_3$6,
|
|
6536
|
-
vue.createVNode(vue.unref(
|
|
6532
|
+
vue.createVNode(vue.unref(designPlugin.TMagicInput), {
|
|
6537
6533
|
placeholder: "value",
|
|
6538
6534
|
modelValue: records.value[index][1],
|
|
6539
6535
|
"onUpdate:modelValue": ($event) => records.value[index][1] = $event,
|
|
@@ -6541,7 +6537,7 @@
|
|
|
6541
6537
|
size: _ctx.size,
|
|
6542
6538
|
onChange: valueChangeHandler
|
|
6543
6539
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
6544
|
-
vue.createVNode(vue.unref(
|
|
6540
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6545
6541
|
class: "m-fileds-key-value-delete",
|
|
6546
6542
|
type: "danger",
|
|
6547
6543
|
size: _ctx.size,
|
|
@@ -6553,7 +6549,7 @@
|
|
|
6553
6549
|
}, null, 8, ["size", "disabled", "icon", "onClick"])
|
|
6554
6550
|
]);
|
|
6555
6551
|
}), 128)),
|
|
6556
|
-
vue.createVNode(vue.unref(
|
|
6552
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6557
6553
|
type: "primary",
|
|
6558
6554
|
size: _ctx.size,
|
|
6559
6555
|
disabled: _ctx.disabled,
|
|
@@ -6578,7 +6574,7 @@
|
|
|
6578
6574
|
parse: true,
|
|
6579
6575
|
onSave: save
|
|
6580
6576
|
}, null, 8, ["init-values", "options"])) : vue.createCommentVNode("", true),
|
|
6581
|
-
_ctx.config.advanced ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
6577
|
+
_ctx.config.advanced ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
6582
6578
|
key: 2,
|
|
6583
6579
|
size: "default",
|
|
6584
6580
|
disabled: _ctx.disabled,
|
|
@@ -6615,7 +6611,7 @@
|
|
|
6615
6611
|
const emit = __emit;
|
|
6616
6612
|
const props = __props;
|
|
6617
6613
|
const pageList = vue.computed(
|
|
6618
|
-
() => services?.editorService.get("root")?.items.filter((item) => item.type ===
|
|
6614
|
+
() => services?.editorService.get("root")?.items.filter((item) => item.type === core.NodeType.PAGE_FRAGMENT)
|
|
6619
6615
|
);
|
|
6620
6616
|
const selectConfig = {
|
|
6621
6617
|
type: "select",
|
|
@@ -6747,7 +6743,7 @@
|
|
|
6747
6743
|
class: "m-fields-ui-select",
|
|
6748
6744
|
onClick: cancelHandler
|
|
6749
6745
|
}, [
|
|
6750
|
-
vue.createVNode(vue.unref(
|
|
6746
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6751
6747
|
type: "danger",
|
|
6752
6748
|
icon: vue.unref(iconsVue.Delete),
|
|
6753
6749
|
disabled: _ctx.disabled,
|
|
@@ -6762,12 +6758,12 @@
|
|
|
6762
6758
|
}, 8, ["icon", "disabled", "size"])
|
|
6763
6759
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
|
|
6764
6760
|
val.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
6765
|
-
vue.createVNode(vue.unref(
|
|
6761
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTooltip), {
|
|
6766
6762
|
content: "清除",
|
|
6767
6763
|
placement: "top"
|
|
6768
6764
|
}, {
|
|
6769
6765
|
default: vue.withCtx(() => [
|
|
6770
|
-
vue.createVNode(vue.unref(
|
|
6766
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6771
6767
|
style: { "padding": "0" },
|
|
6772
6768
|
type: "danger",
|
|
6773
6769
|
icon: vue.unref(iconsVue.Close),
|
|
@@ -6779,12 +6775,12 @@
|
|
|
6779
6775
|
]),
|
|
6780
6776
|
_: 1
|
|
6781
6777
|
}),
|
|
6782
|
-
vue.createVNode(vue.unref(
|
|
6778
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTooltip), {
|
|
6783
6779
|
content: "点击选中组件",
|
|
6784
6780
|
placement: "top"
|
|
6785
6781
|
}, {
|
|
6786
6782
|
default: vue.withCtx(() => [
|
|
6787
|
-
vue.createVNode(vue.unref(
|
|
6783
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6788
6784
|
link: "",
|
|
6789
6785
|
style: { "padding": "0", "margin": "0" },
|
|
6790
6786
|
disabled: _ctx.disabled,
|
|
@@ -6801,13 +6797,13 @@
|
|
|
6801
6797
|
]),
|
|
6802
6798
|
_: 1
|
|
6803
6799
|
})
|
|
6804
|
-
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(
|
|
6800
|
+
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
6805
6801
|
key: 1,
|
|
6806
6802
|
content: "点击此处选择",
|
|
6807
6803
|
placement: "top"
|
|
6808
6804
|
}, {
|
|
6809
6805
|
default: vue.withCtx(() => [
|
|
6810
|
-
vue.createVNode(vue.unref(
|
|
6806
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
6811
6807
|
link: "",
|
|
6812
6808
|
style: { "padding": "0", "margin": "0" },
|
|
6813
6809
|
disabled: _ctx.disabled,
|
|
@@ -7082,18 +7078,18 @@
|
|
|
7082
7078
|
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(_ctx.data, $event)),
|
|
7083
7079
|
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(_ctx.data, $event))
|
|
7084
7080
|
}, [
|
|
7085
|
-
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7081
|
+
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDivider), {
|
|
7086
7082
|
key: 0,
|
|
7087
7083
|
direction: _ctx.data.direction || "vertical"
|
|
7088
7084
|
}, 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 }, [
|
|
7089
|
-
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7085
|
+
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
7090
7086
|
key: 0,
|
|
7091
7087
|
effect: "dark",
|
|
7092
7088
|
placement: "bottom-start",
|
|
7093
7089
|
content: _ctx.data.tooltip
|
|
7094
7090
|
}, {
|
|
7095
7091
|
default: vue.withCtx(() => [
|
|
7096
|
-
vue.createVNode(vue.unref(
|
|
7092
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
7097
7093
|
size: "small",
|
|
7098
7094
|
link: "",
|
|
7099
7095
|
disabled: disabled.value
|
|
@@ -7109,7 +7105,7 @@
|
|
|
7109
7105
|
}, 8, ["disabled"])
|
|
7110
7106
|
]),
|
|
7111
7107
|
_: 1
|
|
7112
|
-
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7108
|
+
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
7113
7109
|
key: 1,
|
|
7114
7110
|
size: "small",
|
|
7115
7111
|
link: "",
|
|
@@ -7125,17 +7121,17 @@
|
|
|
7125
7121
|
]),
|
|
7126
7122
|
_: 1
|
|
7127
7123
|
}, 8, ["disabled", "title"]))
|
|
7128
|
-
], 64)) : _ctx.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7124
|
+
], 64)) : _ctx.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDropdown), {
|
|
7129
7125
|
key: 3,
|
|
7130
7126
|
trigger: "click",
|
|
7131
7127
|
disabled: disabled.value,
|
|
7132
7128
|
onCommand: dropdownHandler
|
|
7133
7129
|
}, {
|
|
7134
7130
|
dropdown: vue.withCtx(() => [
|
|
7135
|
-
_ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
7131
|
+
_ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDropdownMenu), { key: 0 }, {
|
|
7136
7132
|
default: vue.withCtx(() => [
|
|
7137
7133
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (subItem, index) => {
|
|
7138
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
7134
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDropdownItem), {
|
|
7139
7135
|
key: index,
|
|
7140
7136
|
command: { data: _ctx.data, subItem }
|
|
7141
7137
|
}, {
|
|
@@ -7152,7 +7148,7 @@
|
|
|
7152
7148
|
default: vue.withCtx(() => [
|
|
7153
7149
|
vue.createElementVNode("span", _hoisted_2$8, [
|
|
7154
7150
|
vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
|
|
7155
|
-
vue.createVNode(vue.unref(
|
|
7151
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), { class: "el-icon--right" }, {
|
|
7156
7152
|
default: vue.withCtx(() => [
|
|
7157
7153
|
vue.createVNode(vue.unref(iconsVue.ArrowDown))
|
|
7158
7154
|
]),
|
|
@@ -7320,7 +7316,7 @@
|
|
|
7320
7316
|
vue.watch(
|
|
7321
7317
|
() => props.type,
|
|
7322
7318
|
(type) => {
|
|
7323
|
-
if (type ===
|
|
7319
|
+
if (type === core.NodeType.PAGE) {
|
|
7324
7320
|
unWatchPageFragmentLength?.();
|
|
7325
7321
|
unWatchPageFragmentLength = null;
|
|
7326
7322
|
unWatchPageLength = crateWatchLength(pageLength);
|
|
@@ -7348,7 +7344,7 @@
|
|
|
7348
7344
|
}, [
|
|
7349
7345
|
vue.createVNode(_sfc_main$Y, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
7350
7346
|
])) : vue.createCommentVNode("", true),
|
|
7351
|
-
_ctx.type === vue.unref(
|
|
7347
|
+
_ctx.type === vue.unref(core.NodeType).PAGE && pageLength.value || _ctx.type === vue.unref(core.NodeType).PAGE_FRAGMENT && pageFragmentLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
7352
7348
|
key: 1,
|
|
7353
7349
|
class: "m-editor-page-bar-items",
|
|
7354
7350
|
ref_key: "itemsContainer",
|
|
@@ -7392,7 +7388,7 @@
|
|
|
7392
7388
|
};
|
|
7393
7389
|
return (_ctx, _cache) => {
|
|
7394
7390
|
return showPageListButton.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
7395
|
-
vue.createVNode(vue.unref(
|
|
7391
|
+
vue.createVNode(vue.unref(designPlugin.TMagicPopover), {
|
|
7396
7392
|
"popper-class": "page-bar-popover",
|
|
7397
7393
|
placement: "top",
|
|
7398
7394
|
trigger: "hover",
|
|
@@ -7400,7 +7396,7 @@
|
|
|
7400
7396
|
"destroy-on-close": true
|
|
7401
7397
|
}, {
|
|
7402
7398
|
reference: vue.withCtx(() => [
|
|
7403
|
-
vue.createVNode(vue.unref(
|
|
7399
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), { class: "m-editor-page-list-menu-icon" }, {
|
|
7404
7400
|
default: vue.withCtx(() => [
|
|
7405
7401
|
vue.createVNode(vue.unref(iconsVue.Files))
|
|
7406
7402
|
]),
|
|
@@ -7442,11 +7438,11 @@
|
|
|
7442
7438
|
setup(__props, { emit: __emit }) {
|
|
7443
7439
|
const data = [
|
|
7444
7440
|
{
|
|
7445
|
-
type:
|
|
7441
|
+
type: core.NodeType.PAGE,
|
|
7446
7442
|
text: "页面"
|
|
7447
7443
|
},
|
|
7448
7444
|
{
|
|
7449
|
-
type:
|
|
7445
|
+
type: core.NodeType.PAGE_FRAGMENT,
|
|
7450
7446
|
text: "页面片"
|
|
7451
7447
|
}
|
|
7452
7448
|
];
|
|
@@ -7456,7 +7452,7 @@
|
|
|
7456
7452
|
};
|
|
7457
7453
|
return (_ctx, _cache) => {
|
|
7458
7454
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(data, (item) => {
|
|
7459
|
-
return vue.createVNode(vue.unref(
|
|
7455
|
+
return vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
7460
7456
|
class: vue.normalizeClass(["m-editor-page-bar-switch-type-button", { active: _ctx.modelValue === item.type }]),
|
|
7461
7457
|
size: "small",
|
|
7462
7458
|
key: item.type,
|
|
@@ -7488,37 +7484,37 @@
|
|
|
7488
7484
|
pageBarSortOptions: {}
|
|
7489
7485
|
},
|
|
7490
7486
|
setup(__props) {
|
|
7491
|
-
const active = vue.ref(
|
|
7487
|
+
const active = vue.ref(core.NodeType.PAGE);
|
|
7492
7488
|
const services = vue.inject("services");
|
|
7493
7489
|
const editorService = services?.editorService;
|
|
7494
7490
|
const root = vue.computed(() => editorService?.get("root"));
|
|
7495
7491
|
const page = vue.computed(() => editorService?.get("page"));
|
|
7496
7492
|
const pageList = vue.computed(() => getPageList(root.value));
|
|
7497
7493
|
const pageFragmentList = vue.computed(() => getPageFragmentList(root.value));
|
|
7498
|
-
const list = vue.computed(() => active.value ===
|
|
7494
|
+
const list = vue.computed(() => active.value === core.NodeType.PAGE ? pageList.value : pageFragmentList.value);
|
|
7499
7495
|
const activePage = vue.ref("");
|
|
7500
7496
|
const activePageFragment = vue.ref("");
|
|
7501
7497
|
vue.watch(
|
|
7502
7498
|
page,
|
|
7503
7499
|
(page2) => {
|
|
7504
7500
|
if (!page2) {
|
|
7505
|
-
if (active.value ===
|
|
7501
|
+
if (active.value === core.NodeType.PAGE) {
|
|
7506
7502
|
activePage.value = "";
|
|
7507
7503
|
}
|
|
7508
|
-
if (active.value ===
|
|
7504
|
+
if (active.value === core.NodeType.PAGE_FRAGMENT) {
|
|
7509
7505
|
activePageFragment.value = "";
|
|
7510
7506
|
}
|
|
7511
7507
|
return;
|
|
7512
7508
|
}
|
|
7513
7509
|
if (utils.isPage(page2)) {
|
|
7514
7510
|
activePage.value = page2?.id;
|
|
7515
|
-
if (active.value !==
|
|
7516
|
-
active.value =
|
|
7511
|
+
if (active.value !== core.NodeType.PAGE) {
|
|
7512
|
+
active.value = core.NodeType.PAGE;
|
|
7517
7513
|
}
|
|
7518
7514
|
} else if (utils.isPageFragment(page2)) {
|
|
7519
7515
|
activePageFragment.value = page2?.id;
|
|
7520
|
-
if (active.value !==
|
|
7521
|
-
active.value =
|
|
7516
|
+
if (active.value !== core.NodeType.PAGE_FRAGMENT) {
|
|
7517
|
+
active.value = core.NodeType.PAGE_FRAGMENT;
|
|
7522
7518
|
}
|
|
7523
7519
|
}
|
|
7524
7520
|
},
|
|
@@ -7527,7 +7523,7 @@
|
|
|
7527
7523
|
}
|
|
7528
7524
|
);
|
|
7529
7525
|
vue.watch(active, (active2) => {
|
|
7530
|
-
if (active2 ===
|
|
7526
|
+
if (active2 === core.NodeType.PAGE) {
|
|
7531
7527
|
if (!activePage.value && !pageList.value.length) {
|
|
7532
7528
|
editorService?.selectRoot();
|
|
7533
7529
|
return;
|
|
@@ -7535,7 +7531,7 @@
|
|
|
7535
7531
|
switchPage(activePage.value);
|
|
7536
7532
|
return;
|
|
7537
7533
|
}
|
|
7538
|
-
if (active2 ===
|
|
7534
|
+
if (active2 === core.NodeType.PAGE_FRAGMENT) {
|
|
7539
7535
|
if (!activePageFragment.value && !pageFragmentList.value.length) {
|
|
7540
7536
|
editorService?.selectRoot();
|
|
7541
7537
|
return;
|
|
@@ -7591,7 +7587,7 @@
|
|
|
7591
7587
|
}, vue.toDisplayString(item.name || item.id), 9, _hoisted_4$5)
|
|
7592
7588
|
])
|
|
7593
7589
|
]),
|
|
7594
|
-
vue.createVNode(vue.unref(
|
|
7590
|
+
vue.createVNode(vue.unref(designPlugin.TMagicPopover), {
|
|
7595
7591
|
"popper-class": "page-bar-popover",
|
|
7596
7592
|
placement: "top",
|
|
7597
7593
|
trigger: "hover",
|
|
@@ -7599,7 +7595,7 @@
|
|
|
7599
7595
|
"destroy-on-close": true
|
|
7600
7596
|
}, {
|
|
7601
7597
|
reference: vue.withCtx(() => [
|
|
7602
|
-
vue.createVNode(vue.unref(
|
|
7598
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
7603
7599
|
default: vue.withCtx(() => [
|
|
7604
7600
|
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
7605
7601
|
]),
|
|
@@ -7670,7 +7666,7 @@
|
|
|
7670
7666
|
vue.createElementVNode("div", _hoisted_2$6, [
|
|
7671
7667
|
vue.createElementVNode("div", {
|
|
7672
7668
|
class: "m-editor-empty-button",
|
|
7673
|
-
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(vue.unref(
|
|
7669
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(vue.unref(core.NodeType).PAGE))
|
|
7674
7670
|
}, [
|
|
7675
7671
|
vue.createElementVNode("div", null, [
|
|
7676
7672
|
vue.createVNode(_sfc_main$Y, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
@@ -7680,7 +7676,7 @@
|
|
|
7680
7676
|
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
7681
7677
|
key: 0,
|
|
7682
7678
|
class: "m-editor-empty-button",
|
|
7683
|
-
onClick: _cache[1] || (_cache[1] = ($event) => clickHandler(vue.unref(
|
|
7679
|
+
onClick: _cache[1] || (_cache[1] = ($event) => clickHandler(vue.unref(core.NodeType).PAGE_FRAGMENT))
|
|
7684
7680
|
}, [
|
|
7685
7681
|
vue.createElementVNode("div", null, [
|
|
7686
7682
|
vue.createVNode(_sfc_main$Y, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
@@ -7758,7 +7754,7 @@
|
|
|
7758
7754
|
});
|
|
7759
7755
|
const saveCode = (value) => {
|
|
7760
7756
|
try {
|
|
7761
|
-
const parseDSL =
|
|
7757
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
7762
7758
|
editorService?.set("root", parseDSL(value));
|
|
7763
7759
|
} catch (e) {
|
|
7764
7760
|
console.error(e);
|
|
@@ -7831,7 +7827,7 @@
|
|
|
7831
7827
|
page.value ? {
|
|
7832
7828
|
name: "right",
|
|
7833
7829
|
fn: vue.withCtx(() => [
|
|
7834
|
-
vue.createVNode(vue.unref(
|
|
7830
|
+
vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), null, {
|
|
7835
7831
|
default: vue.withCtx(() => [
|
|
7836
7832
|
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
7837
7833
|
]),
|
|
@@ -7897,7 +7893,7 @@
|
|
|
7897
7893
|
className: "delete",
|
|
7898
7894
|
icon: vue.markRaw(iconsVue.Delete),
|
|
7899
7895
|
tooltip: `刪除(Delete)`,
|
|
7900
|
-
disabled: () => services?.editorService.get("node")?.type ===
|
|
7896
|
+
disabled: () => services?.editorService.get("node")?.type === core.NodeType.PAGE,
|
|
7901
7897
|
handler: () => {
|
|
7902
7898
|
const node = services?.editorService.get("node");
|
|
7903
7899
|
node && services?.editorService.remove(node);
|
|
@@ -8109,7 +8105,7 @@
|
|
|
8109
8105
|
return (_ctx, _cache) => {
|
|
8110
8106
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
8111
8107
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
8112
|
-
vue.createVNode(vue.unref(
|
|
8108
|
+
vue.createVNode(vue.unref(formPlugin.MForm), {
|
|
8113
8109
|
ref_key: "configForm",
|
|
8114
8110
|
ref: configForm,
|
|
8115
8111
|
class: vue.normalizeClass(propsPanelSize.value),
|
|
@@ -8121,7 +8117,7 @@
|
|
|
8121
8117
|
onChange: submit,
|
|
8122
8118
|
onError: errorHandler
|
|
8123
8119
|
}, null, 8, ["class", "popper-class", "size", "init-values", "config", "extend-state"]),
|
|
8124
|
-
!_ctx.disabledShowSrc ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8120
|
+
!_ctx.disabledShowSrc ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
8125
8121
|
key: 0,
|
|
8126
8122
|
class: "m-editor-props-panel-src-icon",
|
|
8127
8123
|
circle: "",
|
|
@@ -8165,10 +8161,11 @@
|
|
|
8165
8161
|
timer && clearTimeout(timer);
|
|
8166
8162
|
timer = setTimeout(() => {
|
|
8167
8163
|
emit("search", filterText.value);
|
|
8164
|
+
timer = null;
|
|
8168
8165
|
}, 300);
|
|
8169
8166
|
};
|
|
8170
8167
|
return (_ctx, _cache) => {
|
|
8171
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
8168
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicInput), {
|
|
8172
8169
|
modelValue: filterText.value,
|
|
8173
8170
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
8174
8171
|
class: "search-input",
|
|
@@ -8178,7 +8175,7 @@
|
|
|
8178
8175
|
onInput: filterTextChangeHandler
|
|
8179
8176
|
}, {
|
|
8180
8177
|
prefix: vue.withCtx(() => [
|
|
8181
|
-
vue.createVNode(vue.unref(
|
|
8178
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), null, {
|
|
8182
8179
|
default: vue.withCtx(() => [
|
|
8183
8180
|
vue.createVNode(vue.unref(iconsVue.Search))
|
|
8184
8181
|
]),
|
|
@@ -8208,7 +8205,8 @@
|
|
|
8208
8205
|
parent: {},
|
|
8209
8206
|
parentsId: { default: () => [] },
|
|
8210
8207
|
nodeStatusMap: {},
|
|
8211
|
-
indent: { default: 0 }
|
|
8208
|
+
indent: { default: 0 },
|
|
8209
|
+
nextLevelIndentIncrement: { default: 11 }
|
|
8212
8210
|
},
|
|
8213
8211
|
emits: ["node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
8214
8212
|
setup(__props, { emit: __emit }) {
|
|
@@ -8301,7 +8299,7 @@
|
|
|
8301
8299
|
parent: _ctx.data,
|
|
8302
8300
|
parentsId: [..._ctx.parentsId, _ctx.data.id],
|
|
8303
8301
|
"node-status-map": _ctx.nodeStatusMap,
|
|
8304
|
-
indent: _ctx.indent +
|
|
8302
|
+
indent: _ctx.indent + _ctx.nextLevelIndentIncrement
|
|
8305
8303
|
}, {
|
|
8306
8304
|
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
8307
8305
|
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
@@ -8336,6 +8334,7 @@
|
|
|
8336
8334
|
data: {},
|
|
8337
8335
|
nodeStatusMap: {},
|
|
8338
8336
|
indent: { default: 0 },
|
|
8337
|
+
nextLevelIndentIncrement: {},
|
|
8339
8338
|
emptyText: { default: "暂无数据" }
|
|
8340
8339
|
},
|
|
8341
8340
|
emits: ["node-dragover", "node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
@@ -8355,6 +8354,7 @@
|
|
|
8355
8354
|
key: item.id,
|
|
8356
8355
|
data: item,
|
|
8357
8356
|
indent: _ctx.indent,
|
|
8357
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8358
8358
|
"node-status-map": _ctx.nodeStatusMap
|
|
8359
8359
|
}, {
|
|
8360
8360
|
"tree-node-content": vue.withCtx(({ data: nodeData }) => [
|
|
@@ -8367,7 +8367,7 @@
|
|
|
8367
8367
|
vue.renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
8368
8368
|
]),
|
|
8369
8369
|
_: 2
|
|
8370
|
-
}, 1032, ["data", "indent", "node-status-map"]);
|
|
8370
|
+
}, 1032, ["data", "indent", "next-level-indent-increment", "node-status-map"]);
|
|
8371
8371
|
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
8372
8372
|
vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
8373
8373
|
]))
|
|
@@ -8382,6 +8382,8 @@
|
|
|
8382
8382
|
},
|
|
8383
8383
|
__name: "CodeBlockList",
|
|
8384
8384
|
props: {
|
|
8385
|
+
indent: {},
|
|
8386
|
+
nextLevelIndentIncrement: {},
|
|
8385
8387
|
customError: { type: Function }
|
|
8386
8388
|
},
|
|
8387
8389
|
emits: ["edit", "remove"],
|
|
@@ -8392,7 +8394,7 @@
|
|
|
8392
8394
|
const { codeBlockService, depService, editorService } = services || {};
|
|
8393
8395
|
const codeList = vue.computed(
|
|
8394
8396
|
() => Object.entries(codeBlockService?.getCodeDsl() || {}).map(([codeId, code]) => {
|
|
8395
|
-
const target = depService?.getTarget(codeId,
|
|
8397
|
+
const target = depService?.getTarget(codeId, core.DepTargetType.CODE_BLOCK);
|
|
8396
8398
|
const pageList = editorService?.get("root")?.items.map((page) => ({
|
|
8397
8399
|
name: page.devconfig?.tabName || page.name,
|
|
8398
8400
|
type: "node",
|
|
@@ -8454,7 +8456,7 @@
|
|
|
8454
8456
|
const existBinds = Boolean(currentCode?.items?.length);
|
|
8455
8457
|
const undeleteableList = codeBlockService?.getUndeletableList() || [];
|
|
8456
8458
|
if (!existBinds && !undeleteableList.includes(id)) {
|
|
8457
|
-
await
|
|
8459
|
+
await designPlugin.tMagicMessageBox.confirm("确定删除该代码块吗?", "提示", {
|
|
8458
8460
|
confirmButtonText: "确定",
|
|
8459
8461
|
cancelButtonText: "取消",
|
|
8460
8462
|
type: "warning"
|
|
@@ -8464,7 +8466,7 @@
|
|
|
8464
8466
|
if (typeof props.customError === "function") {
|
|
8465
8467
|
props.customError(id, existBinds ? CodeDeleteErrorType.BIND : CodeDeleteErrorType.UNDELETEABLE);
|
|
8466
8468
|
} else {
|
|
8467
|
-
|
|
8469
|
+
designPlugin.tMagicMessage.error("代码块删除失败");
|
|
8468
8470
|
}
|
|
8469
8471
|
}
|
|
8470
8472
|
};
|
|
@@ -8475,6 +8477,8 @@
|
|
|
8475
8477
|
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
8476
8478
|
data: codeList.value,
|
|
8477
8479
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
8480
|
+
indent: _ctx.indent,
|
|
8481
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8478
8482
|
onNodeClick: clickHandler
|
|
8479
8483
|
}, {
|
|
8480
8484
|
"tree-node-label": vue.withCtx(({ data }) => [
|
|
@@ -8487,7 +8491,7 @@
|
|
|
8487
8491
|
}, vue.toDisplayString(data.name) + " " + vue.toDisplayString(data.key ? `(${data.key})` : ""), 3)
|
|
8488
8492
|
]),
|
|
8489
8493
|
"tree-node-tool": vue.withCtx(({ data }) => [
|
|
8490
|
-
data.type === "code" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8494
|
+
data.type === "code" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8491
8495
|
key: 0,
|
|
8492
8496
|
effect: "dark",
|
|
8493
8497
|
content: editable.value ? "编辑" : "查看",
|
|
@@ -8502,7 +8506,7 @@
|
|
|
8502
8506
|
]),
|
|
8503
8507
|
_: 2
|
|
8504
8508
|
}, 1032, ["content"])) : vue.createCommentVNode("", true),
|
|
8505
|
-
data.type === "code" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8509
|
+
data.type === "code" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8506
8510
|
key: 1,
|
|
8507
8511
|
effect: "dark",
|
|
8508
8512
|
content: "删除",
|
|
@@ -8523,7 +8527,7 @@
|
|
|
8523
8527
|
})
|
|
8524
8528
|
]),
|
|
8525
8529
|
_: 3
|
|
8526
|
-
}, 8, ["data", "node-status-map"]);
|
|
8530
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment"]);
|
|
8527
8531
|
};
|
|
8528
8532
|
}
|
|
8529
8533
|
});
|
|
@@ -8535,6 +8539,8 @@
|
|
|
8535
8539
|
},
|
|
8536
8540
|
__name: "CodeBlockListPanel",
|
|
8537
8541
|
props: {
|
|
8542
|
+
indent: {},
|
|
8543
|
+
nextLevelIndentIncrement: {},
|
|
8538
8544
|
customError: { type: Function }
|
|
8539
8545
|
},
|
|
8540
8546
|
setup(__props) {
|
|
@@ -8551,12 +8557,12 @@
|
|
|
8551
8557
|
});
|
|
8552
8558
|
return (_ctx, _cache) => {
|
|
8553
8559
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
8554
|
-
vue.createVNode(vue.unref(
|
|
8560
|
+
vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-layer-panel" }, {
|
|
8555
8561
|
default: vue.withCtx(() => [
|
|
8556
8562
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
8557
8563
|
vue.createElementVNode("div", _hoisted_1$7, [
|
|
8558
8564
|
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
8559
|
-
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8565
|
+
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
|
|
8560
8566
|
key: 0,
|
|
8561
8567
|
class: "create-code-button",
|
|
8562
8568
|
type: "primary",
|
|
@@ -8575,6 +8581,8 @@
|
|
|
8575
8581
|
ref_key: "codeBlockList",
|
|
8576
8582
|
ref: codeBlockList,
|
|
8577
8583
|
"custom-error": _ctx.customError,
|
|
8584
|
+
indent: _ctx.indent,
|
|
8585
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8578
8586
|
onEdit: vue.unref(editCode),
|
|
8579
8587
|
onRemove: vue.unref(deleteCode)
|
|
8580
8588
|
}, {
|
|
@@ -8585,7 +8593,7 @@
|
|
|
8585
8593
|
})
|
|
8586
8594
|
]),
|
|
8587
8595
|
_: 3
|
|
8588
|
-
}, 8, ["custom-error", "onEdit", "onRemove"])
|
|
8596
|
+
}, 8, ["custom-error", "indent", "next-level-indent-increment", "onEdit", "onRemove"])
|
|
8589
8597
|
]),
|
|
8590
8598
|
_: 3
|
|
8591
8599
|
}),
|
|
@@ -8668,7 +8676,7 @@
|
|
|
8668
8676
|
emit("submit", values);
|
|
8669
8677
|
};
|
|
8670
8678
|
const errorHandler = (error) => {
|
|
8671
|
-
|
|
8679
|
+
designPlugin.tMagicMessage.error(error.message);
|
|
8672
8680
|
};
|
|
8673
8681
|
__expose({
|
|
8674
8682
|
show() {
|
|
@@ -8691,7 +8699,7 @@
|
|
|
8691
8699
|
position: vue.unref(boxPosition)
|
|
8692
8700
|
}, {
|
|
8693
8701
|
body: vue.withCtx(() => [
|
|
8694
|
-
vue.createVNode(vue.unref(
|
|
8702
|
+
vue.createVNode(vue.unref(formPlugin.MFormBox), {
|
|
8695
8703
|
"label-width": "80px",
|
|
8696
8704
|
title: _ctx.title,
|
|
8697
8705
|
config: dataSourceConfig.value,
|
|
@@ -8713,15 +8721,19 @@
|
|
|
8713
8721
|
name: "MEditorDataSourceList"
|
|
8714
8722
|
},
|
|
8715
8723
|
__name: "DataSourceList",
|
|
8724
|
+
props: {
|
|
8725
|
+
indent: {},
|
|
8726
|
+
nextLevelIndentIncrement: {}
|
|
8727
|
+
},
|
|
8716
8728
|
emits: ["edit", "remove"],
|
|
8717
8729
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8718
8730
|
const emit = __emit;
|
|
8719
8731
|
const { depService, editorService, dataSourceService } = vue.inject("services") || {};
|
|
8720
8732
|
const editable = vue.computed(() => dataSourceService?.get("editable") ?? true);
|
|
8721
8733
|
const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
|
|
8722
|
-
const dsDep = vue.computed(() => depService?.getTargets(
|
|
8723
|
-
const dsMethodDep = vue.computed(() => depService?.getTargets(
|
|
8724
|
-
const dsCondDep = vue.computed(() => depService?.getTargets(
|
|
8734
|
+
const dsDep = vue.computed(() => depService?.getTargets(core.DepTargetType.DATA_SOURCE) || {});
|
|
8735
|
+
const dsMethodDep = vue.computed(() => depService?.getTargets(core.DepTargetType.DATA_SOURCE_METHOD) || {});
|
|
8736
|
+
const dsCondDep = vue.computed(() => depService?.getTargets(core.DepTargetType.DATA_SOURCE_COND) || {});
|
|
8725
8737
|
const getKeyTreeConfig = (dep, type, parentKey) => dep.keys.map((key) => ({
|
|
8726
8738
|
name: key,
|
|
8727
8739
|
id: `${parentKey}_${key}`,
|
|
@@ -8784,7 +8796,7 @@
|
|
|
8784
8796
|
emit("edit", id);
|
|
8785
8797
|
};
|
|
8786
8798
|
const removeHandler = async (id) => {
|
|
8787
|
-
await
|
|
8799
|
+
await designPlugin.tMagicMessageBox.confirm("确定删除?", "提示", {
|
|
8788
8800
|
confirmButtonText: "确定",
|
|
8789
8801
|
cancelButtonText: "取消",
|
|
8790
8802
|
type: "warning"
|
|
@@ -8808,6 +8820,8 @@
|
|
|
8808
8820
|
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
8809
8821
|
data: list.value,
|
|
8810
8822
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
8823
|
+
indent: _ctx.indent,
|
|
8824
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8811
8825
|
onNodeClick: clickHandler
|
|
8812
8826
|
}, {
|
|
8813
8827
|
"tree-node-label": vue.withCtx(({ data }) => [
|
|
@@ -8820,7 +8834,7 @@
|
|
|
8820
8834
|
}, vue.toDisplayString(data.name) + " " + vue.toDisplayString(data.key ? `(${data.key})` : ""), 3)
|
|
8821
8835
|
]),
|
|
8822
8836
|
"tree-node-tool": vue.withCtx(({ data }) => [
|
|
8823
|
-
data.type === "ds" ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8837
|
+
data.type === "ds" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8824
8838
|
key: 0,
|
|
8825
8839
|
effect: "dark",
|
|
8826
8840
|
content: editable.value ? "编辑" : "查看",
|
|
@@ -8835,7 +8849,7 @@
|
|
|
8835
8849
|
]),
|
|
8836
8850
|
_: 2
|
|
8837
8851
|
}, 1032, ["content"])) : vue.createCommentVNode("", true),
|
|
8838
|
-
data.type === "ds" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8852
|
+
data.type === "ds" && editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
8839
8853
|
key: 1,
|
|
8840
8854
|
effect: "dark",
|
|
8841
8855
|
content: "删除",
|
|
@@ -8853,7 +8867,7 @@
|
|
|
8853
8867
|
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
8854
8868
|
]),
|
|
8855
8869
|
_: 3
|
|
8856
|
-
}, 8, ["data", "node-status-map"]);
|
|
8870
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment"]);
|
|
8857
8871
|
};
|
|
8858
8872
|
}
|
|
8859
8873
|
});
|
|
@@ -8864,6 +8878,10 @@
|
|
|
8864
8878
|
name: "MEditorDataSourceListPanel"
|
|
8865
8879
|
},
|
|
8866
8880
|
__name: "DataSourceListPanel",
|
|
8881
|
+
props: {
|
|
8882
|
+
indent: {},
|
|
8883
|
+
nextLevelIndentIncrement: {}
|
|
8884
|
+
},
|
|
8867
8885
|
setup(__props) {
|
|
8868
8886
|
const eventBus = vue.inject("eventBus");
|
|
8869
8887
|
const { dataSourceService } = vue.inject("services") || {};
|
|
@@ -8901,11 +8919,11 @@
|
|
|
8901
8919
|
});
|
|
8902
8920
|
return (_ctx, _cache) => {
|
|
8903
8921
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
8904
|
-
vue.createVNode(vue.unref(
|
|
8922
|
+
vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
|
|
8905
8923
|
default: vue.withCtx(() => [
|
|
8906
8924
|
vue.createElementVNode("div", _hoisted_1$6, [
|
|
8907
8925
|
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
8908
|
-
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
8926
|
+
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicPopover), {
|
|
8909
8927
|
key: 0,
|
|
8910
8928
|
placement: "right",
|
|
8911
8929
|
trigger: "hover",
|
|
@@ -8913,7 +8931,7 @@
|
|
|
8913
8931
|
"destroy-on-close": true
|
|
8914
8932
|
}, {
|
|
8915
8933
|
reference: vue.withCtx(() => [
|
|
8916
|
-
vue.createVNode(vue.unref(
|
|
8934
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
8917
8935
|
type: "primary",
|
|
8918
8936
|
size: "small"
|
|
8919
8937
|
}, {
|
|
@@ -8944,9 +8962,11 @@
|
|
|
8944
8962
|
vue.createVNode(_sfc_main$i, {
|
|
8945
8963
|
ref_key: "dataSourceList",
|
|
8946
8964
|
ref: dataSourceList,
|
|
8965
|
+
indent: _ctx.indent,
|
|
8966
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8947
8967
|
onEdit: vue.unref(editHandler),
|
|
8948
8968
|
onRemove: removeHandler
|
|
8949
|
-
}, null, 8, ["onEdit"])
|
|
8969
|
+
}, null, 8, ["indent", "next-level-indent-increment", "onEdit"])
|
|
8950
8970
|
]),
|
|
8951
8971
|
_: 3
|
|
8952
8972
|
}),
|
|
@@ -8983,7 +9003,7 @@
|
|
|
8983
9003
|
const subMenu = vue.ref();
|
|
8984
9004
|
const visible = vue.ref(false);
|
|
8985
9005
|
const subMenuData = vue.ref([]);
|
|
8986
|
-
const zIndex =
|
|
9006
|
+
const zIndex = designPlugin.useZIndex();
|
|
8987
9007
|
const curZIndex = vue.ref(0);
|
|
8988
9008
|
const menuPosition = vue.ref({
|
|
8989
9009
|
left: 0,
|
|
@@ -9166,7 +9186,7 @@
|
|
|
9166
9186
|
icon: iconsVue.Delete,
|
|
9167
9187
|
display: (services) => {
|
|
9168
9188
|
const node = services?.editorService?.get("node");
|
|
9169
|
-
return node?.type !==
|
|
9189
|
+
return node?.type !== core.NodeType.ROOT && !utils.isPage(node) && !utils.isPageFragment(node);
|
|
9170
9190
|
},
|
|
9171
9191
|
handler: (services) => {
|
|
9172
9192
|
const nodes = services?.editorService?.get("nodes");
|
|
@@ -9840,6 +9860,8 @@
|
|
|
9840
9860
|
__name: "LayerPanel",
|
|
9841
9861
|
props: {
|
|
9842
9862
|
layerContentMenu: {},
|
|
9863
|
+
indent: {},
|
|
9864
|
+
nextLevelIndentIncrement: {},
|
|
9843
9865
|
customContentMenu: { type: Function }
|
|
9844
9866
|
},
|
|
9845
9867
|
setup(__props) {
|
|
@@ -9878,7 +9900,7 @@
|
|
|
9878
9900
|
highlightHandler: mouseenterHandler
|
|
9879
9901
|
} = useClick(services, isCtrlKeyDown, nodeStatusMap);
|
|
9880
9902
|
return (_ctx, _cache) => {
|
|
9881
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
9903
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
9882
9904
|
default: vue.withCtx(() => [
|
|
9883
9905
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
9884
9906
|
vue.createVNode(_sfc_main$o, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
@@ -9889,6 +9911,8 @@
|
|
|
9889
9911
|
ref: tree,
|
|
9890
9912
|
data: nodeData.value,
|
|
9891
9913
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
9914
|
+
indent: _ctx.indent,
|
|
9915
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
9892
9916
|
onNodeDragover: vue.unref(handleDragOver),
|
|
9893
9917
|
onNodeDragstart: vue.unref(handleDragStart),
|
|
9894
9918
|
onNodeDragleave: vue.unref(handleDragLeave),
|
|
@@ -9909,7 +9933,7 @@
|
|
|
9909
9933
|
vue.renderSlot(_ctx.$slots, "layer-node-label", { data: nodeData2 })
|
|
9910
9934
|
]),
|
|
9911
9935
|
_: 3
|
|
9912
|
-
}, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
9936
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
9913
9937
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
9914
9938
|
vue.createVNode(_sfc_main$e, {
|
|
9915
9939
|
ref_key: "menu",
|
|
@@ -9999,19 +10023,19 @@
|
|
|
9999
10023
|
timeout = stage.value.delayedMarkContainer(e);
|
|
10000
10024
|
};
|
|
10001
10025
|
return (_ctx, _cache) => {
|
|
10002
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
10026
|
+
return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicScrollbar), null, {
|
|
10003
10027
|
default: vue.withCtx(() => [
|
|
10004
10028
|
vue.renderSlot(_ctx.$slots, "component-list-panel-header"),
|
|
10005
10029
|
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
10006
10030
|
vue.renderSlot(_ctx.$slots, "component-list", { componentGroupList: list.value }, () => [
|
|
10007
|
-
vue.createVNode(vue.unref(
|
|
10031
|
+
vue.createVNode(vue.unref(designPlugin.TMagicCollapse), {
|
|
10008
10032
|
class: "ui-component-panel",
|
|
10009
10033
|
"model-value": collapseValue.value
|
|
10010
10034
|
}, {
|
|
10011
10035
|
default: vue.withCtx(() => [
|
|
10012
10036
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
10013
10037
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
10014
|
-
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
10038
|
+
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicCollapseItem), {
|
|
10015
10039
|
key: index,
|
|
10016
10040
|
name: `${index}`
|
|
10017
10041
|
}, {
|
|
@@ -10031,7 +10055,7 @@
|
|
|
10031
10055
|
onDrag: dragHandler
|
|
10032
10056
|
}, [
|
|
10033
10057
|
vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
10034
|
-
vue.createVNode(vue.unref(
|
|
10058
|
+
vue.createVNode(vue.unref(designPlugin.TMagicTooltip), {
|
|
10035
10059
|
placement: "right",
|
|
10036
10060
|
disabled: !Boolean(item.desc),
|
|
10037
10061
|
content: item.desc
|
|
@@ -10088,6 +10112,8 @@
|
|
|
10088
10112
|
items: [SideItemKey.COMPONENT_LIST, SideItemKey.LAYER, SideItemKey.CODE_BLOCK, SideItemKey.DATA_SOURCE]
|
|
10089
10113
|
}) },
|
|
10090
10114
|
layerContentMenu: {},
|
|
10115
|
+
indent: {},
|
|
10116
|
+
nextLevelIndentIncrement: {},
|
|
10091
10117
|
customContentMenu: {}
|
|
10092
10118
|
},
|
|
10093
10119
|
setup(__props, { expose: __expose }) {
|
|
@@ -10128,7 +10154,9 @@
|
|
|
10128
10154
|
text: "已选组件",
|
|
10129
10155
|
props: {
|
|
10130
10156
|
layerContentMenu: props.layerContentMenu,
|
|
10131
|
-
customContentMenu: props.customContentMenu
|
|
10157
|
+
customContentMenu: props.customContentMenu,
|
|
10158
|
+
indent: props.indent,
|
|
10159
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10132
10160
|
},
|
|
10133
10161
|
component: _sfc_main$c,
|
|
10134
10162
|
slots: {}
|
|
@@ -10139,6 +10167,10 @@
|
|
|
10139
10167
|
icon: iconsVue.EditPen,
|
|
10140
10168
|
text: "代码编辑",
|
|
10141
10169
|
component: _sfc_main$k,
|
|
10170
|
+
props: {
|
|
10171
|
+
indent: props.indent,
|
|
10172
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10173
|
+
},
|
|
10142
10174
|
slots: {}
|
|
10143
10175
|
},
|
|
10144
10176
|
[SideItemKey.DATA_SOURCE]: {
|
|
@@ -10147,6 +10179,10 @@
|
|
|
10147
10179
|
icon: iconsVue.Coin,
|
|
10148
10180
|
text: "数据源",
|
|
10149
10181
|
component: _sfc_main$h,
|
|
10182
|
+
props: {
|
|
10183
|
+
indent: props.indent,
|
|
10184
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10185
|
+
},
|
|
10150
10186
|
slots: {}
|
|
10151
10187
|
}
|
|
10152
10188
|
};
|
|
@@ -10648,7 +10684,7 @@
|
|
|
10648
10684
|
});
|
|
10649
10685
|
return (_ctx, _cache) => {
|
|
10650
10686
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
10651
|
-
page.value && buttonVisible.value ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
10687
|
+
page.value && buttonVisible.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
|
|
10652
10688
|
key: 0,
|
|
10653
10689
|
content: "点击查看当前位置下的组件"
|
|
10654
10690
|
}, {
|
|
@@ -10723,6 +10759,10 @@
|
|
|
10723
10759
|
contentWindow?.magic.onRuntimeReady({});
|
|
10724
10760
|
}
|
|
10725
10761
|
});
|
|
10762
|
+
vue.onBeforeUnmount(() => {
|
|
10763
|
+
services?.stageOverlayService.get("stage")?.destroy();
|
|
10764
|
+
services?.stageOverlayService.set("stage", null);
|
|
10765
|
+
});
|
|
10726
10766
|
const closeOverlayHandler = () => {
|
|
10727
10767
|
services?.stageOverlayService.closeOverlay();
|
|
10728
10768
|
};
|
|
@@ -10732,7 +10772,7 @@
|
|
|
10732
10772
|
class: "m-editor-stage-overlay",
|
|
10733
10773
|
onClick: closeOverlayHandler
|
|
10734
10774
|
}, [
|
|
10735
|
-
vue.createVNode(vue.unref(
|
|
10775
|
+
vue.createVNode(vue.unref(designPlugin.TMagicIcon), {
|
|
10736
10776
|
class: "m-editor-stage-overlay-close",
|
|
10737
10777
|
size: "20",
|
|
10738
10778
|
onClick: closeOverlayHandler
|
|
@@ -10906,7 +10946,7 @@
|
|
|
10906
10946
|
const layout = await editorService.getLayout(parent.value);
|
|
10907
10947
|
const isLayoutConform = [Layout.ABSOLUTE, Layout.FIXED].includes(layout);
|
|
10908
10948
|
const isTypeConform = nodes.value?.every(
|
|
10909
|
-
(selectedNode) => ![
|
|
10949
|
+
(selectedNode) => ![core.NodeType.ROOT, core.NodeType.PAGE, "pop"].includes(`${selectedNode?.type}`)
|
|
10910
10950
|
);
|
|
10911
10951
|
canCenter.value = isLayoutConform && !!isTypeConform;
|
|
10912
10952
|
},
|
|
@@ -10974,6 +11014,9 @@
|
|
|
10974
11014
|
});
|
|
10975
11015
|
});
|
|
10976
11016
|
});
|
|
11017
|
+
vue.onBeforeUnmount(() => {
|
|
11018
|
+
stage?.destroy();
|
|
11019
|
+
});
|
|
10977
11020
|
vue.watch(zoom, (zoom2) => {
|
|
10978
11021
|
if (!stage || !zoom2) return;
|
|
10979
11022
|
stage.setZoom(zoom2);
|
|
@@ -11014,7 +11057,7 @@
|
|
|
11014
11057
|
services?.keybindingService.unregisterEl("stage");
|
|
11015
11058
|
services?.editorService.off("root-change", rootChangeHandler);
|
|
11016
11059
|
});
|
|
11017
|
-
const parseDSL =
|
|
11060
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
11018
11061
|
const contextmenuHandler = (e) => {
|
|
11019
11062
|
e.preventDefault();
|
|
11020
11063
|
menu.value?.show(e);
|
|
@@ -11144,7 +11187,7 @@
|
|
|
11144
11187
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
11145
11188
|
key: item.id
|
|
11146
11189
|
}, [
|
|
11147
|
-
vue.createVNode(vue.unref(
|
|
11190
|
+
vue.createVNode(vue.unref(designPlugin.TMagicButton), {
|
|
11148
11191
|
link: "",
|
|
11149
11192
|
disabled: item.id === node.value?.id,
|
|
11150
11193
|
onClick: ($event) => select(item)
|
|
@@ -11265,7 +11308,7 @@
|
|
|
11265
11308
|
if (codeDsl[id] && !force) return;
|
|
11266
11309
|
const codeConfigProcessed = lodashEs.cloneDeep(codeConfig);
|
|
11267
11310
|
if (codeConfigProcessed.content) {
|
|
11268
|
-
const parseDSL =
|
|
11311
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
11269
11312
|
if (typeof codeConfigProcessed.content === "string") {
|
|
11270
11313
|
codeConfigProcessed.content = parseDSL(codeConfigProcessed.content);
|
|
11271
11314
|
}
|
|
@@ -11387,10 +11430,10 @@
|
|
|
11387
11430
|
const copyNodes = Array.isArray(config) ? config : [config];
|
|
11388
11431
|
const copyData = {};
|
|
11389
11432
|
if (collectorOptions && typeof collectorOptions.isTarget === "function") {
|
|
11390
|
-
const customTarget = new
|
|
11433
|
+
const customTarget = new core.Target({
|
|
11391
11434
|
...collectorOptions
|
|
11392
11435
|
});
|
|
11393
|
-
const coperWatcher = new
|
|
11436
|
+
const coperWatcher = new core.Watcher();
|
|
11394
11437
|
coperWatcher.addTarget(customTarget);
|
|
11395
11438
|
coperWatcher.collect(copyNodes, {}, true, collectorOptions.type);
|
|
11396
11439
|
Object.keys(customTarget.deps).forEach((nodeId) => {
|
|
@@ -11574,10 +11617,10 @@
|
|
|
11574
11617
|
const copyNodes = Array.isArray(config) ? config : [config];
|
|
11575
11618
|
const copyData = [];
|
|
11576
11619
|
if (collectorOptions && typeof collectorOptions.isTarget === "function") {
|
|
11577
|
-
const customTarget = new
|
|
11620
|
+
const customTarget = new core.Target({
|
|
11578
11621
|
...collectorOptions
|
|
11579
11622
|
});
|
|
11580
|
-
const coperWatcher = new
|
|
11623
|
+
const coperWatcher = new core.Watcher();
|
|
11581
11624
|
coperWatcher.addTarget(customTarget);
|
|
11582
11625
|
coperWatcher.collect(copyNodes, {}, true, collectorOptions.type);
|
|
11583
11626
|
Object.keys(customTarget.deps).forEach((nodeId) => {
|
|
@@ -11616,8 +11659,8 @@
|
|
|
11616
11659
|
|
|
11617
11660
|
const idleTask = new IdleTask();
|
|
11618
11661
|
class Dep extends BaseService {
|
|
11619
|
-
watcher = new
|
|
11620
|
-
removeTargets(type =
|
|
11662
|
+
watcher = new core.Watcher({ initialTargets: vue.reactive({}) });
|
|
11663
|
+
removeTargets(type = core.DepTargetType.DEFAULT) {
|
|
11621
11664
|
this.watcher.removeTargets(type);
|
|
11622
11665
|
const targets = this.watcher.getTargets(type);
|
|
11623
11666
|
if (!targets) return;
|
|
@@ -11625,17 +11668,17 @@
|
|
|
11625
11668
|
this.emit("remove-target", target.id);
|
|
11626
11669
|
}
|
|
11627
11670
|
}
|
|
11628
|
-
getTargets(type =
|
|
11671
|
+
getTargets(type = core.DepTargetType.DEFAULT) {
|
|
11629
11672
|
return this.watcher.getTargets(type);
|
|
11630
11673
|
}
|
|
11631
|
-
getTarget(id, type =
|
|
11674
|
+
getTarget(id, type = core.DepTargetType.DEFAULT) {
|
|
11632
11675
|
return this.watcher.getTarget(id, type);
|
|
11633
11676
|
}
|
|
11634
11677
|
addTarget(target) {
|
|
11635
11678
|
this.watcher.addTarget(target);
|
|
11636
11679
|
this.emit("add-target", target);
|
|
11637
11680
|
}
|
|
11638
|
-
removeTarget(id, type =
|
|
11681
|
+
removeTarget(id, type = core.DepTargetType.DEFAULT) {
|
|
11639
11682
|
this.watcher.removeTarget(id, type);
|
|
11640
11683
|
this.emit("remove-target", id);
|
|
11641
11684
|
}
|
|
@@ -11683,10 +11726,10 @@
|
|
|
11683
11726
|
clearByType(type, nodes) {
|
|
11684
11727
|
return this.watcher.clearByType(type, nodes);
|
|
11685
11728
|
}
|
|
11686
|
-
hasTarget(id, type =
|
|
11729
|
+
hasTarget(id, type = core.DepTargetType.DEFAULT) {
|
|
11687
11730
|
return this.watcher.hasTarget(id, type);
|
|
11688
11731
|
}
|
|
11689
|
-
hasSpecifiedTypeTarget(type =
|
|
11732
|
+
hasSpecifiedTypeTarget(type = core.DepTargetType.DEFAULT) {
|
|
11690
11733
|
return this.watcher.hasSpecifiedTypeTarget(type);
|
|
11691
11734
|
}
|
|
11692
11735
|
on(eventName, listener) {
|
|
@@ -12263,9 +12306,9 @@
|
|
|
12263
12306
|
value.dataSources = value.dataSources || [];
|
|
12264
12307
|
codeBlockService.setCodeDsl(value.codeBlocks);
|
|
12265
12308
|
dataSourceService.set("dataSources", value.dataSources);
|
|
12266
|
-
depService.removeTargets(
|
|
12309
|
+
depService.removeTargets(core.DepTargetType.CODE_BLOCK);
|
|
12267
12310
|
Object.entries(value.codeBlocks).forEach(([id, code]) => {
|
|
12268
|
-
depService.addTarget(
|
|
12311
|
+
depService.addTarget(core.createCodeBlockTarget(id, code));
|
|
12269
12312
|
});
|
|
12270
12313
|
dataSourceService.get("dataSources").forEach((ds) => {
|
|
12271
12314
|
initDataSourceDepTarget(ds);
|
|
@@ -12308,13 +12351,13 @@
|
|
|
12308
12351
|
const targetAddHandler = (target) => {
|
|
12309
12352
|
const root = editorService.get("root");
|
|
12310
12353
|
if (!root) return;
|
|
12311
|
-
if (target.type ===
|
|
12354
|
+
if (target.type === core.DepTargetType.DATA_SOURCE) {
|
|
12312
12355
|
if (!root.dataSourceDeps) {
|
|
12313
12356
|
root.dataSourceDeps = {};
|
|
12314
12357
|
}
|
|
12315
12358
|
root.dataSourceDeps[target.id] = target.deps;
|
|
12316
12359
|
}
|
|
12317
|
-
if (target.type ===
|
|
12360
|
+
if (target.type === core.DepTargetType.DATA_SOURCE_COND) {
|
|
12318
12361
|
if (!root.dataSourceCondDeps) {
|
|
12319
12362
|
root.dataSourceCondDeps = {};
|
|
12320
12363
|
}
|
|
@@ -12370,9 +12413,9 @@
|
|
|
12370
12413
|
depService.on("remove-target", targetRemoveHandler);
|
|
12371
12414
|
depService.on("collected", collectedHandler);
|
|
12372
12415
|
const initDataSourceDepTarget = (ds) => {
|
|
12373
|
-
depService.addTarget(
|
|
12374
|
-
depService.addTarget(
|
|
12375
|
-
depService.addTarget(
|
|
12416
|
+
depService.addTarget(core.createDataSourceTarget(ds, vue.reactive({})));
|
|
12417
|
+
depService.addTarget(core.createDataSourceMethodTarget(ds, vue.reactive({})));
|
|
12418
|
+
depService.addTarget(core.createDataSourceCondTarget(ds, vue.reactive({})));
|
|
12376
12419
|
};
|
|
12377
12420
|
const collectIdle = (nodes, deep) => {
|
|
12378
12421
|
nodes.forEach((node) => {
|
|
@@ -12404,14 +12447,14 @@
|
|
|
12404
12447
|
editorService.on("remove", nodeRemoveHandler);
|
|
12405
12448
|
editorService.on("update", nodeUpdateHandler);
|
|
12406
12449
|
const codeBlockAddOrUpdateHandler = (id, codeBlock) => {
|
|
12407
|
-
if (depService.hasTarget(id,
|
|
12408
|
-
depService.getTarget(id,
|
|
12450
|
+
if (depService.hasTarget(id, core.DepTargetType.CODE_BLOCK)) {
|
|
12451
|
+
depService.getTarget(id, core.DepTargetType.CODE_BLOCK).name = codeBlock.name;
|
|
12409
12452
|
return;
|
|
12410
12453
|
}
|
|
12411
|
-
depService.addTarget(
|
|
12454
|
+
depService.addTarget(core.createCodeBlockTarget(id, codeBlock));
|
|
12412
12455
|
};
|
|
12413
12456
|
const codeBlockRemoveHandler = (id) => {
|
|
12414
|
-
depService.removeTarget(id,
|
|
12457
|
+
depService.removeTarget(id, core.DepTargetType.CODE_BLOCK);
|
|
12415
12458
|
};
|
|
12416
12459
|
codeBlockService.on("addOrUpdate", codeBlockAddOrUpdateHandler);
|
|
12417
12460
|
codeBlockService.on("remove", codeBlockRemoveHandler);
|
|
@@ -12426,9 +12469,9 @@
|
|
|
12426
12469
|
collectIdle(root?.items || [], true);
|
|
12427
12470
|
};
|
|
12428
12471
|
const removeDataSourceTarget = (id) => {
|
|
12429
|
-
depService.removeTarget(id,
|
|
12430
|
-
depService.removeTarget(id,
|
|
12431
|
-
depService.removeTarget(id,
|
|
12472
|
+
depService.removeTarget(id, core.DepTargetType.DATA_SOURCE);
|
|
12473
|
+
depService.removeTarget(id, core.DepTargetType.DATA_SOURCE_COND);
|
|
12474
|
+
depService.removeTarget(id, core.DepTargetType.DATA_SOURCE_METHOD);
|
|
12432
12475
|
};
|
|
12433
12476
|
const dataSourceRemoveHandler = (id) => {
|
|
12434
12477
|
removeDataSourceTarget(id);
|
|
@@ -12489,6 +12532,8 @@
|
|
|
12489
12532
|
disabledPageFragment: { type: Boolean },
|
|
12490
12533
|
disabledStageOverlay: { type: Boolean },
|
|
12491
12534
|
disabledShowSrc: { type: Boolean },
|
|
12535
|
+
indent: {},
|
|
12536
|
+
nextLevelIndentIncrement: {},
|
|
12492
12537
|
render: { type: Function },
|
|
12493
12538
|
updateDragEl: { type: Function },
|
|
12494
12539
|
canSelect: { type: Function },
|
|
@@ -12565,7 +12610,9 @@
|
|
|
12565
12610
|
vue.createVNode(_sfc_main$a, {
|
|
12566
12611
|
data: _ctx.sidebar,
|
|
12567
12612
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
12568
|
-
"custom-content-menu": _ctx.customContentMenu
|
|
12613
|
+
"custom-content-menu": _ctx.customContentMenu,
|
|
12614
|
+
indent: _ctx.indent,
|
|
12615
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement
|
|
12569
12616
|
}, {
|
|
12570
12617
|
"layer-panel-header": vue.withCtx(() => [
|
|
12571
12618
|
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
@@ -12607,7 +12654,7 @@
|
|
|
12607
12654
|
vue.renderSlot(_ctx.$slots, "data-source-panel-search")
|
|
12608
12655
|
]),
|
|
12609
12656
|
_: 3
|
|
12610
|
-
}, 8, ["data", "layer-content-menu", "custom-content-menu"])
|
|
12657
|
+
}, 8, ["data", "layer-content-menu", "custom-content-menu", "indent", "next-level-indent-increment"])
|
|
12611
12658
|
])
|
|
12612
12659
|
]),
|
|
12613
12660
|
workspace: vue.withCtx(() => [
|
|
@@ -12677,8 +12724,11 @@
|
|
|
12677
12724
|
const index = {
|
|
12678
12725
|
install: (app, opt) => {
|
|
12679
12726
|
const option = Object.assign(defaultInstallOpt, opt || {});
|
|
12727
|
+
app.use(designPlugin, opt || {});
|
|
12728
|
+
app.use(formPlugin, opt || {});
|
|
12729
|
+
app.use(tablePlugin);
|
|
12680
12730
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
12681
|
-
|
|
12731
|
+
setEditorConfig(option);
|
|
12682
12732
|
app.component(`${_sfc_main.name || "MEditor"}`, _sfc_main);
|
|
12683
12733
|
app.component("magic-code-editor", _sfc_main$X);
|
|
12684
12734
|
app.component("m-fields-ui-select", _sfc_main$B);
|
|
@@ -12701,10 +12751,14 @@
|
|
|
12701
12751
|
}
|
|
12702
12752
|
};
|
|
12703
12753
|
|
|
12754
|
+
exports.designPlugin = designPlugin;
|
|
12755
|
+
exports.formPlugin = formPlugin;
|
|
12756
|
+
exports.tablePlugin = tablePlugin;
|
|
12704
12757
|
Object.defineProperty(exports, "DepTargetType", {
|
|
12705
12758
|
enumerable: true,
|
|
12706
|
-
get: () =>
|
|
12759
|
+
get: () => core.DepTargetType
|
|
12707
12760
|
});
|
|
12761
|
+
exports.StageCore = StageCore;
|
|
12708
12762
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
12709
12763
|
exports.COPY_CODE_STORAGE_KEY = COPY_CODE_STORAGE_KEY;
|
|
12710
12764
|
exports.COPY_DS_STORAGE_KEY = COPY_DS_STORAGE_KEY;
|
|
@@ -12778,9 +12832,9 @@
|
|
|
12778
12832
|
exports.generatePageNameByApp = generatePageNameByApp;
|
|
12779
12833
|
exports.getAddParent = getAddParent;
|
|
12780
12834
|
exports.getCascaderOptionsFromFields = getCascaderOptionsFromFields;
|
|
12781
|
-
exports.getConfig = getConfig;
|
|
12782
12835
|
exports.getDefaultConfig = getDefaultConfig;
|
|
12783
12836
|
exports.getDisplayField = getDisplayField;
|
|
12837
|
+
exports.getEditorConfig = getEditorConfig;
|
|
12784
12838
|
exports.getFormConfig = getFormConfig;
|
|
12785
12839
|
exports.getFormValue = getFormValue;
|
|
12786
12840
|
exports.getGuideLineFromCache = getGuideLineFromCache;
|
|
@@ -12793,7 +12847,6 @@
|
|
|
12793
12847
|
exports.getRelativeStyle = getRelativeStyle;
|
|
12794
12848
|
exports.historyService = historyService;
|
|
12795
12849
|
exports.info = info;
|
|
12796
|
-
exports.isFixed = isFixed;
|
|
12797
12850
|
exports.log = log;
|
|
12798
12851
|
exports.moveItemsInContainer = moveItemsInContainer;
|
|
12799
12852
|
exports.numberOptions = numberOptions;
|
|
@@ -12801,7 +12854,7 @@
|
|
|
12801
12854
|
exports.removeDataSourceFieldPrefix = removeDataSourceFieldPrefix;
|
|
12802
12855
|
exports.serializeConfig = serializeConfig;
|
|
12803
12856
|
exports.setChildrenLayout = setChildrenLayout;
|
|
12804
|
-
exports.
|
|
12857
|
+
exports.setEditorConfig = setEditorConfig;
|
|
12805
12858
|
exports.setLayout = setLayout;
|
|
12806
12859
|
exports.stageOverlayService = stageOverlayService;
|
|
12807
12860
|
exports.storageService = storageService;
|
|
@@ -12820,6 +12873,36 @@
|
|
|
12820
12873
|
exports.useStage = useStage;
|
|
12821
12874
|
exports.useWindowRect = useWindowRect;
|
|
12822
12875
|
exports.warn = warn;
|
|
12876
|
+
Object.keys(designPlugin).forEach(k => {
|
|
12877
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12878
|
+
enumerable: true,
|
|
12879
|
+
get: () => designPlugin[k]
|
|
12880
|
+
});
|
|
12881
|
+
});
|
|
12882
|
+
Object.keys(formPlugin).forEach(k => {
|
|
12883
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12884
|
+
enumerable: true,
|
|
12885
|
+
get: () => formPlugin[k]
|
|
12886
|
+
});
|
|
12887
|
+
});
|
|
12888
|
+
Object.keys(tablePlugin).forEach(k => {
|
|
12889
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12890
|
+
enumerable: true,
|
|
12891
|
+
get: () => tablePlugin[k]
|
|
12892
|
+
});
|
|
12893
|
+
});
|
|
12894
|
+
Object.keys(utils).forEach(k => {
|
|
12895
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12896
|
+
enumerable: true,
|
|
12897
|
+
get: () => utils[k]
|
|
12898
|
+
});
|
|
12899
|
+
});
|
|
12900
|
+
Object.keys(StageCore).forEach(k => {
|
|
12901
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12902
|
+
enumerable: true,
|
|
12903
|
+
get: () => StageCore[k]
|
|
12904
|
+
});
|
|
12905
|
+
});
|
|
12823
12906
|
|
|
12824
12907
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
12825
12908
|
|