@tmagic/editor 1.2.0-beta.17 → 1.2.0-beta.18
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.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, resolveComponent, openBlock, createBlock, normalizeStyle, unref, reactive, watch, inject, createElementBlock, createVNode, ref, withCtx, withModifiers, createCommentVNode, createTextVNode, toDisplayString, onMounted, onUnmounted, renderSlot, Fragment, createElementVNode, normalizeClass, resolveDynamicComponent, toRaw, createSlots, renderList, normalizeProps, mergeProps, markRaw, getCurrentInstance, watchEffect, provide, withDirectives, Teleport, vShow, nextTick, toHandlers } from 'vue';
|
|
2
2
|
import serialize from 'serialize-javascript';
|
|
3
3
|
import { isEmpty, map, throttle, pick, omit, keys, cloneDeep, forIn, mergeWith, uniq, isObject } from 'lodash-es';
|
|
4
|
+
import { createValues, MForm } from '@tmagic/form';
|
|
4
5
|
import { HookType, NodeType } from '@tmagic/schema';
|
|
5
6
|
import { Delete, Close, Edit, Plus, ArrowDown, Grid, Memo, FullScreen, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, View, Link, Search, Files, CopyDocument, Coin, EditPen, ArrowLeftBold, ArrowRightBold, CaretBottom, DocumentCopy, Top, Bottom } from '@element-plus/icons-vue';
|
|
6
7
|
import { TMagicButton, TMagicTooltip, TMagicIcon, TMagicScrollbar, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, tMagicMessage, tMagicMessageBox, TMagicCard, TMagicInput, TMagicDialog, TMagicTree, TMagicCollapse, TMagicCollapseItem, getConfig as getConfig$1, TMagicTabs, TMagicPopover } from '@tmagic/design';
|
|
@@ -10,7 +11,6 @@ import Gesto from 'gesto';
|
|
|
10
11
|
import { isPop, getNodePath, isNumber, isPage, toLine, datetimeFormatter, removeClassNameByClassName } from '@tmagic/utils';
|
|
11
12
|
import { EventEmitter } from 'events';
|
|
12
13
|
import { DEFAULT_EVENTS, DEFAULT_METHODS } from '@tmagic/core';
|
|
13
|
-
import { MForm } from '@tmagic/form';
|
|
14
14
|
import KeyController from 'keycon';
|
|
15
15
|
|
|
16
16
|
const __default__$t = defineComponent({
|
|
@@ -136,6 +136,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
136
136
|
setup(__props, { emit }) {
|
|
137
137
|
const props = __props;
|
|
138
138
|
const services = inject("services");
|
|
139
|
+
const mForm = inject("mForm");
|
|
139
140
|
const codeDsl = computed(() => services?.codeBlockService.getCodeDslSync());
|
|
140
141
|
const tableConfig = computed(() => {
|
|
141
142
|
const defaultConfig = {
|
|
@@ -166,7 +167,15 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
166
167
|
name: "params",
|
|
167
168
|
label: "\u53C2\u6570",
|
|
168
169
|
defaultValue: {},
|
|
169
|
-
itemsFunction: (row) =>
|
|
170
|
+
itemsFunction: (row) => {
|
|
171
|
+
const paramsConfig = getParamsConfig(row.codeId);
|
|
172
|
+
if (!row.params)
|
|
173
|
+
row.params = {};
|
|
174
|
+
if (isEmpty(row.params)) {
|
|
175
|
+
createValues(mForm, paramsConfig, {}, row.params);
|
|
176
|
+
}
|
|
177
|
+
return paramsConfig;
|
|
178
|
+
}
|
|
170
179
|
}
|
|
171
180
|
]
|
|
172
181
|
};
|