@gct-paas/core 0.0.1-dev.16 → 0.0.1-dev.17

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.
@@ -140,5 +140,33 @@ export declare enum EditorTypeOld {
140
140
  /**
141
141
  * 复选框
142
142
  */
143
- CHECKBOX = "checkbox-editor"
143
+ CHECKBOX = "checkbox-editor",
144
+ /**
145
+ * 边距
146
+ */
147
+ BORDER = "border-editor",
148
+ /**
149
+ * 边框圆角
150
+ */
151
+ BORDER_RADIUS = "border-radius-editor",
152
+ /**
153
+ * 文本对齐方式
154
+ */
155
+ ALIGN = "align-editor",
156
+ /**
157
+ * 字体样式
158
+ */
159
+ FONT_STYLE = "font-style-editor",
160
+ /**
161
+ * 位置
162
+ */
163
+ POSITION = "position-editor",
164
+ /**
165
+ * 间距
166
+ */
167
+ SPACING = "spacing-editor",
168
+ /**
169
+ * 间距
170
+ */
171
+ MARGIN = "margin-editor"
144
172
  }
@@ -35,6 +35,13 @@ var EditorTypeOld = /* @__PURE__ */ ((EditorTypeOld2) => {
35
35
  EditorTypeOld2["CHECK_SWITCH"] = "check-switch-editor";
36
36
  EditorTypeOld2["ICON_SELECT"] = "icon-select-editor";
37
37
  EditorTypeOld2["CHECKBOX"] = "checkbox-editor";
38
+ EditorTypeOld2["BORDER"] = "border-editor";
39
+ EditorTypeOld2["BORDER_RADIUS"] = "border-radius-editor";
40
+ EditorTypeOld2["ALIGN"] = "align-editor";
41
+ EditorTypeOld2["FONT_STYLE"] = "font-style-editor";
42
+ EditorTypeOld2["POSITION"] = "position-editor";
43
+ EditorTypeOld2["SPACING"] = "spacing-editor";
44
+ EditorTypeOld2["MARGIN"] = "margin-editor";
38
45
  return EditorTypeOld2;
39
46
  })(EditorTypeOld || {});
40
47
 
@@ -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';
@@ -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.17",
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.17",
60
+ "@gct-paas/cli": "0.0.1-dev.17",
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": "419dd717051ab05e03f561d8215a5ba6309816c2"
69
69
  }