@gct-paas/core 0.0.1-dev.16 → 0.0.1-dev.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.
@@ -105,6 +105,10 @@ export declare enum EditorTypeOld {
105
105
  * 下拉选择编辑器
106
106
  */
107
107
  SELECT = "select-editor",
108
+ /**
109
+ * 下拉选择编辑器
110
+ */
111
+ MODEL_SELECT = "model-editor",
108
112
  /**
109
113
  * 单选框编辑器
110
114
  */
@@ -140,5 +144,33 @@ export declare enum EditorTypeOld {
140
144
  /**
141
145
  * 复选框
142
146
  */
143
- CHECKBOX = "checkbox-editor"
147
+ CHECKBOX = "checkbox-editor",
148
+ /**
149
+ * 边距
150
+ */
151
+ BORDER = "border-editor",
152
+ /**
153
+ * 边框圆角
154
+ */
155
+ BORDER_RADIUS = "border-radius-editor",
156
+ /**
157
+ * 文本对齐方式
158
+ */
159
+ ALIGN = "align-editor",
160
+ /**
161
+ * 字体样式
162
+ */
163
+ FONT_STYLE = "font-style-editor",
164
+ /**
165
+ * 位置
166
+ */
167
+ POSITION = "position-editor",
168
+ /**
169
+ * 间距
170
+ */
171
+ SPACING = "spacing-editor",
172
+ /**
173
+ * 间距
174
+ */
175
+ MARGIN = "margin-editor"
144
176
  }
@@ -26,6 +26,7 @@ var EditorTypeOld = /* @__PURE__ */ ((EditorTypeOld2) => {
26
26
  EditorTypeOld2["NUMBER"] = "number-editor";
27
27
  EditorTypeOld2["INFO"] = "info-editor";
28
28
  EditorTypeOld2["SELECT"] = "select-editor";
29
+ EditorTypeOld2["MODEL_SELECT"] = "model-editor";
29
30
  EditorTypeOld2["RADIO"] = "radio-editor";
30
31
  EditorTypeOld2["PICKER"] = "picker-editor";
31
32
  EditorTypeOld2["I18N"] = "i18n-editor";
@@ -35,6 +36,13 @@ var EditorTypeOld = /* @__PURE__ */ ((EditorTypeOld2) => {
35
36
  EditorTypeOld2["CHECK_SWITCH"] = "check-switch-editor";
36
37
  EditorTypeOld2["ICON_SELECT"] = "icon-select-editor";
37
38
  EditorTypeOld2["CHECKBOX"] = "checkbox-editor";
39
+ EditorTypeOld2["BORDER"] = "border-editor";
40
+ EditorTypeOld2["BORDER_RADIUS"] = "border-radius-editor";
41
+ EditorTypeOld2["ALIGN"] = "align-editor";
42
+ EditorTypeOld2["FONT_STYLE"] = "font-style-editor";
43
+ EditorTypeOld2["POSITION"] = "position-editor";
44
+ EditorTypeOld2["SPACING"] = "spacing-editor";
45
+ EditorTypeOld2["MARGIN"] = "margin-editor";
38
46
  return EditorTypeOld2;
39
47
  })(EditorTypeOld || {});
40
48
 
@@ -13,6 +13,7 @@ import { GctFormController } from '../gct-form/gct-form.controller';
13
13
  export declare class EditFormController extends GctFormController implements IEditFormController {
14
14
  model: IEditForm;
15
15
  protected initEvent(): void;
16
+ autoSave(): Promise<IData>;
16
17
  save(): Promise<IData>;
17
18
  }
18
19
  /**
@@ -19,8 +19,14 @@ class EditFormController extends GctFormController {
19
19
  if (val != oldVal) {
20
20
  this.calcHidden();
21
21
  }
22
+ if (this.model.autosave === true && this.state.loading === false) {
23
+ this.autoSave();
24
+ }
22
25
  });
23
26
  }
27
+ autoSave() {
28
+ return this.save();
29
+ }
24
30
  save() {
25
31
  const data = this.getData();
26
32
  if (this.state.isNew === true && this.model.newRequest) {
@@ -8,10 +8,10 @@ function useGctFormValue(key) {
8
8
  const form = useForm();
9
9
  val = computed({
10
10
  get() {
11
- return form.state.data[key];
11
+ return form.item[key].value;
12
12
  },
13
13
  set(val2) {
14
- form.state.data[key] = val2;
14
+ form.item[key].value = val2;
15
15
  }
16
16
  });
17
17
  } else {
@@ -17,4 +17,10 @@ export interface IEditFormController extends IFormController {
17
17
  * @return {*} {Promise<IData>}
18
18
  */
19
19
  save(): Promise<IData>;
20
+ /**
21
+ * 自动保存表单数据(值变化时就触发)
22
+ *
23
+ * @returns {*} {Promise<IData>}
24
+ */
25
+ autoSave(): Promise<IData>;
20
26
  }
@@ -18,6 +18,12 @@ export interface IEditForm extends IForm {
18
18
  * @date 2024-06-11 17:06:55
19
19
  */
20
20
  watch?: Record<string, (form: IFormController, val: any, oldValue: any) => void>;
21
+ /**
22
+ * 自动保存
23
+ *
24
+ * @type {boolean}
25
+ */
26
+ autosave?: boolean;
21
27
  /**
22
28
  * 新建请求
23
29
  *
@@ -16,3 +16,4 @@ export type * from './layout';
16
16
  export type * from './low-code-types';
17
17
  export type * from './provider';
18
18
  export type * from './state';
19
+ export type * from './style';
@@ -341,8 +341,13 @@ export declare namespace LowCodeWidget {
341
341
  * editor内部的自定义config逻辑
342
342
  */
343
343
  _config?: Partial<StyleEditorConfig>;
344
+ /** 表单编辑器额外配置 */
345
+ editor?: Record<string, any>;
346
+ /** 表单项配置 */
347
+ formItem?: Record<string, any>;
344
348
  }
345
349
  interface StyleEditorConfig {
350
+ [key: string]: any;
346
351
  options: Function | {
347
352
  label: string;
348
353
  value: string | boolean | number;
@@ -389,6 +394,10 @@ export declare namespace LowCodeWidget {
389
394
  * editor内部的自定义config逻辑
390
395
  */
391
396
  _config?: Partial<PropEditorConfig>;
397
+ /** 表单项额外配置 */
398
+ editor?: Record<string, any>;
399
+ /** 表单项配置 */
400
+ formItem?: Record<string, any>;
392
401
  /**prop变时的callback */
393
402
  changeCallback?: (arg: BasicSchema, val: any) => void;
394
403
  /** 是否是纯表单字段配置(在 hidden 方法之后执行,如果为 false 直接隐藏)只针对于字段 */
@@ -403,6 +412,7 @@ export declare namespace LowCodeWidget {
403
412
  }
404
413
  /**editor属性 */
405
414
  interface PropEditorConfig {
415
+ [key: string]: any;
406
416
  width?: number;
407
417
  filterFields: FIELD_TYPE[];
408
418
  filterTypes: CreateType[];
@@ -0,0 +1,16 @@
1
+ import { BorderStyle } from '../../enums';
2
+ export interface IBorderItem {
3
+ style?: BorderStyle;
4
+ color?: string;
5
+ width?: string;
6
+ }
7
+ export interface IBorder {
8
+ top?: IBorderItem;
9
+ right?: IBorderItem;
10
+ bottom?: IBorderItem;
11
+ left?: IBorderItem;
12
+ topRightRadius?: string;
13
+ topLeftRadius?: string;
14
+ bottomRightRadius?: string;
15
+ bottomLeftRadius?: string;
16
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,9 @@
1
+ import { TextAlign, TextDecoration } from '../../enums';
2
+ export interface IFont {
3
+ fontSize?: string;
4
+ bold: boolean;
5
+ italic: boolean;
6
+ textDecoration: TextDecoration;
7
+ color: string;
8
+ align: TextAlign;
9
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,2 @@
1
+ import { ISpacing } from './i-spacing';
2
+ export type IMargin = ISpacing;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,2 @@
1
+ import { ISpacing } from './i-spacing';
2
+ export type IPadding = ISpacing;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 定位接口
3
+ * @author lingxiaoming
4
+ * @date 2024-07-16 06:33:18
5
+ * @export
6
+ * @interface IPosition
7
+ */
8
+ export interface IPosition {
9
+ position?: string;
10
+ top?: string;
11
+ left?: string;
12
+ right?: string;
13
+ bottom?: string;
14
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 样式间距接口
3
+ * @author lingxiaoming
4
+ * @date 2024-07-16 02:30:20
5
+ * @export
6
+ * @interface ISpacing
7
+ */
8
+ export interface ISpacing {
9
+ top?: string;
10
+ right?: string;
11
+ bottom?: string;
12
+ left?: string;
13
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,6 @@
1
+ export type { IBorder, IBorderItem } from './i-border';
2
+ export type { ISpacing } from './i-spacing';
3
+ export type { IPadding } from './i-padding';
4
+ export type { IMargin } from './i-margin';
5
+ export type { IPosition } from './i-position';
6
+ export type { IFont } from './i-font';
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,5 +1,5 @@
1
1
  import { AxiosHeaders } from 'axios';
2
- import { getTimezone, getToken, isMobile, getPathQuery } from '../tools/tools.mjs';
2
+ import { getTimezone, isMobile, getToken, getPathQuery } from '../tools/tools.mjs';
3
3
  import '../../enums/index.mjs';
4
4
  import { ProjectName } from '../../enums/appEnum.mjs';
5
5
 
@@ -9,8 +9,9 @@ import { IEditorProvider } from '../../interface';
9
9
  * @param {string} providerTag
10
10
  * @param {() => IEditorProvider} provider
11
11
  * @param {*} [com]
12
+ * @param {string} [comName]
12
13
  * @return {*}
13
14
  */
14
- export declare function widthEditorInstall(providerTag: string, provider: () => IEditorProvider, com?: any): {
15
+ export declare function widthEditorInstall(providerTag: string, provider: () => IEditorProvider, com?: any, comName?: string): {
15
16
  install(app: App): void;
16
17
  };
@@ -2,7 +2,7 @@ import '../../constants/index.mjs';
2
2
  import { EditorRegisterConst } from '../../constants/editor-register/editor-register.mjs';
3
3
 
4
4
  "use strict";
5
- function widthEditorInstall(providerTag, provider, com) {
5
+ function widthEditorInstall(providerTag, provider, com, comName) {
6
6
  return {
7
7
  install(app) {
8
8
  if (providerTag && provider) {
@@ -12,7 +12,7 @@ function widthEditorInstall(providerTag, provider, com) {
12
12
  );
13
13
  }
14
14
  if (com) {
15
- app.component(com.name, com);
15
+ app.component(comName ?? com.name, com);
16
16
  }
17
17
  }
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/core",
3
- "version": "0.0.1-dev.16",
3
+ "version": "0.0.1-dev.18",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "main": "dist/index.min.cjs",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "async-validator": "^4.2.5",
48
- "axios": "^1.7.9",
48
+ "axios": "^1.8.1",
49
49
  "lodash-es": "^4.17.21",
50
50
  "path-browserify": "^1.0.1",
51
51
  "pinia": "^2.3.1",
@@ -56,8 +56,8 @@
56
56
  "vue-i18n": "9.6.5"
57
57
  },
58
58
  "devDependencies": {
59
- "@gct-paas/build": "0.0.1-dev.16",
60
- "@gct-paas/cli": "0.0.1-dev.16",
59
+ "@gct-paas/build": "0.0.1-dev.18",
60
+ "@gct-paas/cli": "0.0.1-dev.18",
61
61
  "@types/path-browserify": "^1.0.3",
62
62
  "@types/qs": "^6.9.18",
63
63
  "fs-extra": "^11.3.0"
@@ -65,5 +65,5 @@
65
65
  "peerDependencies": {
66
66
  "vue": "^3.x"
67
67
  },
68
- "gitHead": "3f734811e73d13f92b0ef823fa0b9866da212d9c"
68
+ "gitHead": "0a61c5593beffb2a893dffde18fc6759983b72cb"
69
69
  }