@kengic/vue 0.0.2-beta.60 → 0.0.2-beta.61

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 (31) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/kengic-vue.js +1294 -806
  3. package/dist/src/apis/WMS/Controllers/VarController/GetAll.d.ts +21 -0
  4. package/dist/src/apis/WMS/Controllers/VarController/index.d.ts +1 -0
  5. package/dist/src/apis/WMS/Controllers/index.d.ts +1 -0
  6. package/dist/src/apis/WMS/index.d.ts +2 -0
  7. package/dist/src/apis/WMS/models.d.ts +62 -0
  8. package/dist/src/apis/api.d.ts +1 -0
  9. package/dist/src/apis/def.d.ts +1 -0
  10. package/dist/src/apis/index.d.ts +2 -0
  11. package/dist/src/components/{kg-control → KgControl}/index.d.ts +2 -2
  12. package/dist/src/components/KgVar/hooks/index.d.ts +12 -0
  13. package/dist/src/components/KgVar/index.d.ts +2 -0
  14. package/dist/src/components/KgVar/store/index.d.ts +31 -0
  15. package/dist/src/components/KgVar/store/index.data.d.ts +9 -0
  16. package/dist/src/components/index.d.ts +6 -5
  17. package/dist/src/consts/index.d.ts +1 -0
  18. package/dist/src/consts/injection-keys.const.d.ts +13 -0
  19. package/dist/src/index.d.ts +1 -0
  20. package/dist/src/services/http-client.d.ts +8 -3
  21. package/dist/src/utils/logger.util.d.ts +1 -1
  22. package/kg.config.ts +23 -0
  23. package/package.json +5 -2
  24. /package/dist/src/components/{kg-control/KgControlInput.d.ts → KgControl/KgControl.Input.d.ts} +0 -0
  25. /package/dist/src/components/{kg-control/KgControlSelect.d.ts → KgControl/KgControl.Select.d.ts} +0 -0
  26. /package/dist/src/components/{kg-control → KgControl}/KgControl.d.ts +0 -0
  27. /package/dist/src/components/{kg-control → KgControl}/index.vm.d.ts +0 -0
  28. /package/dist/src/components/{kg-page → KgPage}/KgPage.d.ts +0 -0
  29. /package/dist/src/components/{kg-progress-a → KgProgressA}/KgProgressA.d.ts +0 -0
  30. /package/dist/src/components/{kg-search → KgSearch}/KgSearch.d.ts +0 -0
  31. /package/dist/src/components/{kg-yes-or-no → KgYesOrNo}/KgYesOrNo.d.ts +0 -0
@@ -0,0 +1,21 @@
1
+ import { IRequestConfig, IRequestOptions } from '../../../../services';
2
+ import * as DEF from '../../../def';
3
+ /** 请求参数. */
4
+ export declare class GetAllQuery {
5
+ /** 界面标识. */
6
+ frmId?: string | null;
7
+ /** 语言. */
8
+ localeId?: string | null;
9
+ constructor(obj?: GetAllQuery);
10
+ }
11
+ /**
12
+ * 查询所有变量配置.
13
+ *
14
+ * @param config 请求配置.
15
+ * @param option 请求选项.
16
+ */
17
+ export declare function GetAll(config?: IRequestConfig<GetAllQuery, {}>, option?: IRequestOptions): Promise<DEF.WMS.VarDTO>;
18
+ export declare namespace GetAll {
19
+ var method: "GET";
20
+ var url: string;
21
+ }
@@ -0,0 +1 @@
1
+ export { GetAll, GetAllQuery } from './GetAll';
@@ -0,0 +1 @@
1
+ export * as VarController from './VarController';
@@ -0,0 +1,2 @@
1
+ export * as WMSAPI from './Controllers';
2
+ export * as WMSDEF from './models';
@@ -0,0 +1,62 @@
1
+ export declare class IPage<T0> {
2
+ /** Current. */
3
+ current?: number | null;
4
+ /** Pages. */
5
+ pages?: number | null;
6
+ /** Records. */
7
+ records?: Array<T0> | null;
8
+ /** Size. */
9
+ size?: number | null;
10
+ /** Total. */
11
+ total?: number | null;
12
+ constructor(obj?: IPage<T0>);
13
+ }
14
+ /**
15
+ * 变量别名
16
+ */
17
+ export declare class VarCatalog {
18
+ /** 定制级别. */
19
+ custLvl?: string | null;
20
+ /** 界面标识. */
21
+ frmId?: string | null;
22
+ /** 分组. */
23
+ grpNam?: string | null;
24
+ /** 主键. */
25
+ id?: string | null;
26
+ /** 语言. */
27
+ localeId?: string | null;
28
+ /** 变量名称. */
29
+ varNam?: string | null;
30
+ /** 显示文本. */
31
+ varText?: string | null;
32
+ constructor(obj?: VarCatalog);
33
+ }
34
+ /**
35
+ * 变量
36
+ */
37
+ export declare class VarContext {
38
+ /** 界面标识. */
39
+ frmId?: string | null;
40
+ /** 界面名称. */
41
+ frmNam?: string | null;
42
+ /** 分组. */
43
+ grpNam?: string | null;
44
+ /** 主键. */
45
+ id?: string | null;
46
+ /** 变量名称. */
47
+ varNam?: string | null;
48
+ constructor(obj?: VarContext);
49
+ }
50
+ /**
51
+ * 变量配置.
52
+ */
53
+ export declare class VarDTO {
54
+ /** 变量别名. */
55
+ varCatalogs?: Array<VarCatalog> | null;
56
+ constructor(obj?: VarDTO);
57
+ }
58
+ /**
59
+ * 获取对象的属性名数组.
60
+ * @param obj 对象.
61
+ */
62
+ export declare function keys<C extends object>(obj: C): Array<keyof C>;
@@ -0,0 +1 @@
1
+ export { WMSAPI as WMS } from './WMS';
@@ -0,0 +1 @@
1
+ export { WMSDEF as WMS } from './WMS';
@@ -0,0 +1,2 @@
1
+ export * as API from './api';
2
+ export * as DEF from './def';
@@ -1,5 +1,5 @@
1
- import KgControlSelect from './KgControlSelect';
2
- import KgControlInput from './KgControlInput';
1
+ import KgControlSelect from './KgControl.Select';
2
+ import KgControlInput from './KgControl.Input';
3
3
  import { type KgControlProps } from './index.vm';
