@kengic/vue 0.2.2-beta.8 → 0.3.0

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.
Files changed (32) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/kengic-vue.js +3679 -3279
  3. package/dist/src/apis/WMS/Controllers/VarCatalogController/List.d.ts +8 -8
  4. package/dist/src/apis/WMS/Controllers/VarContextController/List.d.ts +9 -1
  5. package/dist/src/apis/WMS/models.d.ts +72 -42
  6. package/dist/src/components/KgControl/KgControl.Date.d.ts +21 -27
  7. package/dist/src/components/KgControl/KgControl.Input.d.ts +21 -27
  8. package/dist/src/components/KgControl/KgControl.InputNumber.d.ts +21 -27
  9. package/dist/src/components/KgControl/KgControl.Select.d.ts +23 -29
  10. package/dist/src/components/KgControl/KgControl.Switch.d.ts +21 -27
  11. package/dist/src/components/KgControl/KgControl.d.ts +29 -36
  12. package/dist/src/components/KgControl/addon/KgControl.Addon.Lookup.d.ts +4 -0
  13. package/dist/src/components/KgControl/index.d.ts +1 -1
  14. package/dist/src/components/KgControl/index.vm.d.ts +21 -28
  15. package/dist/src/components/KgResizable/KgResizable.d.ts +131 -0
  16. package/dist/src/components/KgResizable/index.d.ts +1 -0
  17. package/dist/src/components/KgSearch/KgSearch.data.d.ts +11 -2
  18. package/dist/src/components/KgSearch/index.hooks.d.ts +1 -3
  19. package/dist/src/components/KgSearch/index.store.d.ts +1 -5
  20. package/dist/src/components/KgTable/KgTable.data.d.ts +2 -0
  21. package/dist/src/components/KgTable/index.hooks.d.ts +5 -3
  22. package/dist/src/components/KgTable/index.store.d.ts +14 -6
  23. package/dist/src/components/KgVar/index.hooks.d.ts +13 -7
  24. package/dist/src/components/KgVar/index.store.d.ts +38 -13
  25. package/dist/src/components/index.d.ts +1 -0
  26. package/dist/src/consts/i18n/en.d.ts +1 -0
  27. package/dist/src/consts/i18n/index.d.ts +2 -0
  28. package/dist/src/consts/i18n/zh_CN.d.ts +1 -0
  29. package/dist/src/consts/index.d.ts +7 -0
  30. package/dist/src/utils/kg.util.d.ts +10 -0
  31. package/dist/src/utils/var.util.d.ts +1 -1
  32. package/package.json +2 -2
