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

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.
@@ -1,3 +1,4 @@
1
+ export { default as KgControl, KgControlInput, KgControlSelect, type KgControlProps } from './kg-control';
1
2
  import KgPage from './kg-page/KgPage';
2
3
  import KgSearch from './kg-search/KgSearch';
3
4
  import KgProgressA from './kg-progress-a/KgProgressA';
@@ -0,0 +1,30 @@
1
+ import './KgControl.less';
2
+ import { KG_CONTROL_TYPES_ENUM } from '../../consts';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ kgType: import("vue").PropType<KG_CONTROL_TYPES_ENUM>;
5
+ kgCodeColumn: import("vue").PropType<string>;
6
+ kgDescriptionColumn: import("vue").PropType<string>;
7
+ kgAction: import("vue").PropType<string>;
8
+ kgActionParameter: import("vue").PropType<string>;
9
+ kgActionType: {
10
+ type: import("vue").PropType<import("axios").Method>;
11
+ default: string;
12
+ };
13
+ value: import("vue").PropType<string | number | (string | number)[]>;
14
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
15
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
+ kgType: import("vue").PropType<KG_CONTROL_TYPES_ENUM>;
17
+ kgCodeColumn: import("vue").PropType<string>;
18
+ kgDescriptionColumn: import("vue").PropType<string>;
19
+ kgAction: import("vue").PropType<string>;
20
+ kgActionParameter: import("vue").PropType<string>;
21
+ kgActionType: {
22
+ type: import("vue").PropType<import("axios").Method>;
23
+ default: string;
24
+ };
25
+ value: import("vue").PropType<string | number | (string | number)[]>;
26
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
27
+ }>>, {
28
+ kgActionType: import("axios").Method;
29
+ }>;
30
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import './KgControl.less';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
4
+ kgCodeColumn: import("vue").PropType<string>;
5
+ kgDescriptionColumn: import("vue").PropType<string>;
6
+ kgAction: import("vue").PropType<string>;
7
+ kgActionParameter: import("vue").PropType<string>;
8
+ kgActionType: {
9
+ type: import("vue").PropType<import("axios").Method>;
10
+ default: string;
11
+ };
12
+ value: import("vue").PropType<string | number | (string | number)[]>;
13
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
14
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
16
+ kgCodeColumn: import("vue").PropType<string>;
17
+ kgDescriptionColumn: import("vue").PropType<string>;
18
+ kgAction: import("vue").PropType<string>;
19
+ kgActionParameter: import("vue").PropType<string>;
20
+ kgActionType: {
21
+ type: import("vue").PropType<import("axios").Method>;
22
+ default: string;
23
+ };
24
+ value: import("vue").PropType<string | number | (string | number)[]>;
25
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
26
+ }>> & {
27
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
28
+ }, {
29
+ kgActionType: import("axios").Method;
30
+ }>;
31
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import './KgControl.less';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
4
+ kgCodeColumn: import("vue").PropType<string>;
5
+ kgDescriptionColumn: import("vue").PropType<string>;
6
+ kgAction: import("vue").PropType<string>;
7
+ kgActionParameter: import("vue").PropType<string>;
8
+ kgActionType: {
9
+ type: import("vue").PropType<import("axios").Method>;
10
+ default: string;
11
+ };
12
+ value: import("vue").PropType<string | number | (string | number)[]>;
13
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
14
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
16
+ kgCodeColumn: import("vue").PropType<string>;
17
+ kgDescriptionColumn: import("vue").PropType<string>;
18
+ kgAction: import("vue").PropType<string>;
19
+ kgActionParameter: import("vue").PropType<string>;
20
+ kgActionType: {
21
+ type: import("vue").PropType<import("axios").Method>;
22
+ default: string;
23
+ };
24
+ value: import("vue").PropType<string | number | (string | number)[]>;
25
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
26
+ }>>, {
27
+ kgActionType: import("axios").Method;
28
+ }>;
29
+ export default _default;
@@ -0,0 +1,105 @@
1
+ import KgControlSelect from './KgControlSelect';
2
+ import KgControlInput from './KgControlInput';
3
+ import { type KgControlProps } from './index.vm';
4
+ export { KgControlSelect, KgControlInput, type KgControlProps };
5
+ declare const _default: {
6
+ new (...args: any[]): {
7
+ $: import("vue").ComponentInternalInstance;
8
+ $data: {};
9
+ $props: Partial<{
10
+ kgActionType: import("axios").Method;
11
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<{
12
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
13
+ kgCodeColumn: import("vue").PropType<string>;
14
+ kgDescriptionColumn: import("vue").PropType<string>;
15
+ kgAction: import("vue").PropType<string>;
16
+ kgActionParameter: import("vue").PropType<string>;
17
+ kgActionType: {
18
+ type: import("vue").PropType<import("axios").Method>;
19
+ default: string;
20
+ };
21
+ value: import("vue").PropType<string | number | (string | number)[]>;
22
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
23
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "kgActionType">;
24
+ $attrs: {
25
+ [x: string]: unknown;
26
+ };
27
+ $refs: {
28
+ [x: string]: unknown;
29
+ };
30
+ $slots: Readonly<{
31
+ [name: string]: import("vue").Slot | undefined;
32
+ }>;
33
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
34
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
35
+ $emit: (event: string, ...args: any[]) => void;
36
+ $el: any;
37
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
38
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
39
+ kgCodeColumn: import("vue").PropType<string>;
40
+ kgDescriptionColumn: import("vue").PropType<string>;
41
+ kgAction: import("vue").PropType<string>;
42
+ kgActionParameter: import("vue").PropType<string>;
43
+ kgActionType: {
44
+ type: import("vue").PropType<import("axios").Method>;
45
+ default: string;
46
+ };
47
+ value: import("vue").PropType<string | number | (string | number)[]>;
48
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
49
+ }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
50
+ kgActionType: import("axios").Method;
51
+ }, {}, string> & {
52
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
53
+ created?: ((() => void) | (() => void)[]) | undefined;
54
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
55
+ mounted?: ((() => void) | (() => void)[]) | undefined;
56
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
57
+ updated?: ((() => void) | (() => void)[]) | undefined;
58
+ activated?: ((() => void) | (() => void)[]) | undefined;
59
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
60
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
61
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
62
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
63
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
64
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
65
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
66
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
67
+ };
68
+ $forceUpdate: () => void;
69
+ $nextTick: typeof import("vue").nextTick;
70
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
71
+ } & Readonly<import("vue").ExtractPropTypes<{
72
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
73
+ kgCodeColumn: import("vue").PropType<string>;
74
+ kgDescriptionColumn: import("vue").PropType<string>;
75
+ kgAction: import("vue").PropType<string>;
76
+ kgActionParameter: import("vue").PropType<string>;
77
+ kgActionType: {
78
+ type: import("vue").PropType<import("axios").Method>;
79
+ default: string;
80
+ };
81
+ value: import("vue").PropType<string | number | (string | number)[]>;
82
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
83
+ }>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
84
+ __isFragment?: undefined;
85
+ __isTeleport?: undefined;
86
+ __isSuspense?: undefined;
87
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
88
+ kgType: import("vue").PropType<import("../..").KG_CONTROL_TYPES_ENUM>;
89
+ kgCodeColumn: import("vue").PropType<string>;
90
+ kgDescriptionColumn: import("vue").PropType<string>;
91
+ kgAction: import("vue").PropType<string>;
92
+ kgActionParameter: import("vue").PropType<string>;
93
+ kgActionType: {
94
+ type: import("vue").PropType<import("axios").Method>;
95
+ default: string;
96
+ };
97
+ value: import("vue").PropType<string | number | (string | number)[]>;
98
+ 'onUpdate:value': import("vue").PropType<(value: string | number | (string | number)[]) => void>;
99
+ }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
100
+ kgActionType: import("axios").Method;
101
+ }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
102
+ readonly Input: typeof KgControlInput;
103
+ readonly Select: typeof KgControlSelect;
104
+ };
105
+ export default _default;
@@ -0,0 +1,35 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+ import { KG_CONTROL_TYPES_ENUM } from '../../consts';
3
+ import { Method } from 'axios';
4
+ export declare const getProps: () => {
5
+ /**
6
+ * 控件类型.
7
+ * @default {@link KG_CONTROL_TYPES_ENUM.INPUT_BASIC}
8
+ */
9
+ kgType: PropType<KG_CONTROL_TYPES_ENUM>;
10
+ /**
11
+ * 数据列.
12
+ * {@link KG_CONTROL_TYPES_ENUM.SELECT_BASIC} 和 {@link KG_CONTROL_TYPES_ENUM.SELECT_MULTIPLE} 适用.
13
+ */
14
+ kgCodeColumn: PropType<string>;
15
+ /**
16
+ * 显示列.
17
+ * {@link KG_CONTROL_TYPES_ENUM.SELECT_BASIC} 和 {@link KG_CONTROL_TYPES_ENUM.SELECT_MULTIPLE} 适用.
18
+ */
19
+ kgDescriptionColumn: PropType<string>;
20
+ /** 接口地址. */
21
+ kgAction: PropType<string>;
22
+ /** 接口参数. */
23
+ kgActionParameter: PropType<string>;
24
+ /**
25
+ * 接口方法.
26
+ * @default GET
27
+ */
28
+ kgActionType: {
29
+ type: PropType<Method>;
30
+ default: string;
31
+ };
32
+ value: PropType<string | number | (string | number)[]>;
33
+ 'onUpdate:value': PropType<(value: string | number | Array<string | number>) => void>;
34
+ };
35
+ export declare type KgControlProps = Partial<ExtractPropTypes<ReturnType<typeof getProps>>>;
@@ -11,5 +11,35 @@ export declare const enum KG_APPS_PREFIXS_ENUM {
11
11
  BUSINESS_MANAGER = "/wms/business-manager",
12
12
  SYS = "/sys"
13
13
  }