4
4
  export { KgControlSelect, KgControlInput, type KgControlProps };
5
5
  declare const _default: {
@@ -0,0 +1,12 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ /**
3
+ * 启用变量.
4
+ * @param formID 界面标识.
5
+ */
6
+ export declare function useKgVar(formID: string): {
7
+ t1: (varName: string) => ComputedRef<string>;
8
+ t2: (varName: string) => string;
9
+ } | {
10
+ t1: (varName: string) => Ref<string>;
11
+ t2: (varName: string) => string;
12
+ };
@@ -0,0 +1,2 @@
1
+ export * from './hooks';
2
+ export * from './store';
@@ -0,0 +1,31 @@
1
+ import { KgVarState } from './index.data';
2
+ import { VarCatalog } from '../../../apis/WMS/models';
3
+ export declare const useKgVarStore: import("pinia").StoreDefinition<"KgVar", KgVarState, {
4
+ getVarCatalogs(): Map<string, Array<VarCatalog>>;
5
+ /** 获取最顶层的界面标识. */
6
+ getTopFormID(): string | null;
7
+ }, {
8
+ /**
9
+ * 进入一个界面.
10
+ * 多个界面可以共用一个界面标识, 因此进入该界面时, 该界面标识可能已经存在了;
11
+ * 如果该界面标识尚不存在, 则加载它的变量配置.
12
+ * @param formID 界面标识.
13
+ */
14
+ enter(formID: string): Promise<void>;
15
+ /**
16
+ * 离开一个界面.
17
+ * 如果该界面标识对应的所有页面都离开了, 则删除它的变量配置.
18
+ * @param formID 界面标识.
19
+ */
20
+ leave(formID: string): void;
21
+ /**
22
+ * 查询所有变量配置.
23
+ * @param formID 界面标识.
24
+ */
25
+ retrieveAll(formID?: string | null): Promise<void>;
26
+ /**
27
+ * 清空所有变量配置.
28
+ * @param formID 界面标识.
29
+ */
30
+ deleteAll(formID: string): void;
31
+ }>;
@@ -0,0 +1,9 @@
1
+ import { VarCatalog } from '../../../apis/WMS/models';
2
+ export interface KgVarState {
3
+ /**
4
+ * 当前可能打开了多个界面, 需要按照先后顺序记录下来, 当打开变量配置弹窗时, 打开的是最近那个页面的变量配置.
5
+ */
6
+ formIDs: Array<string>;
7
+ /** 变量别名. */
8
+ varCatalogs: Map<string, Array<VarCatalog>>;
9
+ }
@@ -1,6 +1,7 @@
1
- export { default as KgControl, KgControlInput, KgControlSelect, type KgControlProps } from './kg-control';
2
- import KgPage from './kg-page/KgPage';
3
- import KgSearch from './kg-search/KgSearch';
4
- import KgProgressA from './kg-progress-a/KgProgressA';
5
- import KgYesOrNo from './kg-yes-or-no/KgYesOrNo';
1
+ export { default as KgControl, KgControlInput, KgControlSelect, type KgControlProps } from './KgControl';
2
+ import KgPage from './KgPage/KgPage';
3
+ import KgSearch from './KgSearch/KgSearch';
4
+ import KgProgressA from './KgProgressA/KgProgressA';
5
+ import KgYesOrNo from './KgYesOrNo/KgYesOrNo';
6
6
  export { KgPage, KgSearch, KgProgressA, KgYesOrNo };
7
+ export * from './KgVar';
@@ -1,4 +1,5 @@
1
1
  export * from './i18n';
2
+ export * from './injection-keys.const';
2
3
  /** 所有模块. */
3
4
  export declare const enum KG_APPS_ENUM {
4
5
  DATA_MANAGER = "data-manager",
@@ -0,0 +1,13 @@
1
+ import { ComputedRef, InjectionKey } from 'vue';
2
+ /** 界面标识. */
3
+ export declare const KG_DI_FORM_ID: InjectionKey<string>;
4
+ export declare type T = {
5
+ (key: string): string;
6
+ (key: string, locale: string): string;
7
+ (key: string, locale: string, list: unknown[]): string;
8
+ (key: string, locale: string, named: Record<string, unknown>): string;
9
+ (key: string, list: unknown[]): string;
10
+ (key: string, named: Record<string, unknown>): string;
11
+ };
12
+ /** 语言. */
13
+ export declare const KG_DI_LOCALE: InjectionKey<ComputedRef<"zh_CN" | "en">>;
@@ -1,4 +1,5 @@
1
1
  import './assets/index.less';
2
+ export * from './apis';
2
3
  export * from './components';
3
4
  export * from './consts';
4
5
  export * from './services';
@@ -1,6 +1,6 @@
1
1
  import { type AxiosRequestConfig } from 'axios';
2
2
  interface IHttpClient {
3
- request<T = any>(config: AxiosRequestConfig, options?: IRequestOptions): Promise<T>;
3
+ request<T = any>(config: IRequestConfig, options?: IRequestOptions): Promise<T>;
4
4
  }
5
5
  /**
6
6
  * 设置 httpClient 实例.
@@ -9,7 +9,10 @@ declare function setupHttpClient(httpClient: IHttpClient | null): void;
9
9
  /**
10
10
  * 获取 httpClient 实例.
11
11
  */
12
- declare function httpClient(): IHttpClient | null;
12
+ declare function httpClient(): IHttpClient;
13
+ interface IRequestConfig<TQ = {}, TB = {}> extends AxiosRequestConfig<TB> {
14
+ params?: TQ;
15
+ }
13
16
  interface IRequestOptions {
14
17
  joinParamsToUrl?: boolean;
15
18
  formatDate?: boolean;
@@ -23,5 +26,7 @@ interface IRequestOptions {
23
26
  joinTime?: boolean;
24
27
  ignoreCancelToken?: boolean;
25
28
  withToken?: boolean;
29
+ /** 是否使用模拟数据. */
30
+ mock?: boolean;
26
31
  }
27
- export { setupHttpClient, httpClient };
32
+ export { setupHttpClient, httpClient, type IRequestConfig, type IRequestOptions };
@@ -27,7 +27,7 @@ declare class Logger {
27
27
  * @param collapsed 是否折叠.
28
28
  * @param style 提示消息样式.
29
29
  */
30
- static log(level: "info" | "warn" | "error" | undefined, message: string, args?: Record<string, any>, collapsed?: boolean, style?: string): void;
30
+ static log(level: "error" | "info" | "warn" | undefined, message: string, args?: Record<string, any>, collapsed?: boolean, style?: string): void;
31
31
  /**
32
32
  * 打印警告日志.
33
33
  *
package/kg.config.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { IPontConfig } from '@kengic/pont';
2
+
3
+ const config: IPontConfig = {
4
+ pont: {
5
+ origins: [
6
+ {
7
+ name: 'WMS',
8
+ originUrl: 'http://localhost:8080/kengic-boot/v2/api-docs',
9
+ originType: 'SwaggerV2',
10
+ responseClassName: 'Result',
11
+ includeControllers: {
12
+ VarController: ['GetAll'],
13
+ },
14
+ includeClasses: ['IPage', 'VarCatalog', 'VarContext', 'VarDTO'],
15
+ },
16
+ ],
17
+ publicPath: '/kengic-boot',
18
+ httpClientPath: "'../../../../services'",
19
+ outDir: './src/apis',
20
+ },
21
+ };
22
+
23
+ export { config };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.0.2-beta.60",
3
+ "version": "0.0.2-beta.61",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "rimraf dist && vue-tsc && vite build --mode development",
@@ -10,6 +10,7 @@
10
10
  "publish:all:major": "npm run bump-version:major && npm run publish:all",
11
11
  "bump-to:luotao.wms-vue3": "tsx scripts/bump-to.luotao.wms-vue3.ts",
12
12
  "copy-to:luotao.wms-vue3": "tsx scripts/copy-to.luotao.wms-vue3.ts",
13
+ "gen:apis:WMS": "kengic-pont generate-apis --config kg.config.ts --origin WMS",
13
14
  "--------------------": "",
14
15
  "bump-version:beta": "tsx scripts/bump.ts beta",
15
16
  "bump-version:major": "tsx scripts/bump.ts major",
@@ -26,9 +27,11 @@
26
27
  "ant-design-vue": "3.2.14",
27
28
  "axios": "0.26.1",
28
29
  "filesize": "10.0.6",
29
- "lodash-es": "4.17.21"
30
+ "lodash-es": "4.17.21",
31
+ "pinia": "2.0.12"
30
32
  },
31
33
  "devDependencies": {
34
+ "@kengic/pont": "1.2.10-beta.23",
32
35
  "@types/lodash-es": "~4.17.7",
33
36
  "@types/node": "~18.14.6",
34
37
  "@types/semver": "~7.3.13",