@gct-paas/design 6.0.0-dev.1 → 6.0.0-dev.3
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/designer/useDesignPreview.mjs +7 -3
- package/es/hooks/design-view/designer/useDesignSave.d.ts +1 -1
- package/es/hooks/design-view/designer/useDesignSave.mjs +30 -3
- package/es/hooks/design-view/layout/useToolkit.d.ts +1 -1
- package/es/hooks/design-view/layout/useToolkit.mjs +50 -7
- package/es/hooks/design-view/page/usePage.d.ts +5 -0
- package/es/hooks/design-view/page/usePage.mjs +76 -3
- package/es/hooks/design-view/useDesigner.d.ts +2 -1
- package/es/hooks/design-view/useDesigner.mjs +11 -0
- package/es/index.mjs +2 -2
- package/es/schema/common-config/common-field-editor-config.mjs +7 -3
- package/es/schema/common-config/display-editor-config.mjs +2 -2
- package/package.json +11 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { platform } from "../../../utils/design-view/index.mjs";
|
|
2
2
|
import "../design-state.mjs";
|
|
3
|
-
import { EnvironmentType, Platform, openWindow, stringifyMatrixParams } from "@gct-paas/core";
|
|
3
|
+
import { ContextSceneEnum, EnvironmentType, Platform, openWindow, stringifyMatrixParams } from "@gct-paas/core";
|
|
4
4
|
import { ref } from "vue";
|
|
5
5
|
import { useDebounceFn } from "@vueuse/core";
|
|
6
6
|
//#region src/hooks/design-view/designer/useDesignPreview.ts
|
|
@@ -35,9 +35,13 @@ function useDesignPreview() {
|
|
|
35
35
|
env: env || _gct.env.getEnv()
|
|
36
36
|
};
|
|
37
37
|
let hasUrl = `/PagePreview/${pid}`;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const scene = _gct.store.context.scene;
|
|
39
|
+
if (scene === ContextSceneEnum.TXN) {
|
|
40
|
+
matrixParams.scene = ContextSceneEnum.TXN;
|
|
40
41
|
hasUrl = `/TxnPagePreview/${pid}`;
|
|
42
|
+
} else if (scene === ContextSceneEnum.DETAIL) {
|
|
43
|
+
matrixParams.scene = ContextSceneEnum.DETAIL;
|
|
44
|
+
hasUrl = `/DetailPagePreview/${pid}`;
|
|
41
45
|
}
|
|
42
46
|
if (platform.value === Platform.MOBILE) openWindow(buildPreviewUrl(mobileUrl, hasUrl, matrixParams), {
|
|
43
47
|
noopener: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PageJson, RuntimePageJson } from '@gct-paas/schema';
|
|
2
2
|
export declare function useDesignSave(): {
|
|
3
|
-
save: (flag?: boolean, showSuccess?: boolean,
|
|
3
|
+
save: (flag?: boolean, showSuccess?: boolean, scene?: string) => Promise<boolean>;
|
|
4
4
|
validateWidgets: (widgets: IData[], parents?: IData[]) => boolean;
|
|
5
5
|
savePageJsonSnapshot: (json?: PageJson) => void;
|
|
6
6
|
};
|
|
@@ -4,7 +4,7 @@ import "../../../utils/index.mjs";
|
|
|
4
4
|
import { defaultPageJson, noMore, pageDesignHistoryList, pageInfo, pageJson, pageJsonSnapshot, pageNo, regRoot, transformPageJson, widgetInfo } from "../design-state.mjs";
|
|
5
5
|
import { useUserOccupy } from "../components/useUserOccupy.mjs";
|
|
6
6
|
import { cloneDeep, isArray, isEmpty, isNil } from "lodash-es";
|
|
7
|
-
import { Platform, SearchComponents, TreeHelper, t } from "@gct-paas/core";
|
|
7
|
+
import { ContextSceneEnum, Platform, SearchComponents, TreeHelper, t } from "@gct-paas/core";
|
|
8
8
|
import { message } from "ant-design-vue";
|
|
9
9
|
//#region src/hooks/design-view/designer/useDesignSave.ts
|
|
10
10
|
/**
|
|
@@ -169,10 +169,12 @@ function useDesignSave() {
|
|
|
169
169
|
*
|
|
170
170
|
* @param {boolean} flag 是否为保存操作(true为保存,false为恢复)
|
|
171
171
|
* @param {boolean} showSuccess 是否显示成功提示
|
|
172
|
+
* @param {string} scene 场景, 目前支持"txn"(事务) | "detail"(详情页)
|
|
172
173
|
* @returns {Promise<boolean>} 是否保存成功
|
|
173
174
|
*/
|
|
174
|
-
async function save(flag = true, showSuccess = true,
|
|
175
|
-
if (
|
|
175
|
+
async function save(flag = true, showSuccess = true, scene = "") {
|
|
176
|
+
if (scene === ContextSceneEnum.TXN) return saveTxn(flag, showSuccess);
|
|
177
|
+
if (scene === ContextSceneEnum.DETAIL) return saveDetail(flag, showSuccess);
|
|
176
178
|
const pageId = _gct.store.context.pid;
|
|
177
179
|
const _pageJson = transformPageJson(pageJson);
|
|
178
180
|
if (validateWidgets(_pageJson.widgets) === false) return false;
|
|
@@ -273,6 +275,31 @@ function useDesignSave() {
|
|
|
273
275
|
pageNo.value = 1;
|
|
274
276
|
return true;
|
|
275
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* 保存详情页
|
|
280
|
+
* @param {boolean} flag 是否为保存操作(true为保存,false为恢复)
|
|
281
|
+
* @param {boolean} showSuccess 是否显示成功提示
|
|
282
|
+
* @returns {Promise<boolean>} 是否保存成功
|
|
283
|
+
*/
|
|
284
|
+
async function saveDetail(flag = true, showSuccess = true) {
|
|
285
|
+
const pageId = _gct.store.context.pid;
|
|
286
|
+
const createPayload = await preparePagePayload(pageJson);
|
|
287
|
+
if (!createPayload) return false;
|
|
288
|
+
const { designerJson: _designerJson, runtimeJson } = createPayload;
|
|
289
|
+
pageInfo.value._designerJson = JSON.stringify(_designerJson);
|
|
290
|
+
await _api.apaas.detailPage.putUpdateDesignerJsonId({ id: pageId }, {
|
|
291
|
+
designerJson: JSON.stringify(_designerJson),
|
|
292
|
+
runtimeJson: JSON.stringify(runtimeJson),
|
|
293
|
+
key: pageInfo.value.key,
|
|
294
|
+
name: pageInfo.value.name,
|
|
295
|
+
description: pageInfo.value.description
|
|
296
|
+
});
|
|
297
|
+
if (showSuccess) _gct.message.success(flag ? "sys.saveSuccess" : "sys.recoverSuccess");
|
|
298
|
+
cancelOccupy();
|
|
299
|
+
noMore.value = false;
|
|
300
|
+
pageNo.value = 1;
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
276
303
|
return {
|
|
277
304
|
save,
|
|
278
305
|
validateWidgets,
|
|
@@ -392,7 +392,7 @@ export declare function useToolkit(): {
|
|
|
392
392
|
}[];
|
|
393
393
|
}[]>;
|
|
394
394
|
initToolkitWidgets: () => void;
|
|
395
|
-
changeToolkitWidgets: ({ data, modalState,
|
|
395
|
+
changeToolkitWidgets: ({ data, modalState, scene }: IObject) => void;
|
|
396
396
|
fixedToolkit: () => void;
|
|
397
397
|
setFieldToolkit: ({ modelKey, formId, childParentModelKey, }: {
|
|
398
398
|
modelKey: string;
|
|
@@ -2,7 +2,7 @@ import { useWidgetRegistry } from "../widget/useWidgetRegistry.mjs";
|
|
|
2
2
|
import { useModelField } from "../../use-model-field/use-model-field.mjs";
|
|
3
3
|
import "../../index.mjs";
|
|
4
4
|
import { clone, cloneDeep } from "lodash-es";
|
|
5
|
-
import { CategoryTypeEnum, FormComponents, Platform, ToolkitEnum } from "@gct-paas/core";
|
|
5
|
+
import { CategoryTypeEnum, ContextSceneEnum, FormComponents, Platform, ToolkitEnum } from "@gct-paas/core";
|
|
6
6
|
import { ref } from "vue";
|
|
7
7
|
import { getWidgetInfo } from "@gct-paas/schema";
|
|
8
8
|
//#region src/hooks/design-view/layout/useToolkit.ts
|
|
@@ -16,6 +16,7 @@ var instance = class ComponentUtils {
|
|
|
16
16
|
static SubTableGroup = "SubTableGroup";
|
|
17
17
|
static CardListGroup = "CardListGroup";
|
|
18
18
|
static TxnPageGroup = "TxnPageGroup";
|
|
19
|
+
static DetailPageGroup = "DetailPageGroup";
|
|
19
20
|
/** 按分组上下文存储分类组件映射,仅保留现有两套逻辑 */
|
|
20
21
|
static _categoryCompsMap = {
|
|
21
22
|
default: {
|
|
@@ -115,6 +116,26 @@ var instance = class ComponentUtils {
|
|
|
115
116
|
FormComponents.ResetButton
|
|
116
117
|
],
|
|
117
118
|
[CategoryTypeEnum.DATA]: [FormComponents.DataTable, FormComponents.Descriptions]
|
|
119
|
+
},
|
|
120
|
+
DetailPageGroup: {
|
|
121
|
+
[CategoryTypeEnum.FORM]: [
|
|
122
|
+
FormComponents.GenRadio,
|
|
123
|
+
FormComponents.GenCheckbox,
|
|
124
|
+
FormComponents.GenSwitch,
|
|
125
|
+
FormComponents.Text,
|
|
126
|
+
FormComponents.GenImage,
|
|
127
|
+
FormComponents.Form
|
|
128
|
+
],
|
|
129
|
+
[CategoryTypeEnum.LAYOUT]: [
|
|
130
|
+
FormComponents.Collapse,
|
|
131
|
+
FormComponents.SpaceOccupation,
|
|
132
|
+
FormComponents.Divider,
|
|
133
|
+
FormComponents.LayoutContainer,
|
|
134
|
+
FormComponents.Grid,
|
|
135
|
+
FormComponents.LeftRightColumns,
|
|
136
|
+
FormComponents.Tabs
|
|
137
|
+
],
|
|
138
|
+
[CategoryTypeEnum.DATA]: [FormComponents.DataTable, FormComponents.Descriptions]
|
|
118
139
|
}
|
|
119
140
|
};
|
|
120
141
|
static _instance;
|
|
@@ -138,6 +159,12 @@ var instance = class ComponentUtils {
|
|
|
138
159
|
CategoryTypeEnum.BUTTON,
|
|
139
160
|
CategoryTypeEnum.DATA
|
|
140
161
|
];
|
|
162
|
+
if (this.groupType === ComponentUtils.DetailPageGroup) return [
|
|
163
|
+
CategoryTypeEnum.FORM,
|
|
164
|
+
CategoryTypeEnum.LAYOUT,
|
|
165
|
+
CategoryTypeEnum.DATA,
|
|
166
|
+
CategoryTypeEnum.KIT
|
|
167
|
+
];
|
|
141
168
|
return [
|
|
142
169
|
CategoryTypeEnum.FORM,
|
|
143
170
|
CategoryTypeEnum.LAYOUT,
|
|
@@ -155,7 +182,19 @@ var instance = class ComponentUtils {
|
|
|
155
182
|
* @returns 当前上下文下允许使用的组件枚举值列表
|
|
156
183
|
*/
|
|
157
184
|
_getCompsForCategory(categoryType) {
|
|
158
|
-
|
|
185
|
+
let groupKey;
|
|
186
|
+
switch (this.groupType) {
|
|
187
|
+
case ComponentUtils.SubTableGroup:
|
|
188
|
+
groupKey = "SubTableGroup";
|
|
189
|
+
break;
|
|
190
|
+
case ComponentUtils.TxnPageGroup:
|
|
191
|
+
groupKey = "TxnPageGroup";
|
|
192
|
+
break;
|
|
193
|
+
case ComponentUtils.DetailPageGroup:
|
|
194
|
+
groupKey = "DetailPageGroup";
|
|
195
|
+
break;
|
|
196
|
+
default: groupKey = "default";
|
|
197
|
+
}
|
|
159
198
|
return ComponentUtils._categoryCompsMap[groupKey][categoryType] ?? [];
|
|
160
199
|
}
|
|
161
200
|
/**
|
|
@@ -163,9 +202,9 @@ var instance = class ComponentUtils {
|
|
|
163
202
|
*
|
|
164
203
|
* @param data - 当前选中组件数据
|
|
165
204
|
* @param modalState - 是否处于子表单(弹框)状态
|
|
166
|
-
* @param
|
|
205
|
+
* @param scene - 修改成场景,目前存在事务和详情两个场景 // _gct.store.context.scene
|
|
167
206
|
*/
|
|
168
|
-
changeGroupType({ data, modalState,
|
|
207
|
+
changeGroupType({ data, modalState, scene }) {
|
|
169
208
|
if (data.type === FormComponents.CardList) {
|
|
170
209
|
this._setGroupType(ComponentUtils.CardListGroup);
|
|
171
210
|
return;
|
|
@@ -174,10 +213,14 @@ var instance = class ComponentUtils {
|
|
|
174
213
|
this._setGroupType(ComponentUtils.SubTableGroup);
|
|
175
214
|
return;
|
|
176
215
|
}
|
|
177
|
-
if (
|
|
216
|
+
if (scene === ContextSceneEnum.TXN) {
|
|
178
217
|
this._setGroupType(ComponentUtils.TxnPageGroup);
|
|
179
218
|
return;
|
|
180
219
|
}
|
|
220
|
+
if (scene === ContextSceneEnum.DETAIL) {
|
|
221
|
+
this._setGroupType(ComponentUtils.DetailPageGroup);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
181
224
|
this._setGroupType("");
|
|
182
225
|
}
|
|
183
226
|
/** 更新组件分组上下文 */
|
|
@@ -297,12 +340,12 @@ function useToolkit() {
|
|
|
297
340
|
});
|
|
298
341
|
}
|
|
299
342
|
/** 根据当前选中组件的上下文刷新组件列表 */
|
|
300
|
-
function changeToolkitWidgets({ data, modalState,
|
|
343
|
+
function changeToolkitWidgets({ data, modalState, scene }) {
|
|
301
344
|
const oldGroupType = instance.groupType;
|
|
302
345
|
instance.changeGroupType({
|
|
303
346
|
data,
|
|
304
347
|
modalState,
|
|
305
|
-
|
|
348
|
+
scene
|
|
306
349
|
});
|
|
307
350
|
if (oldGroupType !== instance.groupType) toolkitWidgets.value = instance.getWidgetsToolkit({
|
|
308
351
|
platform: _gct.store.context.platform,
|
|
@@ -42,6 +42,11 @@ export declare function loadPageInfo(app: App): Promise<void>;
|
|
|
42
42
|
* @returns
|
|
43
43
|
*/
|
|
44
44
|
export declare function loadTxnPageInfo(app: App): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* 加载详情页面信息
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare function loadDetailPageInfo(app: App): Promise<void>;
|
|
45
50
|
/**
|
|
46
51
|
* @param mode 切换模式
|
|
47
52
|
*/
|
|
@@ -10,7 +10,7 @@ import { useCacheHistory } from "../../develop/useCacheHistory.mjs";
|
|
|
10
10
|
import { useToolkit } from "../layout/useToolkit.mjs";
|
|
11
11
|
import { useDesigner } from "../useDesigner.mjs";
|
|
12
12
|
import { isEmpty, isNil } from "lodash-es";
|
|
13
|
-
import { ButtonSize, ButtonStyle, FormComponents, KitPkgUtil, PanelEnum, Platform, t } from "@gct-paas/core";
|
|
13
|
+
import { ButtonSize, ButtonStyle, ContextSceneEnum, FormComponents, KitPkgUtil, PanelEnum, Platform, t } from "@gct-paas/core";
|
|
14
14
|
import { computed, createVNode, ref } from "vue";
|
|
15
15
|
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
|
16
16
|
import { Modal } from "ant-design-vue";
|
|
@@ -213,6 +213,79 @@ async function loadTxnPageInfo(app) {
|
|
|
213
213
|
savePageJsonSnapshot();
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
|
+
* 加载详情页面信息
|
|
217
|
+
* @returns
|
|
218
|
+
*/
|
|
219
|
+
async function loadDetailPageInfo(app) {
|
|
220
|
+
const { initToolkitWidgets } = useToolkit();
|
|
221
|
+
const { setPageJson, loadPageDesignHistoryList, emitCache, pageJson, setPluginConfigs, savePageJsonSnapshot } = useDesigner();
|
|
222
|
+
const { historyUtils } = useCacheHistory();
|
|
223
|
+
platform.value = _gct.store.context.platform || Platform.WEB;
|
|
224
|
+
const pid = _gct.store.context.pid || "";
|
|
225
|
+
if (pid.startsWith("___new___")) pageInfo.value = {
|
|
226
|
+
id: newKeyTag,
|
|
227
|
+
name: "",
|
|
228
|
+
key: pid.replace(`${newKeyTag}:`, ""),
|
|
229
|
+
designerJson: "",
|
|
230
|
+
_designerJson: "",
|
|
231
|
+
detailDesignerJson: ""
|
|
232
|
+
};
|
|
233
|
+
else {
|
|
234
|
+
const pageInfoRes = await _api.apaas.detailPage.getInfo({ id: _gct.store.context.pid });
|
|
235
|
+
pageInfo.value = pageInfoRes;
|
|
236
|
+
pageInfo.value._designerJson = pageInfoRes.designerJson;
|
|
237
|
+
}
|
|
238
|
+
const all = [];
|
|
239
|
+
if (_gct.store.appInfo.suiteKey) all.push(KitPkgUtil.loadDesign(_gct.store.appInfo.suiteKey).then((module) => {
|
|
240
|
+
if (module) module.setupApp(app);
|
|
241
|
+
}));
|
|
242
|
+
const _configs = [];
|
|
243
|
+
all.push(DesignPluginPgkUtil.loadDesignPlugin(app, platform.value, _gct.store.appInfo.suiteKey ? [_gct.store.appInfo.suiteKey] : void 0).then(([configs]) => {
|
|
244
|
+
_configs.push(...configs);
|
|
245
|
+
setPluginConfigs(configs);
|
|
246
|
+
}));
|
|
247
|
+
await Promise.all(all);
|
|
248
|
+
if (!historyUtils.isHistoryInfoExist(_gct.store.context.pid)) historyUtils.init({ historyId: _gct.store.context.pid ?? "" });
|
|
249
|
+
if (pageInfo.value.designerJson && !isNil(pageInfo.value.designerJson) && !isEmpty(pageInfo.value.designerJson)) {
|
|
250
|
+
const _json = JSON.parse(pageInfo.value.designerJson);
|
|
251
|
+
if (_json && _json.plugins) {
|
|
252
|
+
const items = _json.plugins.filter((item) => {
|
|
253
|
+
return _configs.findIndex((config) => config.key === item.key) === -1;
|
|
254
|
+
});
|
|
255
|
+
await DesignPluginPgkUtil.loadDesignDeletedPlugins(platform.value, items);
|
|
256
|
+
}
|
|
257
|
+
if (!_json.pageConfig) _json.pageConfig = {
|
|
258
|
+
title: "详情",
|
|
259
|
+
i18n: {},
|
|
260
|
+
hasFooter: false
|
|
261
|
+
};
|
|
262
|
+
setPageJson({
|
|
263
|
+
..._json,
|
|
264
|
+
id: pageInfo.value.id
|
|
265
|
+
}, true);
|
|
266
|
+
} else {
|
|
267
|
+
emitCache();
|
|
268
|
+
setPageJson({
|
|
269
|
+
newDesigner: true,
|
|
270
|
+
style: {
|
|
271
|
+
paddingAll: "",
|
|
272
|
+
paddingTop: "",
|
|
273
|
+
paddingRight: "16",
|
|
274
|
+
paddingBottom: "16",
|
|
275
|
+
paddingLeft: "16"
|
|
276
|
+
}
|
|
277
|
+
}, true);
|
|
278
|
+
}
|
|
279
|
+
initToolkitWidgets();
|
|
280
|
+
loadPageDesignHistoryList();
|
|
281
|
+
pagePermissions.value = await _api.apaas.permission.getList({ relationId: _gct.store.context.pid }) || [];
|
|
282
|
+
if (!pid.startsWith("___new___")) initLockState();
|
|
283
|
+
pageJson.pageConfig.title = pageJson.pageConfig.title || "详情";
|
|
284
|
+
pageJson.pageConfig.unitType = "%";
|
|
285
|
+
pageJson.pageConfig.pageWidth = 80;
|
|
286
|
+
savePageJsonSnapshot();
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
216
289
|
* @param mode 切换模式
|
|
217
290
|
*/
|
|
218
291
|
async function toggleTxnPageInfo(mode) {
|
|
@@ -240,7 +313,7 @@ async function toggleTxnPageInfo(mode) {
|
|
|
240
313
|
* 初始化界面占用信息
|
|
241
314
|
*/
|
|
242
315
|
function initLockState() {
|
|
243
|
-
if (_gct.store.context.scene ===
|
|
316
|
+
if (_gct.store.context.scene === ContextSceneEnum.TXN || _gct.store.context.scene === ContextSceneEnum.DETAIL) return;
|
|
244
317
|
const { setLockInfo, initOccupy, loadOccupyInfo } = useUserOccupy();
|
|
245
318
|
initOccupy({
|
|
246
319
|
id: _gct.store.context.pid || "",
|
|
@@ -289,4 +362,4 @@ function usePage() {
|
|
|
289
362
|
};
|
|
290
363
|
}
|
|
291
364
|
//#endregion
|
|
292
|
-
export { currentPanel, loadPageInfo, loadTxnPageInfo, lockPage, pagePermissions, togglePanel, toggleTxnPageInfo, unlockAvailable, usePage };
|
|
365
|
+
export { currentPanel, loadDetailPageInfo, loadPageInfo, loadTxnPageInfo, lockPage, pagePermissions, togglePanel, toggleTxnPageInfo, unlockAvailable, usePage };
|
|
@@ -1096,7 +1096,8 @@ export declare function useDesigner(): {
|
|
|
1096
1096
|
handleAddDrag: (newIndex: number, childrenList: LowCodeWidget.BasicSchema[], scope: SCOPE, formID?: string) => void;
|
|
1097
1097
|
setPageJson: (json: PageJson, hasFooter?: boolean) => Promise<void>;
|
|
1098
1098
|
setTxnPageJson: (json: PageJson, hasFooter?: boolean) => Promise<void>;
|
|
1099
|
-
|
|
1099
|
+
setDetailPageJson: (json: PageJson, hasFooter?: boolean) => Promise<void>;
|
|
1100
|
+
save: (flag?: boolean, showSuccess?: boolean, scene?: string) => Promise<boolean>;
|
|
1100
1101
|
savePageJsonSnapshot: (json?: PageJson) => void;
|
|
1101
1102
|
emitCache: () => void;
|
|
1102
1103
|
undoOrRestore: (content: string) => void;
|
|
@@ -56,6 +56,16 @@ function useDesigner() {
|
|
|
56
56
|
if (!pageJson.pageConfig.pageWidth) pageJson.pageConfig.pageWidth = 80;
|
|
57
57
|
cache.emitCache();
|
|
58
58
|
}
|
|
59
|
+
async function setDetailPageJson(json, hasFooter = false) {
|
|
60
|
+
pageJson.pageConfig.hasFooter = hasFooter || platform.value === Platform.MOBILE || platform.value === Platform.PAD;
|
|
61
|
+
Object.assign(pageJson, defaultPageJson, json);
|
|
62
|
+
initMethodMap(pageJson.js).then((map) => {
|
|
63
|
+
methodMap.value = map;
|
|
64
|
+
});
|
|
65
|
+
if (!pageJson.pageConfig.unitType) pageJson.pageConfig.unitType = "%";
|
|
66
|
+
if (!pageJson.pageConfig.pageWidth) pageJson.pageConfig.pageWidth = 80;
|
|
67
|
+
cache.emitCache();
|
|
68
|
+
}
|
|
59
69
|
/** 检查是否可以拖拽进入的方法,比如某些组件不能拖到某些组件内 */
|
|
60
70
|
function checkWidgetMove() {
|
|
61
71
|
return true;
|
|
@@ -77,6 +87,7 @@ function useDesigner() {
|
|
|
77
87
|
handleAddDrag,
|
|
78
88
|
setPageJson,
|
|
79
89
|
setTxnPageJson,
|
|
90
|
+
setDetailPageJson,
|
|
80
91
|
save: saveHook.save,
|
|
81
92
|
savePageJsonSnapshot: saveHook.savePageJsonSnapshot,
|
|
82
93
|
emitCache: cache.emitCache,
|
package/es/index.mjs
CHANGED
|
@@ -48,7 +48,7 @@ import { useDesignPreview } from "./hooks/design-view/designer/useDesignPreview.
|
|
|
48
48
|
import { useCacheHistory, useCacheHistoryInner } from "./hooks/develop/useCacheHistory.mjs";
|
|
49
49
|
import { useWidgetRegistry } from "./hooks/design-view/widget/useWidgetRegistry.mjs";
|
|
50
50
|
import { useToolkit } from "./hooks/design-view/layout/useToolkit.mjs";
|
|
51
|
-
import { currentPanel, loadPageInfo, loadTxnPageInfo, lockPage, pagePermissions, togglePanel, toggleTxnPageInfo, unlockAvailable, usePage } from "./hooks/design-view/page/usePage.mjs";
|
|
51
|
+
import { currentPanel, loadDetailPageInfo, loadPageInfo, loadTxnPageInfo, lockPage, pagePermissions, togglePanel, toggleTxnPageInfo, unlockAvailable, usePage } from "./hooks/design-view/page/usePage.mjs";
|
|
52
52
|
import { useWidgetQuery } from "./hooks/design-view/widget/useWidgetQuery.mjs";
|
|
53
53
|
import { useSelectedWidget } from "./hooks/design-view/widget/useSelectedWidget.mjs";
|
|
54
54
|
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, OCCUPY_MQTT_KEY, 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 };
|
|
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, OCCUPY_MQTT_KEY, 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, loadDetailPageInfo, 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 };
|
|
@@ -3,7 +3,7 @@ import { useScope } from "../../hooks/design-view/layout/useScope.mjs";
|
|
|
3
3
|
import { useDesigner } from "../../hooks/design-view/useDesigner.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import { has } from "lodash-es";
|
|
6
|
-
import { BindCmpStyleEnum, BindCmpStyleTypeEnum, EntityModelTypeEnum, FIELD_TYPE, FormComponents, MaterialEnum, Platform, PropGroup, TreeHelper } from "@gct-paas/core";
|
|
6
|
+
import { BindCmpStyleEnum, BindCmpStyleTypeEnum, ContextSceneEnum, EntityModelTypeEnum, FIELD_TYPE, FormComponents, MaterialEnum, Platform, PropGroup, TreeHelper } from "@gct-paas/core";
|
|
7
7
|
import { isFormFieldType } from "@gct-paas/schema";
|
|
8
8
|
//#region src/schema/common-config/common-field-editor-config.ts
|
|
9
9
|
/** 字段名称和显示标题config */
|
|
@@ -62,7 +62,7 @@ var getInputAttrEditor = (needFieldAttrs) => {
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
hidden(widget) {
|
|
65
|
-
return widget.props.field === "operating_state_" || widget.props.bindFieldKey || widget.materialType === MaterialEnum.DescriptionsFormField || widget.props.fieldReadonly;
|
|
65
|
+
return widget.props.field === "operating_state_" || widget.props.bindFieldKey || widget.materialType === MaterialEnum.DescriptionsFormField || widget.props.fieldReadonly || _gct.store.context.scene === ContextSceneEnum.DETAIL;
|
|
66
66
|
}
|
|
67
67
|
}];
|
|
68
68
|
};
|
|
@@ -118,6 +118,7 @@ var explainEditor = [{
|
|
|
118
118
|
formItemStyle: { marginBottom: "12px" },
|
|
119
119
|
group: PropGroup.FIELD_CONFIG,
|
|
120
120
|
hidden: (widget) => {
|
|
121
|
+
if (_gct.store.context.scene === ContextSceneEnum.DETAIL) return true;
|
|
121
122
|
if (widget.props.bindFieldKey || widget.props.fieldReadonly) return true;
|
|
122
123
|
if ((widget.materialType === MaterialEnum.MaterialFormField || widget.materialType === MaterialEnum.MaterialSubTableModalField) && widget.platform === Platform.PAD) return true;
|
|
123
124
|
return widget.platform !== Platform.WEB && widget.platform !== Platform.PAD;
|
|
@@ -160,7 +161,10 @@ var validatorEditor = [{
|
|
|
160
161
|
name: "closeValidator",
|
|
161
162
|
label: "sys.pageDesigner.closeValidator",
|
|
162
163
|
group: PropGroup.FIELD_CONFIG,
|
|
163
|
-
formField: true
|
|
164
|
+
formField: true,
|
|
165
|
+
hidden() {
|
|
166
|
+
return _gct.store.context.scene === ContextSceneEnum.DETAIL;
|
|
167
|
+
}
|
|
164
168
|
}];
|
|
165
169
|
/** 下拉列表、单选、多选公共config */
|
|
166
170
|
var SCREditorUtils = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hiddenButtonProps } from "./button-props-func.mjs";
|
|
2
|
-
import { ASSIGNMENTSTRATEGY_ENUM, Dependency_ENUM, FIELD_TYPE, FormComponents, MaterialEnum, Platform, PropGroup } from "@gct-paas/core";
|
|
2
|
+
import { ASSIGNMENTSTRATEGY_ENUM, ContextSceneEnum, Dependency_ENUM, FIELD_TYPE, FormComponents, MaterialEnum, Platform, PropGroup } from "@gct-paas/core";
|
|
3
3
|
import { padVTableSupportEditFieldTypes } from "@gct-paas/schema";
|
|
4
4
|
//#region src/schema/common-config/display-editor-config.ts
|
|
5
5
|
var displayProps = {
|
|
@@ -66,7 +66,7 @@ var displayEditor = [
|
|
|
66
66
|
label: "sys.pageDesigner.deviceConnectivity",
|
|
67
67
|
group: PropGroup.FIELD_CONFIG,
|
|
68
68
|
hidden: (widget) => {
|
|
69
|
-
return widget.platform !== Platform.WEB || ![MaterialEnum.MaterialFormField].includes(widget.materialType) || !deviceFields.includes(widget.props.fieldType) || widget.props.fieldReadonly;
|
|
69
|
+
return widget.platform !== Platform.WEB || ![MaterialEnum.MaterialFormField].includes(widget.materialType) || !deviceFields.includes(widget.props.fieldType) || widget.props.fieldReadonly || _gct.store.context.scene === ContextSceneEnum.DETAIL;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/design",
|
|
3
|
-
"version": "6.0.0-dev.
|
|
3
|
+
"version": "6.0.0-dev.3",
|
|
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": "^6.0.0-dev.
|
|
37
|
+
"@gct-paas/api": "^6.0.0-dev.3",
|
|
38
38
|
"@jsplumb/browser-ui": "^6.2.10",
|
|
39
39
|
"@vueuse/core": "^14.1.0",
|
|
40
40
|
"ant-design-vue": "npm:@gct-paas/ant-design-vue@3.2.21",
|
|
@@ -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/
|
|
55
|
-
"@gct-paas/core": "6.0.0-dev.
|
|
56
|
-
"@gct-paas/
|
|
57
|
-
"@gct-paas/
|
|
54
|
+
"@gct-paas/schema": "6.0.0-dev.3",
|
|
55
|
+
"@gct-paas/core": "6.0.0-dev.3",
|
|
56
|
+
"@gct-paas/scss": "6.0.0-dev.3",
|
|
57
|
+
"@gct-paas/core-web": "6.0.0-dev.3"
|
|
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": "^6.0.0-dev.
|
|
65
|
+
"@gct-paas/api": "^6.0.0-dev.3",
|
|
66
66
|
"vue": ">=3",
|
|
67
|
-
"@gct-paas/core": "6.0.0-dev.
|
|
68
|
-
"@gct-paas/core-web": "6.0.0-dev.
|
|
69
|
-
"@gct-paas/
|
|
70
|
-
"@gct-paas/
|
|
67
|
+
"@gct-paas/core": "6.0.0-dev.3",
|
|
68
|
+
"@gct-paas/core-web": "6.0.0-dev.3",
|
|
69
|
+
"@gct-paas/scss": "6.0.0-dev.3",
|
|
70
|
+
"@gct-paas/schema": "6.0.0-dev.3"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|