@gct-paas/design 6.0.0-dev.22 → 6.0.0-dev.24

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.
@@ -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, ContextSceneEnum, FormComponents, Platform, ToolkitEnum } from "@gct-paas/core";
5
+ import { CategoryTypeEnum, ContextSceneEnum, ContextTxnPageModeEnum, 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
@@ -148,23 +148,25 @@ var instance = class ComponentUtils {
148
148
  }
149
149
  /** 根据当前分组上下文返回应显示的分类列表 */
150
150
  get categoryTypes() {
151
- if (this.groupType === ComponentUtils.SubTableGroup) return [
151
+ let categoryTypes;
152
+ if (this.groupType === ComponentUtils.SubTableGroup) categoryTypes = [
152
153
  CategoryTypeEnum.FORM,
153
154
  CategoryTypeEnum.LAYOUT,
154
155
  CategoryTypeEnum.ADVANCED
155
156
  ];
156
- if (this.groupType === ComponentUtils.TxnPageGroup) return [
157
- CategoryTypeEnum.FORM,
158
- CategoryTypeEnum.LAYOUT,
159
- CategoryTypeEnum.DATA,
160
- CategoryTypeEnum.BUTTON
161
- ];
162
- if (this.groupType === ComponentUtils.DetailPageGroup) return [
157
+ else if (this.groupType === ComponentUtils.TxnPageGroup) {
158
+ categoryTypes = [
159
+ CategoryTypeEnum.FORM,
160
+ CategoryTypeEnum.LAYOUT,
161
+ CategoryTypeEnum.DATA
162
+ ];
163
+ if (_gct.store.context.txnPageMode === ContextTxnPageModeEnum.CREATE) categoryTypes = [...categoryTypes, CategoryTypeEnum.BUTTON];
164
+ } else if (this.groupType === ComponentUtils.DetailPageGroup) categoryTypes = [
163
165
  CategoryTypeEnum.FORM,
164
166
  CategoryTypeEnum.LAYOUT,
165
167
  CategoryTypeEnum.DATA
166
168
  ];
167
- return [
169
+ else categoryTypes = [
168
170
  CategoryTypeEnum.FORM,
169
171
  CategoryTypeEnum.LAYOUT,
170
172
  CategoryTypeEnum.ADVANCED,
@@ -173,6 +175,8 @@ var instance = class ComponentUtils {
173
175
  CategoryTypeEnum.KIT,
174
176
  CategoryTypeEnum.PROCESS
175
177
  ];
178
+ if (_gct.store.context.txnPageMode === ContextTxnPageModeEnum.CREATE) return categoryTypes.filter((categoryType) => categoryType !== CategoryTypeEnum.ADVANCED);
179
+ return categoryTypes;
176
180
  }
177
181
  /**
178
182
  * 根据分类类型返回当前上下文下允许使用的组件 key 列表
@@ -1,5 +1,5 @@
1
1
  import { Ref, App } from 'vue';
2
- import { PanelEnum } from '@gct-paas/core';
2
+ import { PanelEnum, ContextTxnPageModeEnum } from '@gct-paas/core';
3
3
  import { PermissionResponse } from '@gct-paas/api/apaas';
4
4
  export type { PageInfo } from '../design-state';
5
5
  export { pageInfo } from '../design-state';
@@ -50,7 +50,7 @@ export declare function loadDetailPageInfo(app: App): Promise<void>;
50
50
  /**
51
51
  * @param mode 切换模式
52
52
  */
53
- export declare function toggleTxnPageInfo(mode: 'create' | 'detail'): Promise<void>;
53
+ export declare function toggleTxnPageInfo(mode: ContextTxnPageModeEnum): Promise<void>;
54
54
  /**
55
55
  * 初始化界面占用信息
56
56
  */
@@ -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, ContextSceneEnum, FormComponents, KitPkgUtil, PanelEnum, Platform, t } from "@gct-paas/core";
13
+ import { ButtonSize, ButtonStyle, ContextSceneEnum, ContextTxnPageModeEnum, 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";
@@ -117,6 +117,7 @@ async function loadPageInfo(app) {
117
117
  * @returns
118
118
  */
119
119
  async function loadTxnPageInfo(app) {
120
+ await _gct.store.setContext({ txnPageMode: ContextTxnPageModeEnum.CREATE });
120
121
  const { initToolkitWidgets } = useToolkit();
121
122
  const { setPageJson, loadPageDesignHistoryList, emitCache, pageJson, setPluginConfigs, savePageJsonSnapshot } = useDesigner();
122
123
  const { historyUtils } = useCacheHistory();
@@ -149,6 +150,7 @@ async function loadTxnPageInfo(app) {
149
150
  } else {
150
151
  const pageInfoRes = await _api.apaas.transaction.getInfo({ id: _gct.store.context.pid });
151
152
  pageInfo.value = pageInfoRes;
153
+ pageInfo.value.default = Boolean(pageInfoRes.defaulted ?? false);
152
154
  pageInfo.value._designerJson = pageInfoRes.designerJson;
153
155
  pageInfo.value.txnPageMode = "create";
154
156
  }
@@ -290,8 +292,9 @@ async function loadDetailPageInfo(app) {
290
292
  * @param mode 切换模式
291
293
  */
292
294
  async function toggleTxnPageInfo(mode) {
295
+ await _gct.store.setContext({ txnPageMode: mode });
293
296
  const { setTxnPageJson, pageJson } = useDesigner();
294
- if (mode === "create") {
297
+ if (mode === ContextTxnPageModeEnum.CREATE) {
295
298
  pageInfo.value.detailDesignerJson = JSON.stringify(pageJson);
296
299
  pageInfo.value.txnPageMode = mode;
297
300
  setTxnPageJson({ ...JSON.parse(pageInfo.value._designerJson) });
@@ -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, ContextSceneEnum, EntityModelTypeEnum, FIELD_TYPE, FormComponents, MaterialEnum, Platform, PropGroup, TreeHelper } from "@gct-paas/core";
6
+ import { BindCmpStyleEnum, BindCmpStyleTypeEnum, ContextSceneEnum, ContextTxnPageModeEnum, 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 || _gct.store.context.scene === ContextSceneEnum.DETAIL;
65
+ return widget.props.field === "operating_state_" || widget.props.bindFieldKey || widget.materialType === MaterialEnum.DescriptionsFormField || widget.props.fieldReadonly || _gct.store.context.scene === ContextSceneEnum.DETAIL || _gct.store.context.txnPageMode === ContextTxnPageModeEnum.DETAIL;
66
66
  }
67
67
  }];
68
68
  };
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
2
2
  import { widget as widget$1 } from "./modal-body.mjs";
3
3
  import { widget as widget$2 } from "./modal-footer.mjs";
4
- import { BuiltinType, ContextSceneEnum, Platform, PropGroup, StyleGroup } from "@gct-paas/core";
4
+ import { BuiltinType, ContextSceneEnum, ContextTxnPageModeEnum, Platform, PropGroup, StyleGroup } from "@gct-paas/core";
5
5
  //#region src/schema/modal/modal.ts
6
6
  var modal_exports = /* @__PURE__ */ __exportAll({
7
7
  beforeCreate: () => beforeCreate,
@@ -145,7 +145,7 @@ var propEditorList = [
145
145
  label: "sys.pageDesigner.operateButton",
146
146
  group: PropGroup.BUTTON,
147
147
  hidden: (widget) => {
148
- return widget.props.isSubTableModal || _gct.store.context.scene === ContextSceneEnum.DETAIL;
148
+ return widget.props.isSubTableModal || _gct.store.context.scene === ContextSceneEnum.DETAIL || _gct.store.context.txnPageMode === ContextTxnPageModeEnum.DETAIL;
149
149
  }
150
150
  }
151
151
  ];
@@ -166,7 +166,7 @@ var eventList = [{
166
166
  }];
167
167
  var runCallback = () => {};
168
168
  var beforeCreate = (widget) => {
169
- if (_gct.store.context.scene === ContextSceneEnum.DETAIL) widget.props.hasFooter = false;
169
+ if (_gct.store.context.scene === ContextSceneEnum.DETAIL || _gct.store.context.txnPageMode === ContextTxnPageModeEnum.DETAIL) widget.props.hasFooter = false;
170
170
  };
171
171
  var designerConfig = { basicProps: {
172
172
  key_label: "弹窗",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/design",
3
- "version": "6.0.0-dev.22",
3
+ "version": "6.0.0-dev.24",
4
4
  "type": "module",
5
5
  "description": "paas 平台设计界面底包",
6
6
  "loader": "dist/loader.esm.min.js",
@@ -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": "6.0.0-dev.22",
55
- "@gct-paas/core-web": "6.0.0-dev.22",
56
- "@gct-paas/scss": "6.0.0-dev.22",
57
- "@gct-paas/schema": "6.0.0-dev.22"
54
+ "@gct-paas/core": "6.0.0-dev.24",
55
+ "@gct-paas/scss": "6.0.0-dev.24",
56
+ "@gct-paas/schema": "6.0.0-dev.24",
57
+ "@gct-paas/core-web": "6.0.0-dev.24"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/babel__core": "^7.20.5",
@@ -64,10 +64,10 @@
64
64
  "peerDependencies": {
65
65
  "@gct-paas/api": "^6.0.0-dev.9",
66
66
  "vue": ">=3",
67
- "@gct-paas/core": "6.0.0-dev.22",
68
- "@gct-paas/core-web": "6.0.0-dev.22",
69
- "@gct-paas/schema": "6.0.0-dev.22",
70
- "@gct-paas/scss": "6.0.0-dev.22"
67
+ "@gct-paas/core": "6.0.0-dev.24",
68
+ "@gct-paas/core-web": "6.0.0-dev.24",
69
+ "@gct-paas/schema": "6.0.0-dev.24",
70
+ "@gct-paas/scss": "6.0.0-dev.24"
71
71
  },
72
72
  "scripts": {
73
73
  "dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",