14
+ /** 表单控件类型. */
15
+ export declare const enum KG_CONTROL_TYPES_ENUM {
16
+ /** 文本. */
17
+ INPUT_BASIC = "Input_Basic",
18
+ /** 密码. */
19
+ INPUT_PASSWORD = "Input_Password",
20
+ /** 多行文本. */
21
+ INPUT_AREA = "Input_AreaText",
22
+ /** 数字. */
23
+ INPUT_NUMBER_BASIC = "InputNumber_Basic",
24
+ CHECKBOX_BASIC = "Checkbox_Basic",
25
+ SWITCH_BASIC = "Switch_Basic",
26
+ /** 下拉列表单选. */
27
+ SELECT_BASIC = "Select_Basic",
28
+ /** 下拉列表多选. */
29
+ SELECT_MULTIPLE = "Select_Multiple",
30
+ DATE_PICKER_DATE = "DatePick_Date",
31
+ DATE_PICKER_DATETIME_RANGE = "DatePick_DateTimeRange",
32
+ DATE_PICKER_DATE_RANGE = "DatePick_DateRange",
33
+ DATE_PICKER_DATETIME = "DatePick_DateTime",
34
+ DATE_PICKER_MONTH = "DatePick_Month",
35
+ DATE_PICKER_WEEK = "DatePick_Week",
36
+ DATE_PICKER_YEAR = "DatePick_Year",
37
+ /** 单位. */
38
+ UOM = "Uom",
39
+ /** 秒表计时. */
40
+ STOPWATCH = "Stopwatch",
41
+ /** 文件上传按钮. */
42
+ FILE_UPLOAD_BUTTON = "FileUpload_Button"
43
+ }
14
44
  /** 所有模块. */
