@gct-paas/design 0.1.6-dev.20 → 0.1.6-dev.22
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/loader.esm.min.js +2 -2
- package/es/hooks/design-view/design-state.d.ts +107 -1
- package/es/hooks/design-view/design-state.mjs +7 -7
- package/es/hooks/design-view/designer/useDesignSave.d.ts +2 -2
- package/es/hooks/design-view/designer/useDesignSave.mjs +130 -19
- package/es/hooks/design-view/layout/useToolkit.d.ts +1 -1
- package/es/hooks/design-view/layout/useToolkit.mjs +112 -81
- package/es/hooks/design-view/page/usePage.d.ts +12 -6
- package/es/hooks/design-view/page/usePage.mjs +126 -4
- package/es/hooks/design-view/useDesigner.d.ts +3 -2
- package/es/hooks/design-view/useDesigner.mjs +12 -3
- package/es/index.mjs +3 -3
- package/es/register/designer-register/designer-register.d.ts +6 -3
- package/es/register/designer-register/designer-register.mjs +19 -13
- package/package.json +11 -11
|
@@ -4,20 +4,19 @@ import { platform } from "../../../utils/design-view/index.mjs";
|
|
|
4
4
|
import { DesignPluginPgkUtil } from "../../../utils/design-plugin-pkg-util/design-plugin-pkg-util.mjs";
|
|
5
5
|
import { createWidgetByType } from "../../../utils/schema/index.mjs";
|
|
6
6
|
import "../../../utils/index.mjs";
|
|
7
|
-
import "../design-state.mjs";
|
|
7
|
+
import { pageInfo } from "../design-state.mjs";
|
|
8
8
|
import { useCacheHistory } from "../../develop/useCacheHistory.mjs";
|
|
9
9
|
import { useToolkit } from "../layout/useToolkit.mjs";
|
|
10
10
|
import { useDesigner } from "../useDesigner.mjs";
|
|
11
11
|
import { useUserOccupy } from "../../../components/user-occupy/useUserOccupy.mjs";
|
|
12
12
|
import "../../../components/index.mjs";
|
|
13
13
|
import { isEmpty, isNil } from "lodash-es";
|
|
14
|
-
import { FormComponents, KitPkgUtil, PanelEnum, Platform, t } from "@gct-paas/core";
|
|
14
|
+
import { ButtonSize, ButtonStyle, FormComponents, KitPkgUtil, PanelEnum, Platform, t } from "@gct-paas/core";
|
|
15
15
|
import { computed, createVNode, ref } from "vue";
|
|
16
16
|
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
|
17
17
|
import { Modal } from "ant-design-vue";
|
|
18
18
|
//#region src/hooks/design-view/page/usePage.ts
|
|
19
19
|
var newKeyTag = "___new___";
|
|
20
|
-
var pageInfo = ref({});
|
|
21
20
|
var pagePermissions = ref([]);
|
|
22
21
|
var { setLockInfo, initOccupy, loadOccupyInfo } = useUserOccupy();
|
|
23
22
|
var unlockAvailable = computed(() => {
|
|
@@ -113,9 +112,132 @@ async function loadPageInfo(app) {
|
|
|
113
112
|
loadPageDesignHistoryList();
|
|
114
113
|
pagePermissions.value = await _api.apaas.permission.getList({ relationId: _gct.store.context.pid }) || [];
|
|
115
114
|
if (!pid.startsWith("___new___")) initLockState();
|
|
115
|
+
pageJson.pageConfig.title = "新建页";
|
|
116
116
|
savePageJsonSnapshot();
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
|
+
* 加载页面信息
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
async function loadTxnPageInfo(app) {
|
|
123
|
+
const { initToolkitWidgets } = useToolkit();
|
|
124
|
+
const { setPageJson, loadPageDesignHistoryList, emitCache, pageJson, setPluginConfigs, savePageJsonSnapshot } = useDesigner();
|
|
125
|
+
const { historyUtils } = useCacheHistory();
|
|
126
|
+
platform.value = _gct.store.context.platform || Platform.WEB;
|
|
127
|
+
const baseid = _gct.store.context.baseid || "";
|
|
128
|
+
const pid = _gct.store.context.pid || "";
|
|
129
|
+
if (baseid) {
|
|
130
|
+
const res = await _api.apaas.transaction.getGetVersionById({ id: baseid });
|
|
131
|
+
pageInfo.value = {
|
|
132
|
+
id: newKeyTag,
|
|
133
|
+
name: res.name,
|
|
134
|
+
key: res.key,
|
|
135
|
+
modelKey: res.modelKey,
|
|
136
|
+
designerJson: "",
|
|
137
|
+
_designerJson: "",
|
|
138
|
+
detailDesignerJson: "",
|
|
139
|
+
txnPageMode: "create",
|
|
140
|
+
baseId: baseid
|
|
141
|
+
};
|
|
142
|
+
} else if (pid.startsWith("___new___")) pageInfo.value = {
|
|
143
|
+
id: newKeyTag,
|
|
144
|
+
name: "",
|
|
145
|
+
key: pid.replace(`${newKeyTag}:`, ""),
|
|
146
|
+
designerJson: "",
|
|
147
|
+
_designerJson: "",
|
|
148
|
+
detailDesignerJson: "",
|
|
149
|
+
txnPageMode: "create"
|
|
150
|
+
};
|
|
151
|
+
else {
|
|
152
|
+
const pageInfoRes = await _api.apaas.transaction.getInfo({ id: _gct.store.context.pid });
|
|
153
|
+
pageInfo.value = pageInfoRes;
|
|
154
|
+
pageInfo.value._designerJson = pageInfoRes.designerJson;
|
|
155
|
+
pageInfo.value.txnPageMode = "create";
|
|
156
|
+
}
|
|
157
|
+
const all = [];
|
|
158
|
+
if (_gct.store.appInfo.suiteKey) all.push(KitPkgUtil.loadDesign(_gct.store.appInfo.suiteKey).then((module) => {
|
|
159
|
+
if (module) module.setupApp(app);
|
|
160
|
+
}));
|
|
161
|
+
const _configs = [];
|
|
162
|
+
all.push(DesignPluginPgkUtil.loadDesignPlugin(app, platform.value, _gct.store.appInfo.suiteKey ? [_gct.store.appInfo.suiteKey] : void 0).then(([configs]) => {
|
|
163
|
+
_configs.push(...configs);
|
|
164
|
+
setPluginConfigs(configs);
|
|
165
|
+
}));
|
|
166
|
+
await Promise.all(all);
|
|
167
|
+
if (!historyUtils.isHistoryInfoExist(_gct.store.context.pid)) historyUtils.init({ historyId: _gct.store.context.pid ?? "" });
|
|
168
|
+
if (pageInfo.value.designerJson && !isNil(pageInfo.value.designerJson) && !isEmpty(pageInfo.value.designerJson)) {
|
|
169
|
+
const _json = JSON.parse(pageInfo.value.designerJson);
|
|
170
|
+
if (_json && _json.plugins) {
|
|
171
|
+
const items = _json.plugins.filter((item) => {
|
|
172
|
+
return _configs.findIndex((config) => config.key === item.key) === -1;
|
|
173
|
+
});
|
|
174
|
+
await DesignPluginPgkUtil.loadDesignDeletedPlugins(platform.value, items);
|
|
175
|
+
}
|
|
176
|
+
if (!_json.pageConfig) _json.pageConfig = {
|
|
177
|
+
title: "",
|
|
178
|
+
i18n: {},
|
|
179
|
+
hasFooter: false
|
|
180
|
+
};
|
|
181
|
+
setPageJson({
|
|
182
|
+
..._json,
|
|
183
|
+
id: pageInfo.value.id
|
|
184
|
+
}, true);
|
|
185
|
+
} else {
|
|
186
|
+
emitCache();
|
|
187
|
+
setPageJson({
|
|
188
|
+
newDesigner: true,
|
|
189
|
+
style: {
|
|
190
|
+
paddingAll: "",
|
|
191
|
+
paddingTop: "",
|
|
192
|
+
paddingRight: "16",
|
|
193
|
+
paddingBottom: "16",
|
|
194
|
+
paddingLeft: "16"
|
|
195
|
+
}
|
|
196
|
+
}, true);
|
|
197
|
+
}
|
|
198
|
+
if (!pageJson.widgets.some((item) => item.type === FormComponents.BottomButtonContainer)) {
|
|
199
|
+
const bottomBtnWidget = createWidgetByType(FormComponents.BottomButtonContainer);
|
|
200
|
+
[FormComponents.TxnCancelButton, FormComponents.TxnConfirmButton].forEach((e) => {
|
|
201
|
+
const data = createWidgetByType(e);
|
|
202
|
+
data.props.parentWidgetId = bottomBtnWidget.id;
|
|
203
|
+
data.props.buttonStyle = ButtonStyle.ORDINARY;
|
|
204
|
+
data.props.size = ButtonSize.DEFAULT;
|
|
205
|
+
data.props.noDelete = true;
|
|
206
|
+
bottomBtnWidget.children?.push(data);
|
|
207
|
+
});
|
|
208
|
+
pageJson.widgets.push(bottomBtnWidget);
|
|
209
|
+
}
|
|
210
|
+
initToolkitWidgets();
|
|
211
|
+
loadPageDesignHistoryList();
|
|
212
|
+
pagePermissions.value = await _api.apaas.permission.getList({ relationId: _gct.store.context.pid }) || [];
|
|
213
|
+
if (!pid.startsWith("___new___")) initLockState();
|
|
214
|
+
savePageJsonSnapshot();
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* @param mode 切换模式
|
|
218
|
+
*/
|
|
219
|
+
async function toggleTxnPageInfo(mode) {
|
|
220
|
+
const { setTxnPageJson, pageJson } = useDesigner();
|
|
221
|
+
if (mode === "create") {
|
|
222
|
+
pageInfo.value.detailDesignerJson = JSON.stringify(pageJson);
|
|
223
|
+
pageInfo.value.txnPageMode = mode;
|
|
224
|
+
setTxnPageJson({ ...JSON.parse(pageInfo.value._designerJson) });
|
|
225
|
+
} else {
|
|
226
|
+
pageInfo.value._designerJson = JSON.stringify(pageJson);
|
|
227
|
+
pageInfo.value.txnPageMode = mode;
|
|
228
|
+
setTxnPageJson({ ...pageInfo.value.detailDesignerJson ? JSON.parse(pageInfo.value.detailDesignerJson) : {
|
|
229
|
+
newDesigner: true,
|
|
230
|
+
style: {
|
|
231
|
+
paddingAll: "",
|
|
232
|
+
paddingTop: "",
|
|
233
|
+
paddingRight: "16",
|
|
234
|
+
paddingBottom: "16",
|
|
235
|
+
paddingLeft: "16"
|
|
236
|
+
}
|
|
237
|
+
} });
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
119
241
|
* 初始化界面占用信息
|
|
120
242
|
*/
|
|
121
243
|
function initLockState() {
|
|
@@ -166,4 +288,4 @@ function usePage() {
|
|
|
166
288
|
};
|
|
167
289
|
}
|
|
168
290
|
//#endregion
|
|
169
|
-
export { currentPanel, loadPageInfo, lockPage, newKeyTag,
|
|
291
|
+
export { currentPanel, loadPageInfo, loadTxnPageInfo, lockPage, newKeyTag, pagePermissions, togglePanel, toggleTxnPageInfo, unlockAvailable, usePage };
|
|
@@ -1091,8 +1091,9 @@ export declare function useDesigner(): {
|
|
|
1091
1091
|
methodMap: import('vue').Ref<import('@gct-paas/schema').ExportMethod, import('@gct-paas/schema').ExportMethod>;
|
|
1092
1092
|
checkWidgetMove: () => boolean;
|
|
1093
1093
|
handleAddDrag: (newIndex: number, childrenList: LowCodeWidget.BasicSchema[], scope: SCOPE, formID?: string) => void;
|
|
1094
|
-
setPageJson: (json: PageJson) => Promise<void>;
|
|
1095
|
-
|
|
1094
|
+
setPageJson: (json: PageJson, hasFooter?: boolean) => Promise<void>;
|
|
1095
|
+
setTxnPageJson: (json: PageJson, hasFooter?: boolean) => Promise<void>;
|
|
1096
|
+
save: (flag?: boolean, showSuccess?: boolean, isTxn?: boolean) => Promise<boolean>;
|
|
1096
1097
|
savePageJsonSnapshot: (json?: PageJson) => void;
|
|
1097
1098
|
emitCache: () => void;
|
|
1098
1099
|
undoOrRestore: (content: string) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { platform } from "../../utils/design-view/index.mjs";
|
|
2
2
|
import { initMethodMap } from "../../utils/transform-js/transform-js.mjs";
|
|
3
3
|
import "../../utils/index.mjs";
|
|
4
|
-
import { methodMap, pageJson } from "./design-state.mjs";
|
|
4
|
+
import { defaultPageJson, methodMap, pageJson } from "./design-state.mjs";
|
|
5
5
|
import { useDesignModal } from "./designer/useDesignModal.mjs";
|
|
6
6
|
import { useDesignPreview } from "./designer/useDesignPreview.mjs";
|
|
7
7
|
import { useWidgetRegistry } from "./widget/useWidgetRegistry.mjs";
|
|
@@ -38,14 +38,22 @@ function useDesigner() {
|
|
|
38
38
|
/**
|
|
39
39
|
* 设置设计器的 pageJSON
|
|
40
40
|
*/
|
|
41
|
-
async function setPageJson(json) {
|
|
42
|
-
pageJson.pageConfig.hasFooter = platform.value === Platform.MOBILE || platform.value === Platform.PAD;
|
|
41
|
+
async function setPageJson(json, hasFooter = false) {
|
|
42
|
+
pageJson.pageConfig.hasFooter = hasFooter || platform.value === Platform.MOBILE || platform.value === Platform.PAD;
|
|
43
43
|
Object.assign(pageJson, json);
|
|
44
44
|
initMethodMap(pageJson.js).then((map) => {
|
|
45
45
|
methodMap.value = map;
|
|
46
46
|
});
|
|
47
47
|
cache.emitCache();
|
|
48
48
|
}
|
|
49
|
+
async function setTxnPageJson(json, hasFooter = false) {
|
|
50
|
+
pageJson.pageConfig.hasFooter = hasFooter || platform.value === Platform.MOBILE || platform.value === Platform.PAD;
|
|
51
|
+
Object.assign(pageJson, defaultPageJson, json);
|
|
52
|
+
initMethodMap(pageJson.js).then((map) => {
|
|
53
|
+
methodMap.value = map;
|
|
54
|
+
});
|
|
55
|
+
cache.emitCache();
|
|
56
|
+
}
|
|
49
57
|
/** 检查是否可以拖拽进入的方法,比如某些组件不能拖到某些组件内 */
|
|
50
58
|
function checkWidgetMove() {
|
|
51
59
|
return true;
|
|
@@ -66,6 +74,7 @@ function useDesigner() {
|
|
|
66
74
|
checkWidgetMove,
|
|
67
75
|
handleAddDrag,
|
|
68
76
|
setPageJson,
|
|
77
|
+
setTxnPageJson,
|
|
69
78
|
save: saveHook.save,
|
|
70
79
|
savePageJsonSnapshot: saveHook.savePageJsonSnapshot,
|
|
71
80
|
emitCache: cache.emitCache,
|
package/es/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ import { FieldOverrideUtil, setupOverride } from "./schema/field/index.mjs";
|
|
|
39
39
|
import { BaseSearch, getSearchOptions } from "./schema/search/BaseSearch.mjs";
|
|
40
40
|
import { BaseDate } from "./schema/search/BaseDate.mjs";
|
|
41
41
|
import "./schema/index.mjs";
|
|
42
|
-
import { isModified, loading, methodMap, modalDesignId, modalDesignState, modalInfo, noMore, pageDesignHistoryList, pageJson, pageJsonSnapshot, pageNo, pluginConfigs, regRoot, subTableModalId, subTableModalState, transformPageJson, wfNodesModalId, wfNodesModalState, widgetInfo, workflowModalId, workflowModalState } from "./hooks/design-view/design-state.mjs";
|
|
42
|
+
import { isModified, loading, methodMap, modalDesignId, modalDesignState, modalInfo, noMore, pageDesignHistoryList, pageInfo, pageJson, pageJsonSnapshot, pageNo, pluginConfigs, regRoot, subTableModalId, subTableModalState, transformPageJson, wfNodesModalId, wfNodesModalState, widgetInfo, workflowModalId, workflowModalState } from "./hooks/design-view/design-state.mjs";
|
|
43
43
|
import { useScope } from "./hooks/design-view/layout/useScope.mjs";
|
|
44
44
|
import { useGlobal } from "./hooks/design-view/global/useGlobal.mjs";
|
|
45
45
|
import { useDesignModal } from "./hooks/design-view/designer/useDesignModal.mjs";
|
|
@@ -47,7 +47,7 @@ import { useDesignPreview } from "./hooks/design-view/designer/useDesignPreview.
|
|
|
47
47
|
import { useCacheHistory, useCacheHistoryInner } from "./hooks/develop/useCacheHistory.mjs";
|
|
48
48
|
import { useWidgetRegistry } from "./hooks/design-view/widget/useWidgetRegistry.mjs";
|
|
49
49
|
import { useToolkit } from "./hooks/design-view/layout/useToolkit.mjs";
|
|
50
|
-
import { currentPanel, loadPageInfo, lockPage, newKeyTag,
|
|
50
|
+
import { currentPanel, loadPageInfo, loadTxnPageInfo, lockPage, newKeyTag, pagePermissions, togglePanel, toggleTxnPageInfo, unlockAvailable, usePage } from "./hooks/design-view/page/usePage.mjs";
|
|
51
51
|
import { useWidgetQuery } from "./hooks/design-view/widget/useWidgetQuery.mjs";
|
|
52
52
|
import { useSelectedWidget } from "./hooks/design-view/widget/useSelectedWidget.mjs";
|
|
53
53
|
import { useDesignCache } from "./hooks/design-view/designer/useDesignCache.mjs";
|
|
@@ -105,4 +105,4 @@ function onInit() {
|
|
|
105
105
|
}
|
|
106
106
|
onInit();
|
|
107
107
|
//#endregion
|
|
108
|
-
export { BaseDate, BaseSearch, CategoryEnum, ControllerType, DesignContainerNode, DesignContent, DesignEditorNode, DesignEditorNodeProvider, DesignEditorType, DesignItemActionTag, DesignItemAttribute, DesignItemPreview, DesignNode, DesignNodePrefix, DesignNodeType, DesignPluginPgkUtil, DesignViewController, DesignViewHooks, DesignViewPrefix, DesignerRegister, FieldCascader_default as FieldCascader, FieldOverrideUtil, FieldSchema, InsertNodeMode, MaterialContent, MaterialGroup, MaterialRegister, MenuClickEvent, multi_field_display_default as MultiFieldDisplay, NodeBaseProvider, NodeRegister, NotMask, PageTypeEnum, PanelContent, PropsEditorRegister, SCREditorUtils, user_lock_default as UserLock, user_occupy_default as UserOccupy, asyncIdentify, baseBtnEditor, baseBtnProp, basicAttrsUtils, basicFieldEditor, beginDrag, BTN_TYPE_COLOR as btnTypeColor, buildRunJs, buildRuntimeJson, buttonEditor, buttonProps, buttonStyleEditor, changeCmpData, commonStyle, createWidgetByType, createWidgetProvider, createdSearchField, currentPanel, customMenu, deptFilter, designCreateAppVue, designInterceptors, designRegister, designSetupApp, destroyOccupyTimer, deviceEvent, displayEditor, displayProps, explainEditor, findAllChildrenTypes, fixedAlignEditor, flatten, formItemProps, formulaFilter, getAutofillEditor, getBindCmpTypeEditor, getInputAttrEditor, getSearchOptions, hiddenButtonProps, initFieldWidgetRuntime, initMethodMap, isCanCrop, isModified, loadPageInfo, loadPageOccupyInfo, loading, lockPage, methodMap, modal_exports as modalCfg, modalDesignId, modalDesignState, modalInfo, multiFieldEditor, newKeyTag, noMore, nodeContainerProps, nodeEditorProps, nodeProps, notNeedPxStyle, occupyPage, onWidgetInfoInit, openFormulaEditorByDesign, pageDesignHistoryList, pageInfo, pageJson, pageJsonSnapshot, pageNo, pageOccupyInfo, pagePermissions, permissionEditor, placeholderEditor, platform, pluginConfigs, PRESET_COLOR as presetColor, propEditorProps, propsToStyle, regRoot, regexEditor, rgba2hex, schemaToStyle, setupOverride, shadeColor, styleEditorProps, subTableModalId, subTableModalState, submitInHideEditor, togglePanel, transformField2Component, transformPageJson, unlockAvailable, uploadDraggerEditor, useAsyncFieldConfig, useAsyncFileAttrs, useAsyncOperateField, useCacheHistory, useCacheHistoryInner, useDesignCache, useDesignHistory, useDesignModal, useDesignPreview, useDesignSave, useDesignViewController, useDesignViewStore, useDesigner, useDesignerController, useFieldTransfer, useGlobal, useModelField, usePage, usePageOccupy, usePropEditor, useScope, useSelectedWidget, useStyle, useStyleEditor, useToolkit, useUserOccupy, useWidget, useWidgetQuery, useWidgetRegistry, validatorEditor, wfNodesModalId, wfNodesModalState, widgetInfo, widgetProps, widgetWrapperProps, workflowModalId, workflowModalState };
|
|
108
|
+
export { BaseDate, BaseSearch, CategoryEnum, ControllerType, DesignContainerNode, DesignContent, DesignEditorNode, DesignEditorNodeProvider, DesignEditorType, DesignItemActionTag, DesignItemAttribute, DesignItemPreview, DesignNode, DesignNodePrefix, DesignNodeType, DesignPluginPgkUtil, DesignViewController, DesignViewHooks, DesignViewPrefix, DesignerRegister, FieldCascader_default as FieldCascader, FieldOverrideUtil, FieldSchema, InsertNodeMode, MaterialContent, MaterialGroup, MaterialRegister, MenuClickEvent, multi_field_display_default as MultiFieldDisplay, NodeBaseProvider, NodeRegister, NotMask, PageTypeEnum, PanelContent, PropsEditorRegister, SCREditorUtils, user_lock_default as UserLock, user_occupy_default as UserOccupy, asyncIdentify, baseBtnEditor, baseBtnProp, basicAttrsUtils, basicFieldEditor, beginDrag, BTN_TYPE_COLOR as btnTypeColor, buildRunJs, buildRuntimeJson, buttonEditor, buttonProps, buttonStyleEditor, changeCmpData, commonStyle, createWidgetByType, createWidgetProvider, createdSearchField, currentPanel, customMenu, deptFilter, designCreateAppVue, designInterceptors, designRegister, designSetupApp, destroyOccupyTimer, deviceEvent, displayEditor, displayProps, explainEditor, findAllChildrenTypes, fixedAlignEditor, flatten, formItemProps, formulaFilter, getAutofillEditor, getBindCmpTypeEditor, getInputAttrEditor, getSearchOptions, hiddenButtonProps, initFieldWidgetRuntime, initMethodMap, isCanCrop, isModified, loadPageInfo, loadPageOccupyInfo, loadTxnPageInfo, loading, lockPage, methodMap, modal_exports as modalCfg, modalDesignId, modalDesignState, modalInfo, multiFieldEditor, newKeyTag, noMore, nodeContainerProps, nodeEditorProps, nodeProps, notNeedPxStyle, occupyPage, onWidgetInfoInit, openFormulaEditorByDesign, pageDesignHistoryList, pageInfo, pageJson, pageJsonSnapshot, pageNo, pageOccupyInfo, pagePermissions, permissionEditor, placeholderEditor, platform, pluginConfigs, PRESET_COLOR as presetColor, propEditorProps, propsToStyle, regRoot, regexEditor, rgba2hex, schemaToStyle, setupOverride, shadeColor, styleEditorProps, subTableModalId, subTableModalState, submitInHideEditor, togglePanel, toggleTxnPageInfo, transformField2Component, transformPageJson, unlockAvailable, uploadDraggerEditor, useAsyncFieldConfig, useAsyncFileAttrs, useAsyncOperateField, useCacheHistory, useCacheHistoryInner, useDesignCache, useDesignHistory, useDesignModal, useDesignPreview, useDesignSave, useDesignViewController, useDesignViewStore, useDesigner, useDesignerController, useFieldTransfer, useGlobal, useModelField, usePage, usePageOccupy, usePropEditor, useScope, useSelectedWidget, useStyle, useStyleEditor, useToolkit, useUserOccupy, useWidget, useWidgetQuery, useWidgetRegistry, validatorEditor, wfNodesModalId, wfNodesModalState, widgetInfo, widgetProps, widgetWrapperProps, workflowModalId, workflowModalState };
|
|
@@ -52,21 +52,24 @@ export declare class DesignerRegister {
|
|
|
52
52
|
*
|
|
53
53
|
* @param {string} tag 适配器标识
|
|
54
54
|
* @param {() => IDesignerProvider} provider 设计器项
|
|
55
|
+
* @param {string} [prefix]
|
|
55
56
|
*/
|
|
56
|
-
register(tag: string, provider: () => IDesignerProvider): void;
|
|
57
|
+
register(tag: string, provider: () => IDesignerProvider, prefix?: string): void;
|
|
57
58
|
/**
|
|
58
59
|
* 设计器项适配器注销
|
|
59
60
|
*
|
|
60
61
|
* @param {string} tag
|
|
62
|
+
* @param {string} [prefix]
|
|
61
63
|
*/
|
|
62
|
-
unregister(tag: string): void;
|
|
64
|
+
unregister(tag: string, prefix?: string): void;
|
|
63
65
|
/**
|
|
64
66
|
* 根据标识获取指定适配器
|
|
65
67
|
*
|
|
66
68
|
* @param {string} tag
|
|
69
|
+
* @param {string} [prefix]
|
|
67
70
|
* @returns {*} {(IDesignerProvider | undefined)}
|
|
68
71
|
*/
|
|
69
|
-
getProvider(tag: string): IDesignerProvider | undefined;
|
|
72
|
+
getProvider(tag: string, prefix?: string): IDesignerProvider | undefined;
|
|
70
73
|
/**
|
|
71
74
|
* 获取当前所有组件 keys
|
|
72
75
|
*
|
|
@@ -57,39 +57,45 @@ var DesignerRegister = class {
|
|
|
57
57
|
*
|
|
58
58
|
* @param {string} tag 适配器标识
|
|
59
59
|
* @param {() => IDesignerProvider} provider 设计器项
|
|
60
|
+
* @param {string} [prefix]
|
|
60
61
|
*/
|
|
61
|
-
register(tag, provider) {
|
|
62
|
-
|
|
62
|
+
register(tag, provider, prefix) {
|
|
63
|
+
const fullTag = prefix ? `${prefix}:${tag}` : tag;
|
|
64
|
+
this.map.set(fullTag, provider);
|
|
63
65
|
const instance = provider();
|
|
64
|
-
this.providers.set(
|
|
65
|
-
this.hooks.register.callSync(null,
|
|
66
|
+
this.providers.set(fullTag, instance);
|
|
67
|
+
this.hooks.register.callSync(null, fullTag, instance);
|
|
66
68
|
this.addComponent("gct-" + instance.schema.type, instance.component);
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
71
|
* 设计器项适配器注销
|
|
70
72
|
*
|
|
71
73
|
* @param {string} tag
|
|
74
|
+
* @param {string} [prefix]
|
|
72
75
|
*/
|
|
73
|
-
unregister(tag) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
unregister(tag, prefix) {
|
|
77
|
+
const fullTag = prefix ? `${prefix}:${tag}` : tag;
|
|
78
|
+
this.map.delete(fullTag);
|
|
79
|
+
const instance = this.providers.get(fullTag);
|
|
76
80
|
if (instance) {
|
|
77
|
-
this.hooks.unregister.callSync(null,
|
|
78
|
-
this.providers.delete(
|
|
81
|
+
this.hooks.unregister.callSync(null, fullTag, instance);
|
|
82
|
+
this.providers.delete(fullTag);
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
/**
|
|
82
86
|
* 根据标识获取指定适配器
|
|
83
87
|
*
|
|
84
88
|
* @param {string} tag
|
|
89
|
+
* @param {string} [prefix]
|
|
85
90
|
* @returns {*} {(IDesignerProvider | undefined)}
|
|
86
91
|
*/
|
|
87
|
-
getProvider(tag) {
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
getProvider(tag, prefix) {
|
|
93
|
+
const fullTag = prefix ? `${prefix}:${tag}` : tag;
|
|
94
|
+
if (!this.providers.has(fullTag)) {
|
|
95
|
+
console.warn(`getProvider with tag ${fullTag} is not registered.`);
|
|
90
96
|
return;
|
|
91
97
|
}
|
|
92
|
-
return this.providers.get(
|
|
98
|
+
return this.providers.get(fullTag);
|
|
93
99
|
}
|
|
94
100
|
/**
|
|
95
101
|
* 获取当前所有组件 keys
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/design",
|
|
3
|
-
"version": "0.1.6-dev.
|
|
3
|
+
"version": "0.1.6-dev.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台设计界面底包",
|
|
6
6
|
"loader": "dist/loader.esm.min.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@ant-design/icons-vue": "^7.0.1",
|
|
35
35
|
"@babel/core": "^7.29.0",
|
|
36
36
|
"@babel/standalone": "^7.29.2",
|
|
37
|
-
"@gct-paas/api": "^0.1.6-dev.
|
|
37
|
+
"@gct-paas/api": "^0.1.6-dev.14",
|
|
38
38
|
"@jsplumb/browser-ui": "^6.2.10",
|
|
39
39
|
"@vueuse/core": "^14.1.0",
|
|
40
40
|
"ant-design-vue": "~3.2.20",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"react-dnd-html5-backend": "^16.0.1",
|
|
52
52
|
"vue": "^3.5.30",
|
|
53
53
|
"vue3-dnd": "^2.1.0",
|
|
54
|
-
"@gct-paas/core": "0.1.6-dev.
|
|
55
|
-
"@gct-paas/
|
|
56
|
-
"@gct-paas/
|
|
57
|
-
"@gct-paas/
|
|
54
|
+
"@gct-paas/core": "0.1.6-dev.22",
|
|
55
|
+
"@gct-paas/core-web": "0.1.6-dev.22",
|
|
56
|
+
"@gct-paas/schema": "0.1.6-dev.22",
|
|
57
|
+
"@gct-paas/scss": "0.1.6-dev.22"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/babel__core": "^7.20.5",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"@types/estraverse": "^5.1.7"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@gct-paas/api": "^0.1.6-dev.
|
|
65
|
+
"@gct-paas/api": "^0.1.6-dev.14",
|
|
66
66
|
"vue": ">=3",
|
|
67
|
-
"@gct-paas/core": "0.1.6-dev.
|
|
68
|
-
"@gct-paas/schema": "0.1.6-dev.
|
|
69
|
-
"@gct-paas/
|
|
70
|
-
"@gct-paas/
|
|
67
|
+
"@gct-paas/core": "0.1.6-dev.22",
|
|
68
|
+
"@gct-paas/schema": "0.1.6-dev.22",
|
|
69
|
+
"@gct-paas/core-web": "0.1.6-dev.22",
|
|
70
|
+
"@gct-paas/scss": "0.1.6-dev.22"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|