@@ -13,12 +13,10 @@ export declare type IKgSearchResetFn = () => void;
13
13
  export interface KgSearchState {
14
14
  /** 是否准备就绪. 即查询条件是否已经初始化完成了. */
15
15
  isReadyMap: Map<string, boolean>;
16
- /** 表单数据. */
16
+ /** 表单数据对象. */
17
17
  modelMap: Map<string, Record<string, any>>;
18
18
  /** 表单组件. */
19
19
  formMap: Map<string, ReturnType<typeof Form.useForm>>;
20
- /** 表单区的高度. */
21
- heightMap: Map<string, number>;
22
20
  /** '查询'事件监听函数列表. */
23
21
  onSearchListenersMap: Map<string, Array<IKgSearchSearchCb>>;
24
22
  /** '重置'事件监听函数列表. */
@@ -32,13 +30,11 @@ export declare type KgSearchStoreDefinition = StoreDefinition<'KgSearch', KgSear
32
30
  getIsReady(): (formID?: string | null) => boolean;
33
31
  getModel(): (formID?: string | null) => Record<string, any> | null;
34
32
  getForm(): (formID?: string | null) => ReturnType<typeof Form.useForm> | null;
35
- getHeight(): (formID?: string | null) => number | null;
36
33
  getSearchFn(): (formID?: string | null) => IKgSearchSearchFn | null;
37
34
  getResetFn(): (formID?: string | null) => IKgSearchResetFn | null;
38
35
  }, {
39
36
  setIsReady: (formID?: string | null, ready?: boolean) => void;
40
37
  setModel: (formID: string, model: Record<string, any>) => void;
41
- setHeight: (formID: string, height: number) => void;
42
38
  addEventListener: (formID: string, event: IKgSearchEvent, cb: IKgSearchSearchCb) => void;
43
39
  removeEventListener: (formID: string, event: IKgSearchEvent, cb?: IKgSearchSearchCb | IKgSearchResetCb) => void;
44
40
  setSearchFn: (formID?: string | null, fn?: IKgSearchSearchFn | null) => void;
@@ -2,7 +2,9 @@ import { ComputedRef, Ref, UnwrapRef } from 'vue';
2
2
  import { ColumnsType } from 'ant-design-vue/es/table';
3
3
  import { IKgTableRecord } from './index.vm';
4
4
  export declare type IUseColumns = {
5
+ /** 表格的列. */
5
6
  columns: ComputedRef<ColumnsType<IKgTableRecord>>;
7
+ /** 横向滚动宽度. */
6
8
  scrollX: ComputedRef<string>;
7
9
  };
8
10
  export declare function _useColumns(): IUseColumns;
@@ -1,15 +1,17 @@
1
1
  import { ComputedRef } from 'vue';
2
- import { IKgTableRowDoubleClickCb, KgTableStore } from './index.store';
2
+ import { IKgTableRetrieveCb, IKgTableRowDoubleClickCb, KgTableStore } from './index.store';
3
3
  export declare type IUseKgTable = {
4
4
  formID: string;
5
5
  /** 状态数据. */
6
- kgTableStore: KgTableStore;
6
+ store: KgTableStore;
7
7
  /** 当前勾选的行. */
8
8
  selectedRows: ComputedRef<ReturnType<KgTableStore['getSelectedRows']>>;
9
9
  /** 是否正在查询. */
10
10
  isRetrieving: ComputedRef<ReturnType<KgTableStore['getIsRetrieving']>>;
11
- /** 监听双击事件. */
11
+ /** 监听事件: 双击某行. */
12
12
  onRowDoubleClick(cb: IKgTableRowDoubleClickCb): void;
13
+ /** 监听事件: 查询数据成功. */
14
+ onRetrieve(cb: IKgTableRetrieveCb): void;
13
15
  };
14
16
  /**
15
17
  * @param formID 界面标识.
@@ -1,9 +1,16 @@
1
1
  import { StoreDefinition } from 'pinia';
2
2
  import { IKgTableRecord } from './index.vm';
3
- /** 事件类型. */
4
- export declare type IKgTableEvent = 'rowDoubleClick';
5
- /** '双击某行'事件监听函数. */
3
+ import { IPage } from '../../apis/WMS/models';
4
+ /**
5
+ * 事件类型.
6
+ * 'rowDoubleClick': 双击某行
7
+ * 'retrieve': 查询数据成功
8
+ */
9
+ export declare type IKgTableEvent = 'rowDoubleClick' | 'retrieve';
10
+ /** 事件监听函数: 双击某行. */
6
11
  export declare type IKgTableRowDoubleClickCb = (record: IKgTableRecord) => void;
12
+ /** 事件监听函数: 查询数据成功. */
13
+ export declare type IKgTableRetrieveCb = (page: IPage<IKgTableRecord> | undefined | null) => void;
7
14
  export interface KgTableState {
8
15
  /** 勾选的行. */
9
16
  selectedRowsMap: Map<string, Array<IKgTableRecord>>;
@@ -18,7 +25,8 @@ export interface KgTableState {
18
25
  /** 表格宽度. */
19
26
  tableWidthMap: Map<string, number>;
20
27
  /** '双击某行'事件监听函数列表. */
21
- onRowDoubleClickListenersMap: Map<string, Array<IKgTableRowDoubleClickCb>>;
28
+ rowDoubleClickListenersMap: Map<string, Array<IKgTableRowDoubleClickCb>>;
29
+ retrieveListenersMap: Map<string, Array<IKgTableRetrieveCb>>;
22
30
  }
23
31
  export declare type KgTableStoreDefinition = StoreDefinition<'KgTable', KgTableState, {
24
32
  getSelectedRows(): (formID?: string | null) => Array<IKgTableRecord> | null;
@@ -27,8 +35,8 @@ export declare type KgTableStoreDefinition = StoreDefinition<'KgTable', KgTableS
27
35
  getTableWidth(): (formID?: string | null) => number | null;
28
36
  }, {
29
37
  dispose: (formID?: string | null) => void;
30
- addEventListener: (formID: string, event: IKgTableEvent, cb: IKgTableRowDoubleClickCb) => void;
31
- removeEventListener: (formID: string, event: IKgTableEvent, cb?: IKgTableRowDoubleClickCb) => void;
38
+ addEventListener: (formID: string, event: IKgTableEvent, cb: IKgTableRowDoubleClickCb | IKgTableRetrieveCb) => void;
39
+ removeEventListener: (formID: string, event: IKgTableEvent, cb?: IKgTableRowDoubleClickCb | IKgTableRetrieveCb) => void;
32
40
  emit: (formID: string, event: IKgTableEvent, record?: any | null) => void;
33
41
  setSelectedRows(formID: string, selectedRows: Array<IKgTableRecord>): void;
34
42
  setIsRetrieved(formID: string, value: boolean): void;
@@ -2,8 +2,14 @@ import { ComputedRef } from 'vue';
2
2
  import { IKgVarStore } from './index.store';
3
3
  import { VarProfileDetail } from '../../apis/WMS/models';
4
4
  export declare type IUseKgVar = {
5
+ /** 界面标识. */
5
6
  formID: string;
6
- kgVarStore: IKgVarStore;
7
+ /** 状态数据. */
8
+ store: IKgVarStore;
9
+ isRetrieving: ComputedRef<ReturnType<IKgVarStore['isRetrieving']>>;
10
+ isCreating: ComputedRef<ReturnType<IKgVarStore['isCreating']>>;
11
+ isUpdating: ComputedRef<ReturnType<IKgVarStore['isUpdating']>>;
12
+ isCopying: ComputedRef<ReturnType<IKgVarStore['isCopying']>>;
7
13
  /** 所有按钮. */
8
14
  varButtons: ComputedRef<ReturnType<IKgVarStore['getVarButtons']>>;
9
15
  /** 表格配置. */
@@ -18,14 +24,14 @@ export declare type IUseKgVar = {
18
24
  varProfileDetails: ComputedRef<Array<VarProfileDetail> | null>;
19
25
  /** 所有要显示的查询字段. */
20
26
  visibleVarProfileDetails: ComputedRef<Array<VarProfileDetail> | null>;
21
- t1: (var_nam?: string | null) => ComputedRef<string>;
22
- t2: (var_nam?: string | null) => string;
27
+ t: (var_nam?: string | null) => ComputedRef<string>;
23
28
  };
24
29
  /**
25
30
  * 启用变量.
26
- * 1. 在子组件中调用时, 可以不传该参数, 此时会通过依赖注入获取.
27
- * 2. 在寄生页面中想访问宿主页面的变量配置时, 需要传宿主页面的界面标识.
28
- * 3. 在组件外调用时, 必须传界面标识.
31
+ * 1. 在下级组件中调用时, 可以不传该参数, 此时会通过依赖注入获取.
32
+ * 2. 在任意页面中, 想要访问其他界面标识对应的页面的数据, 需要传入该'界面标识'.
33
+ * 3. 在组件外(setup 外面)调用时, 必须传入'界面标识'.
29
34
  * @param formID 界面标识.
35
+ * @param init 是否要初始化界面. 在'宿主页面'第一次调用时, 需要传 true, 对该页面做初始化.
30
36
  */
31
- export declare function useKgVar(formID?: string | null): IUseKgVar;
37
+ export declare function useKgVar(formID?: string | null, init?: boolean): IUseKgVar;
@@ -1,5 +1,5 @@
1
1
  import { type StoreDefinition } from 'pinia';
2
- import { VarButton, VarCatalog, VarConfig, VarGridConfig, VarGridDetail, VarGridDTO, VarGridMasterDTO, VarLookup, VarPossibility, VarProfileDetail, VarProfileDTO, VarProfileMasterDTO } from '../../apis/WMS/models';
2
+ import { VarButton, VarCatalog, VarConfig, VarGridConfig, VarGridDetail, VarGridDTO, VarGridMasterDTO, VarLookup, VarPossibility, VarProfileDetail, VarProfileDTO, VarProfileMasterDTO, VarSubmitField } from '../../apis/WMS/models';
3
3
  export interface KgVarState {
4
4
  /**
5
5
  * 当前可能打开了多个界面, 需要按照先后顺序记录下来, 当打开变量配置弹窗时, 打开的是最近那个页面的变量配置.
@@ -7,60 +7,85 @@ export interface KgVarState {
7
7
  formIDs: Array<string>;
8
8
  /** 正在查询变量配置. */
9
9
  isRetrievingMap: Map<string, boolean>;
10
- /** 变量别名. */
10
+ /** 正在创建. */
11
+ isCreatingMap: Map<string, boolean>;
12
+ /** 正在更新. */
13
+ isUpdatingMap: Map<string, boolean>;
14
+ /** 正在复制. */
15
+ isCopyingMap: Map<string, boolean>;
11
16
  varCatalogsMap: Map<string, Array<VarCatalog>>;
12
- /** 变量查找. */
13
17
  varLookupsMap: Map<string, Array<VarLookup>>;
14
- /** 变量下拉列表配置. */
15
18
  varPossibilitiesMap: Map<string, Array<VarPossibility>>;
16
- /** 变量控件配置. */
17
19
  varConfigsMap: Map<string, Array<VarConfig>>;
18
- /** 按钮. */
19
20
  varButtonsMap: Map<string, Array<VarButton>>;
20
- /** 查询条件. */
21
+ varSubmitFieldsMap: Map<string, Array<VarSubmitField>>;
21
22
  varProfileMap: Map<string, {
22
23
  varProfile: VarProfileDTO | null;
23
- /** 当前查询条件. */
24
+ /** 当前选中的 VarProfileMaster ID. */
24
25
  currentVarProfileMasterID: string | null;
25
26
  }>;
26
- /** 表格配置. */
27
- varGridConfigMap: Map<string, VarGridConfig | null>;
28
- /** 表格. */
29
27
  varGridMap: Map<string, {
30
28
  varGrid: VarGridDTO | null;
31
29
  /** 当前表格视图. */
32
30
  currentVarGridMasterID: string | null;
33
31
  }>;
32
+ varGridConfigMap: Map<string, VarGridConfig | null>;
34
33
  }
35
34
  export declare type IKgVarStoreDefinition = StoreDefinition<'KgVar', KgVarState, {
36
35
  getTopFormID(): string | null;
37
36
  isRetrieving(): (formID?: string | null) => boolean | null;
37
+ isCreating(): (formID?: string | null) => boolean | null;
38
+ isUpdating(): (formID?: string | null) => boolean | null;
39
+ isCopying(): (formID?: string | null) => boolean | null;
38
40
  getVarCatalogs(): (formID?: string | null) => Array<VarCatalog> | null;
39
41
  getVarCatalog(): (formID?: string | null, var_nam?: string | null) => VarCatalog | null;
40
42
  getVarLookup(): (formID?: string | null, var_nam?: string | null) => VarLookup | null;
41
43
  getVarPossibility(): (formID?: string | null, var_nam?: string | null) => VarPossibility | null;
42
44
  getVarConfig(): (formID?: string | null, var_nam?: string | null) => VarConfig | null;
43
45
  getVarButtons(): (formID?: string | null) => Array<VarButton> | null;
46
+ getVarSubmitFields(): (formID?: string | null) => Array<VarSubmitField> | null;
47
+ getVarSubmitField(): (formID?: string | null, var_nam?: string | null) => VarSubmitField | null;
44
48
  getVarButtonSearch(): (formID?: string | null) => VarButton | null;
45
49
  getVarButton(): (formID?: string | null, var_nam?: string | null) => VarButton | null;
46
50
  getVarProfileMasters(): (formID?: string | null) => Array<VarProfileMasterDTO> | null;
47
51
  getVarProfileDetails(): (formID?: string | null) => Array<VarProfileDetail> | null;
52
+ getVarProfileDetail(): (formID?: string | null, var_nam?: string | null) => VarProfileDetail | null;
48
53
  getCurrentVarProfileMaster(): (formID?: string | null) => VarProfileMasterDTO | null;
49
54
  getCurrentVarProfileMasterID(): (formID?: string | null) => string | null;
50
55
  getVarGridConfig(): (formID?: string | null) => VarGridConfig | null;
51
56
  getVarGridMasters(): (formID?: string | null) => Array<VarGridMasterDTO> | null;
52
57
  getVarGridMaster(): (formID?: string | null) => VarGridMasterDTO | null;
53
- getVisibleVarGridDetails(): (formID?: string | null) => Array<VarGridDetail> | null;
54
- getVisibleVarGridDetailsTotalWidth(): (formID?: string | null) => number | null;
55
58
  getVarGridDetails(): (formID?: string | null) => Array<VarGridDetail> | null;
56
59
  getVarGridDetail(): (formID?: string | null, var_nam?: string | null) => VarGridDetail | null;
60
+ /**
61
+ * 根据 formID 获取系统的 VarGridDetail 列表, 即 customLevel 为 0 的 VarGridMaster 下面的所有 VarGridDetail.
62
+ */
63
+ getSystemVarGridDetails(): (formID?: string | null) => Array<VarGridDetail> | null;
64
+ getVisibleVarGridDetails(): (formID?: string | null) => Array<VarGridDetail> | null;
65
+ getVisibleVarGridDetailsTotalWidth(): (formID?: string | null) => number | null;
57
66
  }, {
58
67
  enter(formID: string): Promise<void>;
59
68
  leave(formID: string): void;
60
69
  retrieve(formID?: string | null): Promise<void>;
61
70
  setIsRetrieving(formID: string, value: boolean): void;
71
+ setIsCreating(formID: string, value: boolean): void;
72
+ setIsUpdating(formID: string, value: boolean): void;
73
+ setIsCopying(formID: string, value: boolean): void;
62
74
  setCurrentVarProfileMasterID(formID: string, currentVarProfileMasterID: string): void;
75
+ /**
76
+ * 设置列的宽度.
77
+ * @param formID 界面标识.
78
+ * @param var_nam 变量名称.
79
+ * @param width 新的宽度.
80
+ */
63
81
  setVarGridDetailWidth(formID: string, var_nam: string | null | undefined, width: number): void;
82
+ /**
83
+ * 设置列的可见.
84
+ * @param formID 界面标识.
85
+ * @param var_nam 变量名称.
86
+ * @param visible 是否科技.
87
+ */
88
+ setVarGridDetailVisible(formID: string, var_nam: string | null | undefined, visible: number): void;
64
89
  /**
65
90
  * 设置某个变量下拉列表配置.
66
91
  * @param formID 界面标识.
@@ -2,6 +2,7 @@ export * from './KgButton';
2
2
  export * from './KgControl';
3
3
  export * from './KgModal';
4
4
  export * from './KgProgressA';
5
+ export * from './KgResizable';
5
6
  export * from './KgSearch';
6
7
  export * from './KgTable';
7
8
  export * from './KgVar';
@@ -4,6 +4,7 @@ declare const _default: {
4
4
  title: string;
5
5
  };
6
6
  KgTable: {
7
+ column: string;
7
8
  emptyText: string;
8
9
  totalText: string;
9
10
  };
@@ -5,6 +5,7 @@ export declare const KG_I18N: {
5
5
  title: string;
6
6
  };
7
7
  KgTable: {
8
+ column: string;
8
9
  emptyText: string;
9
10
  totalText: string;
10
11
  };
@@ -48,6 +49,7 @@ export declare const KG_I18N: {
48
49
  title: string;
49
50
  };
50
51
  KgTable: {
52
+ column: string;
51
53
  emptyText: string;
52
54
  totalText: string;
53
55
  };
@@ -4,6 +4,7 @@ declare const _default: {
4
4
  title: string;
5
5
  };
6
6
  KgTable: {
7
+ column: string;
7
8
  emptyText: string;
8
9
  totalText: string;
9
10
  };
@@ -40,6 +40,13 @@ export declare const enum KG_CONTROL_TYPE {
40
40
  /** 文件上传按钮. */
41
41
  BTN_UPLOAD = "BTN_UPLOAD"
42
42
  }
43
+ /** 表单控件所处环境. */
44
+ export declare const enum KG_CONTROL_CONTEXT {
45
+ /** 查询条件. */
46
+ PROFILE = "PROFILE",
47
+ /** 表单(创建/更新/复制/...). */
48
+ SUBMIT = "SUBMIT"
49
+ }
43
50
  /** 表格单元格子显示类型. */
44
51
  export declare const enum KG_TD_DISPLAY_TYPE {
45
52
  /** 布尔数据, 使用 KgYesOrNo 组件显示. */
@@ -1,4 +1,5 @@
1
1
  import { ModalFuncProps } from 'ant-design-vue/lib/modal/Modal';
2
+ import { Dayjs } from 'dayjs';
2
3
  /**
3
4
  * 通用工具.
4
5
  */
@@ -53,4 +54,13 @@ export declare class KgUtil {
53
54
  * 是否是表单验证错误.
54
55
  */
55
56
  static isFormValidateError(e: any): boolean;
57
+ /**
58
+ * 将值转换为 Dayjs 对象.
59
+ * @param value 值.
60
+ */
61
+ static toDayjs(value: any): Dayjs | undefined;
62
+ /** 显示全局遮罩. */
63
+ static showLoading(): void;
64
+ /** 隐藏全局遮罩. */
65
+ static hideLoading(): void;
56
66
  }
@@ -7,5 +7,5 @@ export declare class KgVarUtil {
7
7
  * @param params JSON 字符串形式的参数.
8
8
  * @return 参数对象.
9
9
  */
10
- static parseActionParameter(params?: string | null): Record<string, any>;
10
+ static parseCommandParameter(params?: string | null): Record<string, any>;
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.2.2-beta.8",
3
+ "version": "0.3.0",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "rimraf dist && vue-tsc && vite build --mode development",
@@ -42,7 +42,7 @@
42
42
  "pinia": "2.0.12"
43
43
  },
44
44
  "devDependencies": {
45
- "@kengic/pont": "1.2.10-beta.23",
45
+ "@kengic/pont": "1.2.10-beta.32",
46
46
  "@types/lodash-es": "~4.17.7",
47
47
  "@types/node": "~18.14.6",
48
48
  "@types/semver": "~7.3.13",