15
45
  export declare const KG_APPS: Array<KG_APPS_ENUM>;
@@ -1,4 +1,5 @@
1
1
  import './assets/index.less';
2
2
  export * from './components';
3
3
  export * from './consts';
4
+ export * from './services';
4
5
  export * from './utils';
@@ -0,0 +1,27 @@
1
+ import { type AxiosRequestConfig } from 'axios';
2
+ interface IHttpClient {
3
+ request<T = any>(config: AxiosRequestConfig, options?: IRequestOptions): Promise<T>;
4
+ }
5
+ /**
6
+ * 设置 httpClient 实例.
7
+ */
8
+ declare function setupHttpClient(httpClient: IHttpClient | null): void;
9
+ /**
10
+ * 获取 httpClient 实例.
11
+ */
12
+ declare function httpClient(): IHttpClient | null;
13
+ interface IRequestOptions {
14
+ joinParamsToUrl?: boolean;
15
+ formatDate?: boolean;
16
+ isTransformResponse?: boolean;
17
+ isReturnNativeResponse?: boolean;
18
+ joinPrefix?: boolean;
19
+ apiUrl?: string;
20
+ urlPrefix?: string;
21
+ errorMessageMode?: 'none' | 'modal' | 'message' | undefined;
22
+ successMessageMode?: 'none' | 'success' | 'error' | undefined;
23
+ joinTime?: boolean;
24
+ ignoreCancelToken?: boolean;
25
+ withToken?: boolean;
26
+ }
27
+ export { setupHttpClient, httpClient };
@@ -0,0 +1 @@
1
+ export * from './http-client';
@@ -1,4 +1,4 @@
1
1
  export * from './app.util';
2
- export * from './file.util';
2
+ export * from './kg.util';
3
3
  export * from './logger.util';
