@tmagic/editor 1.5.11 → 1.5.13
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/tmagic-editor.js +136 -80
- package/dist/tmagic-editor.umd.cjs +141 -179
- package/package.json +7 -7
- package/src/components/CodeBlockEditor.vue +13 -1
- package/src/components/ContentMenu.vue +2 -2
- package/src/initService.ts +33 -11
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +1 -0
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +19 -1
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +13 -1
- package/src/layouts/sidebar/data-source/DataSourceList.vue +1 -0
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +18 -0
- package/src/services/dep.ts +3 -3
- package/src/services/events.ts +1 -1
- package/types/index.d.ts +922 -9767
package/dist/tmagic-editor.js
CHANGED
|
@@ -7,18 +7,18 @@ export { default as formPlugin } from '@tmagic/form';
|
|
|
7
7
|
import tablePlugin__default, { MagicTable } from '@tmagic/table';
|
|
8
8
|
export * from '@tmagic/table';
|
|
9
9
|
export { default as tablePlugin } from '@tmagic/table';
|
|
10
|
-
import { defineComponent,
|
|
11
|
-
import { Edit, FullScreen, View, Close, Coin, Delete, Plus, Grid, ArrowDown, ArrowLeftBold, ArrowRightBold, Files, Search,
|
|
10
|
+
import { defineComponent, createBlock, createElementBlock, openBlock, unref, withCtx, createVNode, createElementVNode, normalizeClass, resolveDynamicComponent, toRaw, ref, useTemplateRef, watch, onMounted, onBeforeUnmount, Teleport, normalizeStyle, computed, reactive, resolveComponent, inject, createCommentVNode, Fragment, renderList, mergeProps, mergeModels, useModel, nextTick, provide, renderSlot, toDisplayString, shallowReactive, createTextVNode, isRef, createStaticVNode, watchEffect, markRaw, withDirectives, vModelText, vShow, shallowRef, withModifiers, toHandlers, createSlots, getCurrentInstance, Transition, resolveDirective, mergeDefaults } from 'vue';
|
|
11
|
+
import { Edit, FullScreen, View, Close, Coin, Delete, Plus, Grid, ArrowDown, ArrowLeftBold, ArrowRightBold, Files, Search, DocumentCopy, CaretBottom, Memo, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Document, Sugar, ArrowRight, CopyDocument, Hide, EditPen, List, Goods, CloseBold, Top, Bottom } from '@element-plus/icons-vue';
|
|
12
12
|
import { throttle, isEmpty, isObject, cloneDeep, mergeWith, uniq, get, map, has, pick, keys } from 'lodash-es';
|
|
13
13
|
import serialize from 'serialize-javascript';
|
|
14
14
|
import { emmetHTML, emmetCSS } from 'emmet-monaco-es';
|
|
15
15
|
import * as monaco from 'monaco-editor';
|
|
16
|
-
import { HookCodeType, HookType, NODE_CONDS_KEY, Target, Watcher, NodeType, ActionType, DepTargetType, createCodeBlockTarget, createDataSourceTarget,
|
|
16
|
+
import { HookCodeType, HookType, NODE_CONDS_KEY, Target, Watcher, NodeType, ActionType, DepTargetType, createCodeBlockTarget, createDataSourceTarget, createDataSourceCondTarget, createDataSourceMethodTarget } from '@tmagic/core';
|
|
17
17
|
export { DepTargetType } from '@tmagic/core';
|
|
18
|
-
import { isPage, isPageFragment, isPop, getNodePath, isNumber, getElById, calcValueByFontsize, isValueIncludeDataSource, toLine, guid, getValueByKeyPath, setValueByKeyPath, getNodeInfo, dataSourceTemplateRegExp, getKeysArray,
|
|
18
|
+
import { isPage, isPageFragment, isPop, getNodePath, isNumber, getElById, calcValueByFontsize, isValueIncludeDataSource, toLine, guid, getValueByKeyPath, setValueByKeyPath, getNodeInfo, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, dataSourceTemplateRegExp, getKeysArray, getKeys, convertToNumber, getIdFromEl, traverseNode, getDefaultValueFromFields, DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, removeClassName, addClassName, removeClassNameByClassName, getNodes } from '@tmagic/utils';
|
|
19
19
|
export * from '@tmagic/utils';
|
|
20
20
|
import VanillaMoveable from 'moveable';
|
|
21
|
-
import StageCore__default, { isFixed, GuidesType, getOffset,
|
|
21
|
+
import StageCore__default, { isFixed, GuidesType, getOffset, ContainerHighlightType, CONTAINER_HIGHLIGHT_CLASS_NAME, RenderType } from '@tmagic/stage';
|
|
22
22
|
export * from '@tmagic/stage';
|
|
23
23
|
export { default as StageCore } from '@tmagic/stage';
|
|
24
24
|
import { EventEmitter } from 'events';
|
|
@@ -1454,7 +1454,7 @@ class UndoRedo {
|
|
|
1454
1454
|
class History extends BaseService {
|
|
1455
1455
|
state = reactive({
|
|
1456
1456
|
pageSteps: {},
|
|
1457
|
-
pageId:
|
|
1457
|
+
pageId: void 0,
|
|
1458
1458
|
canRedo: false,
|
|
1459
1459
|
canUndo: false
|
|
1460
1460
|
});
|
|
@@ -1467,7 +1467,7 @@ class History extends BaseService {
|
|
|
1467
1467
|
this.resetPage();
|
|
1468
1468
|
}
|
|
1469
1469
|
resetPage() {
|
|
1470
|
-
this.state.pageId =
|
|
1470
|
+
this.state.pageId = void 0;
|
|
1471
1471
|
this.state.canRedo = false;
|
|
1472
1472
|
this.state.canUndo = false;
|
|
1473
1473
|
}
|
|
@@ -1487,7 +1487,7 @@ class History extends BaseService {
|
|
|
1487
1487
|
this.emit("page-change", this.state.pageSteps[this.state.pageId]);
|
|
1488
1488
|
}
|
|
1489
1489
|
resetState() {
|
|
1490
|
-
this.state.pageId =
|
|
1490
|
+
this.state.pageId = void 0;
|
|
1491
1491
|
this.state.pageSteps = {};
|
|
1492
1492
|
this.state.canRedo = false;
|
|
1493
1493
|
this.state.canUndo = false;
|
|
@@ -1539,7 +1539,6 @@ var Protocol = /* @__PURE__ */ ((Protocol2) => {
|
|
|
1539
1539
|
return Protocol2;
|
|
1540
1540
|
})(Protocol || {});
|
|
1541
1541
|
const canUsePluginMethods$5 = {
|
|
1542
|
-
async: [],
|
|
1543
1542
|
sync: ["getStorage", "getNamespace", "clear", "getItem", "removeItem", "setItem"]
|
|
1544
1543
|
};
|
|
1545
1544
|
class WebStorage extends BaseService {
|
|
@@ -1676,9 +1675,7 @@ const canUsePluginMethods$4 = {
|
|
|
1676
1675
|
"undo",
|
|
1677
1676
|
"redo",
|
|
1678
1677
|
"move"
|
|
1679
|
-
]
|
|
1680
|
-
sync: []
|
|
1681
|
-
};
|
|
1678
|
+
]};
|
|
1682
1679
|
class Editor extends BaseService {
|
|
1683
1680
|
state = reactive({
|
|
1684
1681
|
root: null,
|
|
@@ -3075,7 +3072,7 @@ const updateStatus = (nodeStatusMap, id, status) => {
|
|
|
3075
3072
|
const nodeStatus = nodeStatusMap.get(id);
|
|
3076
3073
|
if (!nodeStatus) return;
|
|
3077
3074
|
getKeys(status).forEach((key) => {
|
|
3078
|
-
if (nodeStatus[key] !==
|
|
3075
|
+
if (nodeStatus[key] !== void 0 && status[key] !== void 0) {
|
|
3079
3076
|
nodeStatus[key] = Boolean(status[key]);
|
|
3080
3077
|
}
|
|
3081
3078
|
});
|
|
@@ -3678,9 +3675,7 @@ const state = shallowReactive({
|
|
|
3678
3675
|
}
|
|
3679
3676
|
});
|
|
3680
3677
|
const canUsePluginMethods$3 = {
|
|
3681
|
-
async: ["zoom", "calcZoom"]
|
|
3682
|
-
sync: []
|
|
3683
|
-
};
|
|
3678
|
+
async: ["zoom", "calcZoom"]};
|
|
3684
3679
|
class Ui extends BaseService {
|
|
3685
3680
|
constructor() {
|
|
3686
3681
|
super(canUsePluginMethods$3.async.map((methodName) => ({ name: methodName, isAsync: true })));
|
|
@@ -5088,7 +5083,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5088
5083
|
"visible": { type: Boolean, ...{ default: false } },
|
|
5089
5084
|
"visibleModifiers": {}
|
|
5090
5085
|
}),
|
|
5091
|
-
emits: /* @__PURE__ */ mergeModels(["submit"], ["update:width", "update:visible"]),
|
|
5086
|
+
emits: /* @__PURE__ */ mergeModels(["submit", "close", "open"], ["update:width", "update:visible"]),
|
|
5092
5087
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5093
5088
|
const width = useModel(__props, "width");
|
|
5094
5089
|
const boxVisible = useModel(__props, "visible");
|
|
@@ -5201,7 +5196,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5201
5196
|
}
|
|
5202
5197
|
]);
|
|
5203
5198
|
const submitForm = (values, data) => {
|
|
5204
|
-
changedValue.value =
|
|
5199
|
+
changedValue.value = void 0;
|
|
5205
5200
|
emit("submit", values, data);
|
|
5206
5201
|
};
|
|
5207
5202
|
const errorHandler = (error) => {
|
|
@@ -5230,10 +5225,19 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5230
5225
|
});
|
|
5231
5226
|
};
|
|
5232
5227
|
const closedHandler = () => {
|
|
5233
|
-
changedValue.value =
|
|
5228
|
+
changedValue.value = void 0;
|
|
5234
5229
|
};
|
|
5235
5230
|
const parentFloating = inject("parentFloating", ref(null));
|
|
5236
5231
|
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(uiService, parentFloating);
|
|
5232
|
+
watch(boxVisible, (visible) => {
|
|
5233
|
+
nextTick(() => {
|
|
5234
|
+
if (!visible) {
|
|
5235
|
+
emit("close");
|
|
5236
|
+
} else {
|
|
5237
|
+
emit("open");
|
|
5238
|
+
}
|
|
5239
|
+
});
|
|
5240
|
+
});
|
|
5237
5241
|
__expose({
|
|
5238
5242
|
async show() {
|
|
5239
5243
|
calcBoxPosition();
|
|
@@ -5498,7 +5502,7 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
5498
5502
|
});
|
|
5499
5503
|
}
|
|
5500
5504
|
editIndex = -1;
|
|
5501
|
-
codeConfig.value =
|
|
5505
|
+
codeConfig.value = void 0;
|
|
5502
5506
|
codeBlockEditorRef.value?.hide();
|
|
5503
5507
|
};
|
|
5504
5508
|
return (_ctx, _cache) => {
|
|
@@ -6850,7 +6854,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
6850
6854
|
return target;
|
|
6851
6855
|
};
|
|
6852
6856
|
|
|
6853
|
-
const _sfc_main$13 = {};
|
|
6857
|
+
const _sfc_main$13 = { };
|
|
6854
6858
|
|
|
6855
6859
|
const _hoisted_1$J = {
|
|
6856
6860
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6864,7 +6868,7 @@ function _sfc_render$k(_ctx, _cache) {
|
|
|
6864
6868
|
}
|
|
6865
6869
|
const BackgroundRepeat = /*#__PURE__*/_export_sfc(_sfc_main$13, [['render',_sfc_render$k]]);
|
|
6866
6870
|
|
|
6867
|
-
const _sfc_main$12 = {};
|
|
6871
|
+
const _sfc_main$12 = { };
|
|
6868
6872
|
|
|
6869
6873
|
const _hoisted_1$I = {
|
|
6870
6874
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6881,7 +6885,7 @@ function _sfc_render$j(_ctx, _cache) {
|
|
|
6881
6885
|
}
|
|
6882
6886
|
const BackgroundRepeatX = /*#__PURE__*/_export_sfc(_sfc_main$12, [['render',_sfc_render$j]]);
|
|
6883
6887
|
|
|
6884
|
-
const _sfc_main$11 = {};
|
|
6888
|
+
const _sfc_main$11 = { };
|
|
6885
6889
|
|
|
6886
6890
|
const _hoisted_1$H = {
|
|
6887
6891
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6898,7 +6902,7 @@ function _sfc_render$i(_ctx, _cache) {
|
|
|
6898
6902
|
}
|
|
6899
6903
|
const BackgroundRepeatY = /*#__PURE__*/_export_sfc(_sfc_main$11, [['render',_sfc_render$i]]);
|
|
6900
6904
|
|
|
6901
|
-
const _sfc_main$10 = {};
|
|
6905
|
+
const _sfc_main$10 = { };
|
|
6902
6906
|
|
|
6903
6907
|
const _hoisted_1$G = {
|
|
6904
6908
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6990,7 +6994,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
|
6990
6994
|
}
|
|
6991
6995
|
});
|
|
6992
6996
|
|
|
6993
|
-
const _sfc_main$_ = {};
|
|
6997
|
+
const _sfc_main$_ = { };
|
|
6994
6998
|
|
|
6995
6999
|
const _hoisted_1$F = {
|
|
6996
7000
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7004,7 +7008,7 @@ function _sfc_render$g(_ctx, _cache) {
|
|
|
7004
7008
|
}
|
|
7005
7009
|
const AlignLeft = /*#__PURE__*/_export_sfc(_sfc_main$_, [['render',_sfc_render$g]]);
|
|
7006
7010
|
|
|
7007
|
-
const _sfc_main$Z = {};
|
|
7011
|
+
const _sfc_main$Z = { };
|
|
7008
7012
|
|
|
7009
7013
|
const _hoisted_1$E = {
|
|
7010
7014
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7018,7 +7022,7 @@ function _sfc_render$f(_ctx, _cache) {
|
|
|
7018
7022
|
}
|
|
7019
7023
|
const AlignCenter = /*#__PURE__*/_export_sfc(_sfc_main$Z, [['render',_sfc_render$f]]);
|
|
7020
7024
|
|
|
7021
|
-
const _sfc_main$Y = {};
|
|
7025
|
+
const _sfc_main$Y = { };
|
|
7022
7026
|
|
|
7023
7027
|
const _hoisted_1$D = {
|
|
7024
7028
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7215,7 +7219,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
7215
7219
|
}
|
|
7216
7220
|
});
|
|
7217
7221
|
|
|
7218
|
-
const _sfc_main$V = {};
|
|
7222
|
+
const _sfc_main$V = { };
|
|
7219
7223
|
|
|
7220
7224
|
const _hoisted_1$B = {
|
|
7221
7225
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7229,7 +7233,7 @@ function _sfc_render$d(_ctx, _cache) {
|
|
|
7229
7233
|
}
|
|
7230
7234
|
const DisplayBlock = /*#__PURE__*/_export_sfc(_sfc_main$V, [['render',_sfc_render$d]]);
|
|
7231
7235
|
|
|
7232
|
-
const _sfc_main$U = {};
|
|
7236
|
+
const _sfc_main$U = { };
|
|
7233
7237
|
|
|
7234
7238
|
const _hoisted_1$A = {
|
|
7235
7239
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7243,7 +7247,7 @@ function _sfc_render$c(_ctx, _cache) {
|
|
|
7243
7247
|
}
|
|
7244
7248
|
const DisplayFlex = /*#__PURE__*/_export_sfc(_sfc_main$U, [['render',_sfc_render$c]]);
|
|
7245
7249
|
|
|
7246
|
-
const _sfc_main$T = {};
|
|
7250
|
+
const _sfc_main$T = { };
|
|
7247
7251
|
|
|
7248
7252
|
const _hoisted_1$z = {
|
|
7249
7253
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7257,7 +7261,7 @@ function _sfc_render$b(_ctx, _cache) {
|
|
|
7257
7261
|
}
|
|
7258
7262
|
const DisplayInline = /*#__PURE__*/_export_sfc(_sfc_main$T, [['render',_sfc_render$b]]);
|
|
7259
7263
|
|
|
7260
|
-
const _sfc_main$S = {};
|
|
7264
|
+
const _sfc_main$S = { };
|
|
7261
7265
|
|
|
7262
7266
|
const _hoisted_1$y = {
|
|
7263
7267
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7271,7 +7275,7 @@ function _sfc_render$a(_ctx, _cache) {
|
|
|
7271
7275
|
}
|
|
7272
7276
|
const DisplayInlineBlock = /*#__PURE__*/_export_sfc(_sfc_main$S, [['render',_sfc_render$a]]);
|
|
7273
7277
|
|
|
7274
|
-
const _sfc_main$R = {};
|
|
7278
|
+
const _sfc_main$R = { };
|
|
7275
7279
|
|
|
7276
7280
|
const _hoisted_1$x = {
|
|
7277
7281
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7285,7 +7289,7 @@ function _sfc_render$9(_ctx, _cache) {
|
|
|
7285
7289
|
}
|
|
7286
7290
|
const DisplayNone = /*#__PURE__*/_export_sfc(_sfc_main$R, [['render',_sfc_render$9]]);
|
|
7287
7291
|
|
|
7288
|
-
const _sfc_main$Q = {};
|
|
7292
|
+
const _sfc_main$Q = { };
|
|
7289
7293
|
|
|
7290
7294
|
const _hoisted_1$w = {
|
|
7291
7295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7299,7 +7303,7 @@ function _sfc_render$8(_ctx, _cache) {
|
|
|
7299
7303
|
}
|
|
7300
7304
|
const FlexDirectionColumn = /*#__PURE__*/_export_sfc(_sfc_main$Q, [['render',_sfc_render$8]]);
|
|
7301
7305
|
|
|
7302
|
-
const _sfc_main$P = {};
|
|
7306
|
+
const _sfc_main$P = { };
|
|
7303
7307
|
|
|
7304
7308
|
const _hoisted_1$v = {
|
|
7305
7309
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7313,7 +7317,7 @@ function _sfc_render$7(_ctx, _cache) {
|
|
|
7313
7317
|
}
|
|
7314
7318
|
const FlexDirectionColumnReverse = /*#__PURE__*/_export_sfc(_sfc_main$P, [['render',_sfc_render$7]]);
|
|
7315
7319
|
|
|
7316
|
-
const _sfc_main$O = {};
|
|
7320
|
+
const _sfc_main$O = { };
|
|
7317
7321
|
|
|
7318
7322
|
const _hoisted_1$u = {
|
|
7319
7323
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7327,7 +7331,7 @@ function _sfc_render$6(_ctx, _cache) {
|
|
|
7327
7331
|
}
|
|
7328
7332
|
const FlexDirectionRow = /*#__PURE__*/_export_sfc(_sfc_main$O, [['render',_sfc_render$6]]);
|
|
7329
7333
|
|
|
7330
|
-
const _sfc_main$N = {};
|
|
7334
|
+
const _sfc_main$N = { };
|
|
7331
7335
|
|
|
7332
7336
|
const _hoisted_1$t = {
|
|
7333
7337
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7341,7 +7345,7 @@ function _sfc_render$5(_ctx, _cache) {
|
|
|
7341
7345
|
}
|
|
7342
7346
|
const FlexDirectionRowReverse = /*#__PURE__*/_export_sfc(_sfc_main$N, [['render',_sfc_render$5]]);
|
|
7343
7347
|
|
|
7344
|
-
const _sfc_main$M = {};
|
|
7348
|
+
const _sfc_main$M = { };
|
|
7345
7349
|
|
|
7346
7350
|
const _hoisted_1$s = {
|
|
7347
7351
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7355,7 +7359,7 @@ function _sfc_render$4(_ctx, _cache) {
|
|
|
7355
7359
|
}
|
|
7356
7360
|
const JustifyContentCenter = /*#__PURE__*/_export_sfc(_sfc_main$M, [['render',_sfc_render$4]]);
|
|
7357
7361
|
|
|
7358
|
-
const _sfc_main$L = {};
|
|
7362
|
+
const _sfc_main$L = { };
|
|
7359
7363
|
|
|
7360
7364
|
const _hoisted_1$r = {
|
|
7361
7365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7369,7 +7373,7 @@ function _sfc_render$3(_ctx, _cache) {
|
|
|
7369
7373
|
}
|
|
7370
7374
|
const JustifyContentFlexEnd = /*#__PURE__*/_export_sfc(_sfc_main$L, [['render',_sfc_render$3]]);
|
|
7371
7375
|
|
|
7372
|
-
const _sfc_main$K = {};
|
|
7376
|
+
const _sfc_main$K = { };
|
|
7373
7377
|
|
|
7374
7378
|
const _hoisted_1$q = {
|
|
7375
7379
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7383,7 +7387,7 @@ function _sfc_render$2(_ctx, _cache) {
|
|
|
7383
7387
|
}
|
|
7384
7388
|
const JustifyContentFlexStart = /*#__PURE__*/_export_sfc(_sfc_main$K, [['render',_sfc_render$2]]);
|
|
7385
7389
|
|
|
7386
|
-
const _sfc_main$J = {};
|
|
7390
|
+
const _sfc_main$J = { };
|
|
7387
7391
|
|
|
7388
7392
|
const _hoisted_1$p = {
|
|
7389
7393
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7397,7 +7401,7 @@ function _sfc_render$1(_ctx, _cache) {
|
|
|
7397
7401
|
}
|
|
7398
7402
|
const JustifyContentSpaceAround = /*#__PURE__*/_export_sfc(_sfc_main$J, [['render',_sfc_render$1]]);
|
|
7399
7403
|
|
|
7400
|
-
const _sfc_main$I = {};
|
|
7404
|
+
const _sfc_main$I = { };
|
|
7401
7405
|
|
|
7402
7406
|
const _hoisted_1$o = {
|
|
7403
7407
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7995,7 +7999,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
7995
7999
|
emit("change", id);
|
|
7996
8000
|
mForm?.$emit("field-change", props.prop, id);
|
|
7997
8001
|
}
|
|
7998
|
-
{
|
|
8002
|
+
if (cancelHandler) {
|
|
7999
8003
|
cancelHandler();
|
|
8000
8004
|
}
|
|
8001
8005
|
};
|
|
@@ -9311,7 +9315,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
9311
9315
|
renderSlot(_ctx.$slots, "props-panel")
|
|
9312
9316
|
]),
|
|
9313
9317
|
key: "0"
|
|
9314
|
-
} :
|
|
9318
|
+
} : void 0
|
|
9315
9319
|
]), 1032, ["left", "right", "min-left", "min-right", "min-center", "width"])),
|
|
9316
9320
|
renderSlot(_ctx.$slots, "content-after"),
|
|
9317
9321
|
renderSlot(_ctx.$slots, "footer")
|
|
@@ -10433,6 +10437,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
10433
10437
|
emit("node-contextmenu", event, data);
|
|
10434
10438
|
};
|
|
10435
10439
|
__expose({
|
|
10440
|
+
nodeStatusMap,
|
|
10436
10441
|
filter: filterTextChangeHandler,
|
|
10437
10442
|
deleteCode
|
|
10438
10443
|
});
|
|
@@ -10594,7 +10599,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10594
10599
|
const eventBus = inject("eventBus");
|
|
10595
10600
|
const { codeBlockService } = useServices();
|
|
10596
10601
|
const editable = computed(() => codeBlockService.getEditStatus());
|
|
10597
|
-
const { codeBlockEditor, codeConfig, editCode, deleteCode, createCodeBlock, submitCodeBlockHandler } = useCodeBlockEdit(codeBlockService);
|
|
10602
|
+
const { codeId, codeBlockEditor, codeConfig, editCode, deleteCode, createCodeBlock, submitCodeBlockHandler } = useCodeBlockEdit(codeBlockService);
|
|
10598
10603
|
const codeBlockListRef = useTemplateRef("codeBlockList");
|
|
10599
10604
|
const filterTextChangeHandler = (val) => {
|
|
10600
10605
|
codeBlockListRef.value?.filter(val);
|
|
@@ -10602,6 +10607,20 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10602
10607
|
eventBus?.on("edit-code", (id) => {
|
|
10603
10608
|
editCode(id);
|
|
10604
10609
|
});
|
|
10610
|
+
const editDialogOpenHandler = () => {
|
|
10611
|
+
if (codeBlockListRef.value) {
|
|
10612
|
+
for (const [statusId, status] of codeBlockListRef.value.nodeStatusMap.entries()) {
|
|
10613
|
+
status.selected = statusId === codeId.value;
|
|
10614
|
+
}
|
|
10615
|
+
}
|
|
10616
|
+
};
|
|
10617
|
+
const editDialogCloseHandler = () => {
|
|
10618
|
+
if (codeBlockListRef.value) {
|
|
10619
|
+
for (const [, status] of codeBlockListRef.value.nodeStatusMap.entries()) {
|
|
10620
|
+
status.selected = false;
|
|
10621
|
+
}
|
|
10622
|
+
}
|
|
10623
|
+
};
|
|
10605
10624
|
const {
|
|
10606
10625
|
nodeContentMenuHandler,
|
|
10607
10626
|
menuData: contentMenuData,
|
|
@@ -10665,7 +10684,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10665
10684
|
ref: codeBlockEditor,
|
|
10666
10685
|
disabled: !editable.value,
|
|
10667
10686
|
content: unref(codeConfig),
|
|
10668
|
-
onSubmit: unref(submitCodeBlockHandler)
|
|
10687
|
+
onSubmit: unref(submitCodeBlockHandler),
|
|
10688
|
+
onClose: editDialogCloseHandler,
|
|
10689
|
+
onOpen: editDialogOpenHandler
|
|
10669
10690
|
}, null, 8, ["disabled", "content", "onSubmit"])) : createCommentVNode("v-if", true),
|
|
10670
10691
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
10671
10692
|
menuData.value.length ? (openBlock(), createBlock(_sfc_main$o, {
|
|
@@ -10730,7 +10751,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
10730
10751
|
"width": { default: 670 },
|
|
10731
10752
|
"widthModifiers": {}
|
|
10732
10753
|
}),
|
|
10733
|
-
emits: /* @__PURE__ */ mergeModels(["submit"], ["update:visible", "update:width"]),
|
|
10754
|
+
emits: /* @__PURE__ */ mergeModels(["submit", "close", "open"], ["update:visible", "update:width"]),
|
|
10734
10755
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
10735
10756
|
const props = __props;
|
|
10736
10757
|
const boxVisible = useModel(__props, "visible");
|
|
@@ -10752,6 +10773,15 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
10752
10773
|
const errorHandler = (error) => {
|
|
10753
10774
|
tMagicMessage.error(error.message);
|
|
10754
10775
|
};
|
|
10776
|
+
watch(boxVisible, (visible) => {
|
|
10777
|
+
nextTick(() => {
|
|
10778
|
+
if (!visible) {
|
|
10779
|
+
emit("close");
|
|
10780
|
+
} else if (initValues.value?.id) {
|
|
10781
|
+
emit("open", initValues.value.id);
|
|
10782
|
+
}
|
|
10783
|
+
});
|
|
10784
|
+
});
|
|
10755
10785
|
__expose({
|
|
10756
10786
|
show() {
|
|
10757
10787
|
calcBoxPosition();
|
|
@@ -10887,6 +10917,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
10887
10917
|
emit("node-contextmenu", event, data);
|
|
10888
10918
|
};
|
|
10889
10919
|
__expose({
|
|
10920
|
+
nodeStatusMap,
|
|
10890
10921
|
filter: filterTextChangeHandler
|
|
10891
10922
|
});
|
|
10892
10923
|
return (_ctx, _cache) => {
|
|
@@ -11042,6 +11073,20 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
11042
11073
|
const eventBus = inject("eventBus");
|
|
11043
11074
|
const { dataSourceService } = useServices();
|
|
11044
11075
|
const { editDialog, dataSourceValues, dialogTitle, editable, editHandler, submitDataSourceHandler } = useDataSourceEdit(dataSourceService);
|
|
11076
|
+
const editDialogOpenHandler = (id) => {
|
|
11077
|
+
if (dataSourceList.value) {
|
|
11078
|
+
for (const [statusId, status] of dataSourceList.value.nodeStatusMap.entries()) {
|
|
11079
|
+
status.selected = statusId === id;
|
|
11080
|
+
}
|
|
11081
|
+
}
|
|
11082
|
+
};
|
|
11083
|
+
const editDialogCloseHandler = () => {
|
|
11084
|
+
if (dataSourceList.value) {
|
|
11085
|
+
for (const [, status] of dataSourceList.value.nodeStatusMap.entries()) {
|
|
11086
|
+
status.selected = false;
|
|
11087
|
+
}
|
|
11088
|
+
}
|
|
11089
|
+
};
|
|
11045
11090
|
const datasourceTypeList = computed(
|
|
11046
11091
|
() => [
|
|
11047
11092
|
{ text: "基础", type: "base" },
|
|
@@ -11158,7 +11203,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
11158
11203
|
disabled: !unref(editable),
|
|
11159
11204
|
values: unref(dataSourceValues),
|
|
11160
11205
|
title: unref(dialogTitle),
|
|
11161
|
-
onSubmit: unref(submitDataSourceHandler)
|
|
11206
|
+
onSubmit: unref(submitDataSourceHandler),
|
|
11207
|
+
onClose: editDialogCloseHandler,
|
|
11208
|
+
onOpen: editDialogOpenHandler
|
|
11162
11209
|
}, null, 8, ["disabled", "values", "title", "onSubmit"]),
|
|
11163
11210
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
11164
11211
|
menuData.value.length ? (openBlock(), createBlock(_sfc_main$o, {
|
|
@@ -12045,7 +12092,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
12045
12092
|
const dragendHandler = () => {
|
|
12046
12093
|
if (timeout) {
|
|
12047
12094
|
globalThis.clearTimeout(timeout);
|
|
12048
|
-
timeout =
|
|
12095
|
+
timeout = void 0;
|
|
12049
12096
|
}
|
|
12050
12097
|
const doc = stage.value?.renderer?.getDocument();
|
|
12051
12098
|
if (doc && stageOptions?.containerHighlightClassName) {
|
|
@@ -12060,7 +12107,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
12060
12107
|
clientY = e.clientY;
|
|
12061
12108
|
if (timeout) {
|
|
12062
12109
|
globalThis.clearTimeout(timeout);
|
|
12063
|
-
timeout =
|
|
12110
|
+
timeout = void 0;
|
|
12064
12111
|
}
|
|
12065
12112
|
return;
|
|
12066
12113
|
}
|
|
@@ -12384,14 +12431,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
12384
12431
|
}) : config.slots?.componentList ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentList), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12385
12432
|
]),
|
|
12386
12433
|
key: "0"
|
|
12387
|
-
} :
|
|
12434
|
+
} : void 0,
|
|
12388
12435
|
config.$key === "component-list" || config.slots?.componentListPanelHeader ? {
|
|
12389
12436
|
name: "component-list-panel-header",
|
|
12390
12437
|
fn: withCtx(() => [
|
|
12391
12438
|
config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12392
12439
|
]),
|
|
12393
12440
|
key: "1"
|
|
12394
|
-
} :
|
|
12441
|
+
} : void 0,
|
|
12395
12442
|
config.$key === "component-list" || config.slots?.componentListItem ? {
|
|
12396
12443
|
name: "component-list-item",
|
|
12397
12444
|
fn: withCtx(({ component }) => [
|
|
@@ -12404,21 +12451,21 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
12404
12451
|
}, null, 8, ["component"])) : createCommentVNode("v-if", true)
|
|
12405
12452
|
]),
|
|
12406
12453
|
key: "2"
|
|
12407
|
-
} :
|
|
12454
|
+
} : void 0,
|
|
12408
12455
|
config.$key === "layer" || config.slots?.layerPanelHeader ? {
|
|
12409
12456
|
name: "layer-panel-header",
|
|
12410
12457
|
fn: withCtx(() => [
|
|
12411
12458
|
config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12412
12459
|
]),
|
|
12413
12460
|
key: "3"
|
|
12414
|
-
} :
|
|
12461
|
+
} : void 0,
|
|
12415
12462
|
config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
|
|
12416
12463
|
name: "code-block-panel-header",
|
|
12417
12464
|
fn: withCtx(() => [
|
|
12418
12465
|
config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12419
12466
|
]),
|
|
12420
12467
|
key: "4"
|
|
12421
|
-
} :
|
|
12468
|
+
} : void 0,
|
|
12422
12469
|
config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
|
|
12423
12470
|
name: "code-block-panel-tool",
|
|
12424
12471
|
fn: withCtx(({ id, data }) => [
|
|
@@ -12429,14 +12476,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
12429
12476
|
}) : config.slots?.codeBlockPanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12430
12477
|
]),
|
|
12431
12478
|
key: "5"
|
|
12432
|
-
} :
|
|
12479
|
+
} : void 0,
|
|
12433
12480
|
config.$key === "code-block" || config.slots?.codeBlockPanelSearch ? {
|
|
12434
12481
|
name: "code-block-panel-search",
|
|
12435
12482
|
fn: withCtx(() => [
|
|
12436
12483
|
config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-search", { key: 0 }) : config.slots?.codeBlockPanelSearch ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelSearch), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12437
12484
|
]),
|
|
12438
12485
|
key: "6"
|
|
12439
|
-
} :
|
|
12486
|
+
} : void 0,
|
|
12440
12487
|
config.$key === "layer" || config.slots?.layerNodeContent ? {
|
|
12441
12488
|
name: "layer-node-content",
|
|
12442
12489
|
fn: withCtx(({ data: nodeData }) => [
|
|
@@ -12449,7 +12496,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
12449
12496
|
}, null, 8, ["data"])) : createCommentVNode("v-if", true)
|
|
12450
12497
|
]),
|
|
12451
12498
|
key: "7"
|
|
12452
|
-
} :
|
|
12499
|
+
} : void 0,
|
|
12453
12500
|
config.$key === "layer" || config.slots?.layerNodeLabel ? {
|
|
12454
12501
|
name: "layer-node-label",
|
|
12455
12502
|
fn: withCtx(({ data: nodeData }) => [
|
|
@@ -12462,7 +12509,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
12462
12509
|
}, null, 8, ["data"])) : createCommentVNode("v-if", true)
|
|
12463
12510
|
]),
|
|
12464
12511
|
key: "8"
|
|
12465
|
-
} :
|
|
12512
|
+
} : void 0,
|
|
12466
12513
|
config.$key === "layer" || config.slots?.layerNodeTool ? {
|
|
12467
12514
|
name: "layer-node-tool",
|
|
12468
12515
|
fn: withCtx(({ data: nodeData }) => [
|
|
@@ -12475,7 +12522,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
12475
12522
|
}, null, 8, ["data"])) : createCommentVNode("v-if", true)
|
|
12476
12523
|
]),
|
|
12477
12524
|
key: "9"
|
|
12478
|
-
} :
|
|
12525
|
+
} : void 0,
|
|
12479
12526
|
config.$key === "data-source" || config.slots?.dataSourcePanelTool ? {
|
|
12480
12527
|
name: "data-source-panel-tool",
|
|
12481
12528
|
fn: withCtx(({ data }) => [
|
|
@@ -12485,14 +12532,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
12485
12532
|
}) : config.slots?.DataSourcePanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.DataSourcePanelTool), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12486
12533
|
]),
|
|
12487
12534
|
key: "10"
|
|
12488
|
-
} :
|
|
12535
|
+
} : void 0,
|
|
12489
12536
|
config.$key === "data-source" || config.slots?.dataSourcePanelSearch ? {
|
|
12490
12537
|
name: "data-source-panel-search",
|
|
12491
12538
|
fn: withCtx(() => [
|
|
12492
12539
|
config.$key === "data-source" ? renderSlot(_ctx.$slots, "data-source-panel-search", { key: 0 }) : config.slots?.dataSourcePanelSearch ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.dataSourcePanelSearch), { key: 1 })) : createCommentVNode("v-if", true)
|
|
12493
12540
|
]),
|
|
12494
12541
|
key: "11"
|
|
12495
|
-
} :
|
|
12542
|
+
} : void 0
|
|
12496
12543
|
]),
|
|
12497
12544
|
1040
|
|
12498
12545
|
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
@@ -13487,7 +13534,7 @@ class CodeBlock extends BaseService {
|
|
|
13487
13534
|
editable: true,
|
|
13488
13535
|
combineIds: [],
|
|
13489
13536
|
undeletableList: [],
|
|
13490
|
-
paramsColConfig:
|
|
13537
|
+
paramsColConfig: void 0
|
|
13491
13538
|
});
|
|
13492
13539
|
constructor() {
|
|
13493
13540
|
super([
|
|
@@ -13751,7 +13798,6 @@ class ComponentList extends BaseService {
|
|
|
13751
13798
|
const componentListService = new ComponentList();
|
|
13752
13799
|
|
|
13753
13800
|
const canUsePluginMethods$1 = {
|
|
13754
|
-
async: [],
|
|
13755
13801
|
sync: [
|
|
13756
13802
|
"getFormConfig",
|
|
13757
13803
|
"setFormConfig",
|
|
@@ -13930,7 +13976,7 @@ class Dep extends BaseService {
|
|
|
13930
13976
|
const targets = this.watcher.getTargets(type);
|
|
13931
13977
|
if (!targets) return;
|
|
13932
13978
|
for (const target of Object.values(targets)) {
|
|
13933
|
-
this.emit("remove-target", target.id);
|
|
13979
|
+
this.emit("remove-target", target.id, type);
|
|
13934
13980
|
}
|
|
13935
13981
|
}
|
|
13936
13982
|
getTargets(type = DepTargetType.DEFAULT) {
|
|
@@ -13945,7 +13991,7 @@ class Dep extends BaseService {
|
|
|
13945
13991
|
}
|
|
13946
13992
|
removeTarget(id, type = DepTargetType.DEFAULT) {
|
|
13947
13993
|
this.watcher.removeTarget(id, type);
|
|
13948
|
-
this.emit("remove-target", id);
|
|
13994
|
+
this.emit("remove-target", id, type);
|
|
13949
13995
|
}
|
|
13950
13996
|
clearTargets() {
|
|
13951
13997
|
this.watcher.clearTargets();
|
|
@@ -14080,7 +14126,7 @@ class Events extends BaseService {
|
|
|
14080
14126
|
methodMap[toLine(type)] = [...method];
|
|
14081
14127
|
}
|
|
14082
14128
|
getMethod(type) {
|
|
14083
|
-
return cloneDeep(methodMap[toLine(type)]);
|
|
14129
|
+
return cloneDeep(methodMap[toLine(type)]) || [];
|
|
14084
14130
|
}
|
|
14085
14131
|
resetState() {
|
|
14086
14132
|
eventMap = reactive({});
|
|
@@ -14273,7 +14319,6 @@ class Keybinding extends BaseService {
|
|
|
14273
14319
|
const keybindingService = new Keybinding();
|
|
14274
14320
|
|
|
14275
14321
|
const canUsePluginMethods = {
|
|
14276
|
-
async: [],
|
|
14277
14322
|
sync: ["openOverlay", "closeOverlay", "updateOverlay", "createStage"]
|
|
14278
14323
|
};
|
|
14279
14324
|
class StageOverlay extends BaseService {
|
|
@@ -14613,14 +14658,14 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
14613
14658
|
const getTMagicApp = () => {
|
|
14614
14659
|
const renderer = editorService.get("stage")?.renderer;
|
|
14615
14660
|
if (!renderer) {
|
|
14616
|
-
return
|
|
14661
|
+
return void 0;
|
|
14617
14662
|
}
|
|
14618
14663
|
if (renderer.runtime) {
|
|
14619
14664
|
return renderer.runtime.getApp?.();
|
|
14620
14665
|
}
|
|
14621
14666
|
return new Promise((resolve) => {
|
|
14622
14667
|
const timeout = globalThis.setTimeout(() => {
|
|
14623
|
-
resolve(
|
|
14668
|
+
resolve(void 0);
|
|
14624
14669
|
}, 1e4);
|
|
14625
14670
|
renderer.on("runtime-ready", () => {
|
|
14626
14671
|
if (timeout) {
|
|
@@ -14823,7 +14868,7 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
14823
14868
|
if (!changeRecord.propPath) {
|
|
14824
14869
|
continue;
|
|
14825
14870
|
}
|
|
14826
|
-
isModifyField = changeRecord.propPath === "fields" || /fields.(\d)+.name/.test(changeRecord.propPath) || /fields.(\d)+$/.test(changeRecord.propPath);
|
|
14871
|
+
isModifyField = changeRecord.propPath === "fields" || /fields.(\d)+.name/.test(changeRecord.propPath) || /fields.(\d)+.defaultValue/.test(changeRecord.propPath) || /fields.(\d)+$/.test(changeRecord.propPath);
|
|
14827
14872
|
isModifyMock = changeRecord.propPath === "mocks";
|
|
14828
14873
|
isModifyMethod = changeRecord.propPath === "methods" || /methods.(\d)+.name/.test(changeRecord.propPath) || /methods.(\d)+$/.test(changeRecord.propPath);
|
|
14829
14874
|
needRecollectDep = isModifyField || isModifyMock || isModifyMethod;
|
|
@@ -14835,24 +14880,26 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
14835
14880
|
if (needRecollectDep) {
|
|
14836
14881
|
if (Array.isArray(root?.items)) {
|
|
14837
14882
|
depService.clearIdleTasks();
|
|
14838
|
-
removeDataSourceTarget(config.id);
|
|
14839
|
-
initDataSourceDepTarget(config);
|
|
14840
14883
|
let collectIdlePromises = [];
|
|
14841
14884
|
if (isModifyField) {
|
|
14885
|
+
depService.removeTarget(config.id, DepTargetType.DATA_SOURCE);
|
|
14886
|
+
depService.removeTarget(config.id, DepTargetType.DATA_SOURCE_COND);
|
|
14887
|
+
depService.addTarget(createDataSourceTarget(config, reactive({})));
|
|
14888
|
+
depService.addTarget(createDataSourceCondTarget(config, reactive({})));
|
|
14842
14889
|
collectIdlePromises = [
|
|
14843
14890
|
collectIdle(root.items, true, DepTargetType.DATA_SOURCE),
|
|
14844
14891
|
collectIdle(root.items, true, DepTargetType.DATA_SOURCE_COND)
|
|
14845
14892
|
];
|
|
14846
14893
|
} else if (isModifyMock) {
|
|
14894
|
+
depService.removeTarget(config.id, DepTargetType.DATA_SOURCE);
|
|
14895
|
+
depService.addTarget(createDataSourceTarget(config, reactive({})));
|
|
14847
14896
|
collectIdlePromises = [collectIdle(root.items, true, DepTargetType.DATA_SOURCE)];
|
|
14848
14897
|
} else if (isModifyMethod) {
|
|
14898
|
+
depService.removeTarget(config.id, DepTargetType.DATA_SOURCE_METHOD);
|
|
14899
|
+
depService.addTarget(createDataSourceMethodTarget(config, reactive({})));
|
|
14849
14900
|
collectIdlePromises = [collectIdle(root.items, true, DepTargetType.DATA_SOURCE_METHOD)];
|
|
14850
14901
|
}
|
|
14851
|
-
Promise.all(collectIdlePromises).then(() =>
|
|
14852
|
-
updateDataSourceSchema();
|
|
14853
|
-
updateDsData();
|
|
14854
|
-
updateStageNodes(root.items);
|
|
14855
|
-
});
|
|
14902
|
+
Promise.all(collectIdlePromises).then(() => updateDataSourceSchema()).then(() => updateDsData()).then(() => updateStageNodes(root.items));
|
|
14856
14903
|
}
|
|
14857
14904
|
} else if (root?.dataSources) {
|
|
14858
14905
|
updateDsData();
|
|
@@ -14911,16 +14958,25 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
14911
14958
|
}
|
|
14912
14959
|
root.dataSourceCondDeps[target.id] = target.deps;
|
|
14913
14960
|
}
|
|
14961
|
+
if (target.type === DepTargetType.DATA_SOURCE_METHOD) {
|
|
14962
|
+
if (!root.dataSourceMethodDeps) {
|
|
14963
|
+
root.dataSourceMethodDeps = {};
|
|
14964
|
+
}
|
|
14965
|
+
root.dataSourceMethodDeps[target.id] = target.deps;
|
|
14966
|
+
}
|
|
14914
14967
|
};
|
|
14915
|
-
const targetRemoveHandler = (id) => {
|
|
14968
|
+
const targetRemoveHandler = (id, type) => {
|
|
14916
14969
|
const root = editorService.get("root");
|
|
14917
14970
|
if (!root) return;
|
|
14918
|
-
if (root.dataSourceDeps) {
|
|
14971
|
+
if (root.dataSourceDeps && type === DepTargetType.DATA_SOURCE) {
|
|
14919
14972
|
delete root.dataSourceDeps[id];
|
|
14920
14973
|
}
|
|
14921
|
-
if (root.dataSourceCondDeps) {
|
|
14974
|
+
if (root.dataSourceCondDeps && type === DepTargetType.DATA_SOURCE_COND) {
|
|
14922
14975
|
delete root.dataSourceCondDeps[id];
|
|
14923
14976
|
}
|
|
14977
|
+
if (root.dataSourceMethodDeps && type === DepTargetType.DATA_SOURCE_METHOD) {
|
|
14978
|
+
delete root.dataSourceMethodDeps[id];
|
|
14979
|
+
}
|
|
14924
14980
|
};
|
|
14925
14981
|
depService.on("add-target", targetAddHandler);
|
|
14926
14982
|
depService.on("remove-target", targetRemoveHandler);
|