@kengic/vue 0.4.5-beta.1 → 0.5.1
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.
- package/dist/index.css +1 -1
- package/dist/kengic-vue.js +5909 -4936
- package/dist/src/apis/WMS/Controllers/VarController/GetAll.d.ts +0 -2
- package/dist/src/apis/WMS/Controllers/WhController/ListVO.d.ts +52 -0
- package/dist/src/apis/WMS/Controllers/WhController/index.d.ts +1 -0
- package/dist/src/apis/WMS/Controllers/index.d.ts +1 -0
- package/dist/src/apis/WMS/models.d.ts +30 -0
- package/dist/src/components/KgButton/components/KgButton.Copy.d.ts +6 -2
- package/dist/src/components/KgButton/components/KgButton.Create.d.ts +2 -0
- package/dist/src/components/KgButton/components/KgButton.Import.d.ts +2 -2
- package/dist/src/components/KgButton/components/KgButton.Other.d.ts +2 -2
- package/dist/src/components/KgButton/components/KgButton.Search.d.ts +4 -4
- package/dist/src/components/KgButton/components/KgButton.Update.d.ts +0 -2
- package/dist/src/components/KgSearch/KgSearch.data.d.ts +2 -0
- package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.CreateModal.d.ts +1 -1
- package/dist/src/components/KgWarehouse/KgWarehouse.d.ts +32 -0
- package/dist/src/components/KgWarehouse/index.d.ts +4 -0
- package/dist/src/components/KgWarehouse/index.guard.d.ts +8 -0
- package/dist/src/components/KgWarehouse/index.hooks.d.ts +18 -0
- package/dist/src/components/KgWarehouse/index.store.d.ts +44 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/config/index.d.ts +2 -0
- package/dist/src/config/index.hooks.d.ts +17 -0
- package/dist/src/config/index.store.d.ts +43 -0
- package/dist/src/config/setup.d.ts +16 -27
- package/dist/src/consts/i18n/en.d.ts +7 -0
- package/dist/src/consts/i18n/index.d.ts +2 -163
- package/dist/src/consts/i18n/zh_CN.d.ts +7 -0
- package/dist/src/consts/index.vm.d.ts +3 -0
- package/dist/src/utils/kg.util.d.ts +2 -4
- package/dist/src/utils/route.util.d.ts +6 -0
- package/package.json +5 -2
@@ -0,0 +1,52 @@
|
|
1
|
+
import { IRequestConfig, IRequestOptions } from '../../../../services';
|
2
|
+
import * as DEF from '../../../def';
|
3
|
+
/** 请求参数. */
|
4
|
+
export declare class ListVOQuery {
|
5
|
+
/** 是否活动 */
|
6
|
+
activeFlg?: number | null;
|
7
|
+
/** 地址编号 */
|
8
|
+
adrId?: string | null;
|
9
|
+
/** adrnam */
|
10
|
+
adrnam?: string | null;
|
11
|
+
/** 默认仓库 */
|
12
|
+
defWhFlg?: number | null;
|
13
|
+
/** 主键. */
|
14
|
+
id?: string | null;
|
15
|
+
/** 语言. */
|
16
|
+
localeId?: string | null;
|
17
|
+
/** 所属地/国编号 */
|
18
|
+
orgcod?: string | null;
|
19
|
+
/** 永久调整托盘 */
|
20
|
+
permAdjLod?: string | null;
|
21
|
+
/** 永久调整箱 */
|
22
|
+
permAdjSub?: string | null;
|
23
|
+
/** 永久创建托盘 */
|
24
|
+
permCreLod?: string | null;
|
25
|
+
/** 永久创建箱 */
|
26
|
+
permCreSub?: string | null;
|
27
|
+
/** 仓库名称. */
|
28
|
+
whDsc?: string | null;
|
29
|
+
/** 仓库编号 */
|
30
|
+
whId?: string | null;
|
31
|
+
/** 排序字段. */
|
32
|
+
column?: string | null;
|
33
|
+
/** 排序方式. */
|
34
|
+
order?: 'asc' | 'desc' | null;
|
35
|
+
/** 当前页数. */
|
36
|
+
pageNo?: number | null;
|
37
|
+
/** 每页条数. */
|
38
|
+
pageSize?: number | null;
|
39
|
+
constructor(obj?: ListVOQuery);
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* wh-分页列表查询VO
|
43
|
+
wh-分页列表查询VO
|
44
|
+
*
|
45
|
+
* @param config 请求配置.
|
46
|
+
* @param option 请求选项.
|
47
|
+
*/
|
48
|
+
export declare function ListVO(config?: IRequestConfig<ListVOQuery, {}>, option?: IRequestOptions): Promise<DEF.WMS.IPage<DEF.WMS.WhVO>>;
|
49
|
+
export declare namespace ListVO {
|
50
|
+
var method: "GET";
|
51
|
+
var url: string;
|
52
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { ListVO, ListVOQuery } from './ListVO';
|
@@ -2,3 +2,4 @@ export * as VarController from './VarController';
|
|
2
2
|
export * as VarCatalogController from './VarCatalogController';
|
3
3
|
export * as VarContextController from './VarContextController';
|
4
4
|
export * as VarProfileMasterController from './VarProfileMasterController';
|
5
|
+
export * as WhController from './WhController';
|
@@ -485,6 +485,36 @@ export declare class VarSubmitField {
|
|
485
485
|
var_nam?: string | null;
|
486
486
|
constructor(obj?: VarSubmitField);
|
487
487
|
}
|
488
|
+
/** 仓库(Warehouse). */
|
489
|
+
export declare class WhVO {
|
490
|
+
/** 是否活动 */
|
491
|
+
activeFlg?: number | null;
|
492
|
+
/** 地址编号 */
|
493
|
+
adrId?: string | null;
|
494
|
+
/** adrnam */
|
495
|
+
adrnam?: string | null;
|
496
|
+
/** 默认仓库 */
|
497
|
+
defWhFlg?: number | null;
|
498
|
+
/** 主键. */
|
499
|
+
id?: string | null;
|
500
|
+
/** 语言. */
|
501
|
+
localeId?: string | null;
|
502
|
+
/** 所属地/国编号 */
|
503
|
+
orgcod?: string | null;
|
504
|
+
/** 永久调整托盘 */
|
505
|
+
permAdjLod?: string | null;
|
506
|
+
/** 永久调整箱 */
|
507
|
+
permAdjSub?: string | null;
|
508
|
+
/** 永久创建托盘 */
|
509
|
+
permCreLod?: string | null;
|
510
|
+
/** 永久创建箱 */
|
511
|
+
permCreSub?: string | null;
|
512
|
+
/** 仓库名称. */
|
513
|
+
whDsc?: string | null;
|
514
|
+
/** 仓库编号 */
|
515
|
+
whId?: string | null;
|
516
|
+
constructor(obj?: WhVO);
|
517
|
+
}
|
488
518
|
/**
|
489
519
|
* 获取对象的属性名数组.
|
490
520
|
* @param obj 对象.
|
@@ -4,28 +4,32 @@ declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
kgType: import("vue").PropType<import("../../..").KG_BTN_TYPE | null>;
|
5
5
|
kgPrimary: {
|
6
6
|
type: import("vue").PropType<boolean | null | undefined>;
|
7
|
+
/** 点击按钮. */
|
7
8
|
default: undefined;
|
8
9
|
};
|
10
|
+
/** 点击按钮. */
|
9
11
|
kgIcon: import("vue").PropType<string | null>;
|
10
12
|
kgText: import("vue").PropType<string | null>;
|
11
13
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
12
14
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
13
15
|
kgLoading: import("vue").PropType<boolean>;
|
14
|
-
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
16
|
+
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
15
17
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
16
18
|
kgButton: import("vue").PropType<import("../../..").VarButton>;
|
17
19
|
kgVarName: import("vue").PropType<string | null>;
|
18
20
|
kgType: import("vue").PropType<import("../../..").KG_BTN_TYPE | null>;
|
19
21
|
kgPrimary: {
|
20
22
|
type: import("vue").PropType<boolean | null | undefined>;
|
23
|
+
/** 点击按钮. */
|
21
24
|
default: undefined;
|
22
25
|
};
|
26
|
+
/** 点击按钮. */
|
23
27
|
kgIcon: import("vue").PropType<string | null>;
|
24
28
|
kgText: import("vue").PropType<string | null>;
|
25
29
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
26
30
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
27
31
|
kgLoading: import("vue").PropType<boolean>;
|
28
|
-
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
32
|
+
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
29
33
|
}>>, {
|
30
34
|
kgPrimary: boolean | null | undefined;
|
31
35
|
}>;
|
@@ -6,6 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
type: import("vue").PropType<boolean | null | undefined>;
|
7
7
|
default: undefined;
|
8
8
|
};
|
9
|
+
/** 点击按钮. */
|
9
10
|
kgIcon: import("vue").PropType<string | null>;
|
10
11
|
kgText: import("vue").PropType<string | null>;
|
11
12
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
@@ -20,6 +21,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
20
21
|
type: import("vue").PropType<boolean | null | undefined>;
|
21
22
|
default: undefined;
|
22
23
|
};
|
24
|
+
/** 点击按钮. */
|
23
25
|
kgIcon: import("vue").PropType<string | null>;
|
24
26
|
kgText: import("vue").PropType<string | null>;
|
25
27
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
@@ -6,8 +6,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
type: import("vue").PropType<boolean | null | undefined>;
|
7
7
|
default: undefined;
|
8
8
|
};
|
9
|
-
/** 点击按钮. */
|
10
9
|
kgIcon: import("vue").PropType<string | null>;
|
10
|
+
/** 点击按钮. */
|
11
11
|
kgText: import("vue").PropType<string | null>;
|
12
12
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
13
13
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
@@ -21,8 +21,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
21
21
|
type: import("vue").PropType<boolean | null | undefined>;
|
22
22
|
default: undefined;
|
23
23
|
};
|
24
|
-
/** 点击按钮. */
|
25
24
|
kgIcon: import("vue").PropType<string | null>;
|
25
|
+
/** 点击按钮. */
|
26
26
|
kgText: import("vue").PropType<string | null>;
|
27
27
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
28
28
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
11
11
|
kgText: import("vue").PropType<string | null>;
|
12
12
|
kgColor: import("vue").PropType<KG_BTN_COLOR | null>;
|
13
13
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
14
|
-
kgLoading: import("vue").PropType<boolean>;
|
14
|
+
kgLoading: import("vue").PropType<boolean>;
|
15
15
|
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
16
16
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
17
17
|
kgButton: import("vue").PropType<import("../../..").VarButton>;
|
@@ -25,7 +25,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
25
25
|
kgText: import("vue").PropType<string | null>;
|
26
26
|
kgColor: import("vue").PropType<KG_BTN_COLOR | null>;
|
27
27
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
28
|
-
kgLoading: import("vue").PropType<boolean>;
|
28
|
+
kgLoading: import("vue").PropType<boolean>;
|
29
29
|
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
30
30
|
}>>, {
|
31
31
|
kgPrimary: boolean | null | undefined;
|
@@ -4,11 +4,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
kgVarName: import("vue").PropType<string | null>;
|
5
5
|
kgType: import("vue").PropType<import("../../../consts").KG_BTN_TYPE | null>;
|
6
6
|
kgPrimary: {
|
7
|
-
/** 点击按钮. */
|
8
7
|
type: import("vue").PropType<boolean | null | undefined>;
|
8
|
+
/** 点击按钮. */
|
9
9
|
default: undefined;
|
10
10
|
};
|
11
|
-
kgIcon: import("vue").PropType<string | null>;
|
11
|
+
kgIcon: import("vue").PropType<string | null>;
|
12
12
|
kgText: import("vue").PropType<string | null>;
|
13
13
|
kgColor: import("vue").PropType<KG_BTN_COLOR | null>;
|
14
14
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
@@ -19,11 +19,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
19
19
|
kgVarName: import("vue").PropType<string | null>;
|
20
20
|
kgType: import("vue").PropType<import("../../../consts").KG_BTN_TYPE | null>;
|
21
21
|
kgPrimary: {
|
22
|
-
/** 点击按钮. */
|
23
22
|
type: import("vue").PropType<boolean | null | undefined>;
|
23
|
+
/** 点击按钮. */
|
24
24
|
default: undefined;
|
25
25
|
};
|
26
|
-
kgIcon: import("vue").PropType<string | null>;
|
26
|
+
kgIcon: import("vue").PropType<string | null>;
|
27
27
|
kgText: import("vue").PropType<string | null>;
|
28
28
|
kgColor: import("vue").PropType<KG_BTN_COLOR | null>;
|
29
29
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
@@ -9,7 +9,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
9
9
|
kgIcon: import("vue").PropType<string | null>;
|
10
10
|
kgText: import("vue").PropType<string | null>;
|
11
11
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
12
|
-
/** 点击按钮. */
|
13
12
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
14
13
|
kgLoading: import("vue").PropType<boolean>;
|
15
14
|
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
@@ -24,7 +23,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
24
23
|
kgIcon: import("vue").PropType<string | null>;
|
25
24
|
kgText: import("vue").PropType<string | null>;
|
26
25
|
kgColor: import("vue").PropType<import("../../..").KG_BTN_COLOR | null>;
|
27
|
-
/** 点击按钮. */
|
28
26
|
kgDisabled: import("vue").PropType<boolean | null | undefined>;
|
29
27
|
kgLoading: import("vue").PropType<boolean>;
|
30
28
|
onKgClick: import("vue").PropType<(args?: any) => Promise<boolean>>;
|
@@ -18,3 +18,5 @@ export declare function getDefaultHeight(varProfileDetails?: Array<VarProfileDet
|
|
18
18
|
* @param headerTeleport 是否将头部放到顶部的导航栏中.
|
19
19
|
*/
|
20
20
|
export declare function getMaxHeight(varProfileDetails?: Array<VarProfileDetail> | null, headerTeleport?: boolean | null): number;
|
21
|
+
export declare type IUseLayoutHeaderResizeObserver = {};
|
22
|
+
export declare function _useLayoutHeaderResizeObserver(): IUseLayoutHeaderResizeObserver;
|
package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.CreateModal.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import './KgVarConfig.Modal.Var.CreateModal.less';
|
2
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
2
|
+
import './KgVarConfig.Modal.Var.CreateModal.less';
|
3
3
|
export declare const getProps: () => {
|
4
4
|
visible: PropType<boolean>;
|
5
5
|
'onUpdate:visible': PropType<(value: boolean) => void>;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
2
|
+
import './KgWarehouse.less';
|
3
|
+
export declare const getProps: () => {
|
4
|
+
/**
|
5
|
+
* 是否隐藏.
|
6
|
+
* 该组件需要在不同的地方使用, 在有的地方需要显示当前选择的仓库, 并且可以通过点击打开弹窗, 在有的地方, 不需要显示, 用户通过参数控制是否打开弹窗.
|
7
|
+
* @default undefined
|
8
|
+
*/
|
9
|
+
kgInvisible: PropType<boolean>;
|
10
|
+
onKgOk: PropType<() => void>;
|
11
|
+
};
|
12
|
+
export declare type IKgWarehouseProps = Partial<ExtractPropTypes<ReturnType<typeof getProps>>>;
|
13
|
+
declare const _default: import("vue").DefineComponent<{
|
14
|
+
/**
|
15
|
+
* 是否隐藏.
|
16
|
+
* 该组件需要在不同的地方使用, 在有的地方需要显示当前选择的仓库, 并且可以通过点击打开弹窗, 在有的地方, 不需要显示, 用户通过参数控制是否打开弹窗.
|
17
|
+
* @default undefined
|
18
|
+
*/
|
19
|
+
kgInvisible: PropType<boolean>;
|
20
|
+
onKgOk: PropType<() => void>;
|
21
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "kgOk"[], "kgOk", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
22
|
+
/**
|
23
|
+
* 是否隐藏.
|
24
|
+
* 该组件需要在不同的地方使用, 在有的地方需要显示当前选择的仓库, 并且可以通过点击打开弹窗, 在有的地方, 不需要显示, 用户通过参数控制是否打开弹窗.
|
25
|
+
* @default undefined
|
26
|
+
*/
|
27
|
+
kgInvisible: PropType<boolean>;
|
28
|
+
onKgOk: PropType<() => void>;
|
29
|
+
}>> & {
|
30
|
+
onKgOk?: ((...args: any[]) => any) | undefined;
|
31
|
+
}, {}>;
|
32
|
+
export default _default;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Pinia } from 'pinia';
|
2
|
+
import { ComputedRef } from 'vue';
|
3
|
+
import { WhVO } from '../../apis/WMS/models';
|
4
|
+
import { IRemoveEventListenerHandler } from '../../consts';
|
5
|
+
import { IKgWarehouseMountedCb, IKgWarehouseStore } from './index.store';
|
6
|
+
export declare type IUseKgWarehouse = {
|
7
|
+
store: IKgWarehouseStore;
|
8
|
+
visible: ComputedRef<boolean>;
|
9
|
+
/** 当前仓库. */
|
10
|
+
warehouse: ComputedRef<WhVO | null>;
|
11
|
+
/** 监听事件: 组件加载完成. */
|
12
|
+
onMounted(cb: IKgWarehouseMountedCb): IRemoveEventListenerHandler;
|
13
|
+
};
|
14
|
+
/**
|
15
|
+
* 在某些地方调用时(比如在路由守卫中), pinia 尚未设置, 此时需要手动传入 pinia 实例.
|
16
|
+
* @param pinia
|
17
|
+
*/
|
18
|
+
export declare function useKgWarehouse(pinia?: Pinia): IUseKgWarehouse;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { Pinia, StoreDefinition } from 'pinia';
|
2
|
+
import { WhVO } from '../../apis/WMS/models';
|
3
|
+
/**
|
4
|
+
* 事件类型.
|
5
|
+
* 'mounted': 组件加载完成
|
6
|
+
*/
|
7
|
+
export declare type IKgWarehouseEvent = 'mounted';
|
8
|
+
/** 事件监听函数: mounted. */
|
9
|
+
export declare type IKgWarehouseMountedCb = () => void;
|
10
|
+
export declare type IKgWarehouseCb = IKgWarehouseMountedCb;
|
11
|
+
export interface IKgWarehouseState {
|
12
|
+
/** 弹窗是否显示. */
|
13
|
+
visible: boolean;
|
14
|
+
warehouse: WhVO | null;
|
15
|
+
mountedListeners: Array<IKgWarehouseMountedCb>;
|
16
|
+
}
|
17
|
+
export declare type IKgWarehouseStoreDefinition = StoreDefinition<'KgWarehouse', IKgWarehouseState, {
|
18
|
+
getVisible: boolean;
|
19
|
+
/** 获取当前仓库. */
|
20
|
+
getWarehouse: WhVO | null;
|
21
|
+
}, {
|
22
|
+
/**
|
23
|
+
* 注册事件监听.
|
24
|
+
* @param event 事件名称.
|
25
|
+
* @param cb 回调函数.
|
26
|
+
*/
|
27
|
+
addEventListener(event: IKgWarehouseEvent, cb: IKgWarehouseCb): void;
|
28
|
+
/**
|
29
|
+
* 退订事件监听.
|
30
|
+
* @param event 事件名称.
|
31
|
+
* @param cb 回调函数.
|
32
|
+
*/
|
33
|
+
removeEventListener(event: IKgWarehouseEvent, cb?: IKgWarehouseCb): void;
|
34
|
+
/**
|
35
|
+
* 触发事件.
|
36
|
+
* @param event 事件名称.
|
37
|
+
* @param args 数据.
|
38
|
+
*/
|
39
|
+
emit(event: IKgWarehouseEvent, args?: any | null): void;
|
40
|
+
setVisible(visible: boolean): void;
|
41
|
+
setWarehouse(warehouse?: WhVO | null): void;
|
42
|
+
}>;
|
43
|
+
export declare type IKgWarehouseStore = ReturnType<IKgWarehouseStoreDefinition>;
|
44
|
+
export declare const useKgWarehouseStore: (_pinia?: Pinia) => IKgWarehouseStoreDefinition;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Pinia } from 'pinia';
|
2
|
+
import { ComputedRef } from 'vue';
|
3
|
+
import { IKgLocale } from '../consts';
|
4
|
+
import { IKgStateOption, IKgStore, T } from './index.store';
|
5
|
+
export declare type IUseKg = {
|
6
|
+
store: IKgStore;
|
7
|
+
/** 语言. */
|
8
|
+
locale: ComputedRef<IKgLocale> | null;
|
9
|
+
/** 配置参数. */
|
10
|
+
option: ComputedRef<IKgStateOption>;
|
11
|
+
t: T;
|
12
|
+
};
|
13
|
+
/**
|
14
|
+
* 在某些地方调用时(比如在路由守卫中), pinia 尚未设置, 此时需要手动传入 pinia 实例.
|
15
|
+
* @param pinia
|
16
|
+
*/
|
17
|
+
export declare function useKg(pinia?: Pinia): IUseKg;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { Pinia, StoreDefinition } from 'pinia';
|
2
|
+
import { ComputedRef } from 'vue';
|
3
|
+
import { IKgLocale } from '../consts';
|
4
|
+
/** 配置参数. */
|
5
|
+
export declare type IKgStateOption = {
|
6
|
+
/** 仓库选择. */
|
7
|
+
KgWarehouse?: {
|
8
|
+
/** 是否启用. */
|
9
|
+
enable?: boolean;
|
10
|
+
/** 默认的仓库编码, 只有在 IKgStateOption.KgWarehouse.enable 为 false 时才生效. */
|
11
|
+
defaultWarehouseID?: string;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
/** 翻译方法. */
|
15
|
+
export declare type T = {
|
16
|
+
(key: string | undefined | null): string;
|
17
|
+
(key: string | undefined | null, locale: string): string;
|
18
|
+
(key: string | undefined | null, locale: string, list: unknown[]): string;
|
19
|
+
(key: string | undefined | null, locale: string, named: Record<string, unknown>): string;
|
20
|
+
(key: string | undefined | null, list: unknown[]): string;
|
21
|
+
(key: string | undefined | null, named: Record<string, unknown>): string;
|
22
|
+
};
|
23
|
+
export interface IKgState {
|
24
|
+
/** 语言. */
|
25
|
+
locale: ComputedRef<IKgLocale> | null;
|
26
|
+
/** 翻译方法. */
|
27
|
+
tFunction: T | null;
|
28
|
+
option: IKgStateOption;
|
29
|
+
}
|
30
|
+
export declare type IKgStoreDefinition = StoreDefinition<'Kg', IKgState, {
|
31
|
+
/** 获取配置参数. */
|
32
|
+
getLocale: ComputedRef<IKgLocale> | null;
|
33
|
+
/** 获取配置参数. */
|
34
|
+
getOption: IKgStateOption;
|
35
|
+
}, {
|
36
|
+
setLocale(locale: ComputedRef<IKgLocale> | null): void;
|
37
|
+
setT(i18n: any): void;
|
38
|
+
setOption(option: IKgStateOption): void;
|
39
|
+
/** 翻译. */
|
40
|
+
t: T;
|
41
|
+
}>;
|
42
|
+
export declare type IKgStore = ReturnType<IKgStoreDefinition>;
|
43
|
+
export declare const useKgStore: (_pinia?: Pinia) => IKgStoreDefinition;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { Pinia } from 'pinia';
|
2
|
-
import { ComputedRef } from 'vue';
|
2
|
+
import { App, ComputedRef } from 'vue';
|
3
|
+
import { IKgLocale } from '../consts';
|
4
|
+
import { IKgStateOption } from './index.store';
|
3
5
|
/**
|
4
6
|
* 配置 pinia 实例.
|
5
7
|
* @param pinia pinia 实例.
|
@@ -9,32 +11,19 @@ export declare function setPinia(pinia: Pinia): void;
|
|
9
11
|
* 获取 pinia 实例.
|
10
12
|
*/
|
11
13
|
export declare function pinia(): Pinia | null;
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
(key: string): string;
|
23
|
-
(key: string, locale: string): string;
|
24
|
-
(key: string, locale: string, list: unknown[]): string;
|
25
|
-
(key: string, locale: string, named: Record<string, unknown>): string;
|
26
|
-
(key: string, list: unknown[]): string;
|
27
|
-
(key: string, named: Record<string, unknown>): string;
|
14
|
+
export declare type IKgOptions = {
|
15
|
+
app: App;
|
16
|
+
pinia: Pinia;
|
17
|
+
locale: ComputedRef<IKgLocale>;
|
18
|
+
/**
|
19
|
+
* import { createI18n } from 'vue-i18n';
|
20
|
+
* ReturnType<typeof createI18n>
|
21
|
+
*/
|
22
|
+
i18n: any;
|
23
|
+
option: IKgStateOption;
|
28
24
|
};
|
29
25
|
/**
|
30
|
-
*
|
31
|
-
* @param
|
32
|
-
*/
|
33
|
-
export declare function setT(i18n: any): void;
|
34
|
-
/**
|
35
|
-
* 翻译.
|
36
|
-
* @param key
|
37
|
-
* @param arg
|
26
|
+
* 初始化组件库.
|
27
|
+
* @param options 参数.
|
38
28
|
*/
|
39
|
-
export declare
|
40
|
-
export {};
|
29
|
+
export declare function setup(options: IKgOptions): void;
|
@@ -49,6 +49,12 @@ declare const _default: {
|
|
49
49
|
variableName: string;
|
50
50
|
variables: string;
|
51
51
|
};
|
52
|
+
KgWarehouse: {
|
53
|
+
reloadMessage: string;
|
54
|
+
selectWarehouse: string;
|
55
|
+
title: string;
|
56
|
+
warehouse: string;
|
57
|
+
};
|
52
58
|
action: string;
|
53
59
|
add: string;
|
54
60
|
button: string;
|
@@ -68,6 +74,7 @@ declare const _default: {
|
|
68
74
|
lookup: string;
|
69
75
|
no: string;
|
70
76
|
query: string;
|
77
|
+
refresh: string;
|
71
78
|
required: string;
|
72
79
|
reset: string;
|
73
80
|
save: string;
|