4
4
  export * from './route.util';
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 通用工具.
3
+ */
4
+ export declare class KgUtil {
5
+ /**
6
+ * 根据'文件大小数值'获取'文件大小文本'.
7
+ * @param size 文件大小数值.
8
+ */
9
+ static getFileSize(size: any): string;
10
+ /**
11
+ * BASE64 转换为 BLOB.
12
+ * @param base64 base64 字符串.
13
+ * @param contentType 文件类型.
14
+ * @param sliceSize 分块大小.
15
+ */
16
+ static base64toBlob(base64: string, contentType: string, sliceSize?: number): Blob;
17
+ /**
18
+ * 下载文件.
19
+ * @param data 文件数据.
20
+ * @param fileName 文件名称, 包含后缀.
21
+ * @param contentType 文件类型.
22
+ */
23
+ static downloadFile(data: string | BlobPart, fileName: string, contentType: string): void;
24
+ /**
25
+ * 解析请求参数.
26
+ * 1. 填充通用参数的值
27
+ * a. 仓库: '{WAREHOUSE}'
28
+ * @param params 请求参数.
29
+ * @param warehouseID 仓库编号.
30
+ */
31
+ static parseParams(params?: Record<string, any> | null, warehouseID?: string | null): any;
32
+ /**
33
+ * 解析请求参数: 解析字符串类型的参数值.
34
+ * @param value 参数的原始值.
35
+ * @param warehouseID 仓库编号.
36
+ */
37
+ private static parseParamFromString;
38
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 变量相关工具.
3
+ */
4
+ export declare class KgVarUtil {
5
+ /**
6
+ * 将 JSON 字符串形式的参数 `'{"foo":1,"bar":2}'` 转换为对象形式的参数 `{ "foo": 1, "bar": 2 }`.
7
+ * @param params JSON 字符串形式的参数.
8
+ * @return 参数对象.
9
+ */
10
+ static parseActionParameter(params?: string | null): Record<string, any>;
11
+ }
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.0.2-beta.58",
3
+ "version": "0.0.2-beta.60",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
+ "build:dev": "rimraf dist && vue-tsc && vite build --mode development",
6
7
  "publish:all:beta": "npm run bump-version:beta && npm run publish:all",
7
8
  "publish:all:patch": "npm run bump-version:patch && npm run publish:all",
8
9
  "publish:all:minor": "npm run bump-version:minor && npm run publish:all",
9
10
  "publish:all:major": "npm run bump-version:major && npm run publish:all",
10
- "bump-version-to-projects:luotao.wms-vue3": "tsx ./scripts/bump-version-to-projects.luotao.wms-vue3.ts",
11
- "copy-to-projects:luotao.wms-vue3": "tsx ./scripts/copy-to-projects.luotao.wms-vue3.ts",
11
+ "bump-to:luotao.wms-vue3": "tsx scripts/bump-to.luotao.wms-vue3.ts",
12
+ "copy-to:luotao.wms-vue3": "tsx scripts/copy-to.luotao.wms-vue3.ts",
12
13
  "--------------------": "",
13
- "bump-version:beta": "tsx scripts/bump-version.ts beta",
14
- "bump-version:major": "tsx scripts/bump-version.ts major",
15
- "bump-version:minor": "tsx scripts/bump-version.ts minor",
16
- "bump-version:patch": "tsx scripts/bump-version.ts patch",
14
+ "bump-version:beta": "tsx scripts/bump.ts beta",
15
+ "bump-version:major": "tsx scripts/bump.ts major",
16
+ "bump-version:minor": "tsx scripts/bump.ts minor",
17
+ "bump-version:patch": "tsx scripts/bump.ts patch",
17
18
  "publish:all": "tsx scripts/publish.ts",
18
19
  "publish:npm": "npmrc kengic && npm publish ./ --registry https://registry.npmjs.org/ --access public"
19
20
  },
@@ -21,10 +22,11 @@
21
22
  "vue": "~3.2.45"
22
23
  },
23
24
  "dependencies": {
24
- "@ant-design/icons-vue": "~6.1.0",
25
- "ant-design-vue": "~3.2.15",
25
+ "@ant-design/icons-vue": "6.1.0",
26
+ "ant-design-vue": "3.2.14",
27
+ "axios": "0.26.1",
26
28
  "filesize": "10.0.6",
27
- "lodash-es": "~4.17.21"
29
+ "lodash-es": "4.17.21"
28
30
  },
29
31
  "devDependencies": {
30
32
  "@types/lodash-es": "~4.17.7",
@@ -1,19 +0,0 @@
1
- /**
2
- * 根据'文件大小数值'获取'文件大小文本'.
3
- * @param size 文件大小数值.
4
- */
5
- export declare function getFileSize(size: any): string;
6
- /**
7
- * base64 转换为 blob.
8
- * @param base64 base64 字符串.
9
- * @param contentType 文件类型.
10
- * @param sliceSize 分块大小.
11
- */
12
- export declare function base64toBlob(base64: string, contentType: string, sliceSize?: number): Blob;
13
- /**
14
- * 下载文件.
15
- * @param data 文件数据.
16
- * @param fileName 文件名称, 包含后缀.
17
- * @param contentType 文件类型.
18
- */
19
- export declare function downloadFile(data: string | BlobPart, fileName: string, contentType: string): void;