vap1 0.5.2 → 0.5.4
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/cems/admin/CustomPagination.d.ts +68 -0
- package/cems/admin/CustomPagination.js +2 -0
- package/cems/admin/utils.d.ts +4 -0
- package/cems/admin/utils.js +0 -1
- package/cems/index.d.ts +13 -1
- package/cems/index.js +7 -2
- package/components/Tables/ApiTable.d.ts +1 -0
- package/components/Tables/ApiTableModal.d.ts +1 -0
- package/components/Tables/VTable.d.ts +1 -0
- package/components/Tables/index.d.ts +9 -1
- package/hooks/useModals.d.ts +1 -2
- package/index.d.ts +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
import type { PlainObject } from '../../basetype';
|
|
3
|
+
export type CustomPaginationProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 查询列表数据的接口
|
|
6
|
+
*/
|
|
7
|
+
api: string;
|
|
8
|
+
/**
|
|
9
|
+
* 容器div的class属性的值
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 默认查询条件
|
|
14
|
+
*/
|
|
15
|
+
default?: PlainObject;
|
|
16
|
+
/**
|
|
17
|
+
* 是否显示修改每页显示的记录条数的下拉框
|
|
18
|
+
*/
|
|
19
|
+
showSizeChanger?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 是否显示“跳至N页”
|
|
22
|
+
*/
|
|
23
|
+
showQuickJumper?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 设置初始每页显示的记录条数
|
|
26
|
+
*/
|
|
27
|
+
pageSize?: number;
|
|
28
|
+
/**
|
|
29
|
+
* 指定每页可以显示多少条的下拉框的候选项,例如:['12','20','30','50','100']
|
|
30
|
+
*/
|
|
31
|
+
pageSizeOptions?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* 分页栏上一页、下一页等切换分页按钮位置
|
|
34
|
+
*/
|
|
35
|
+
position?: 'left' | 'center' | 'right';
|
|
36
|
+
/**
|
|
37
|
+
* 用于显示数据总量和当前数据顺序
|
|
38
|
+
*/
|
|
39
|
+
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* 查询列表数据完成后的回调函数,可以用来给自定义表格设置数据源
|
|
42
|
+
* @example
|
|
43
|
+
const [tableData, setTableData] = useState([]);
|
|
44
|
+
|
|
45
|
+
<Table dataSource={tableData}/>
|
|
46
|
+
|
|
47
|
+
<CustomPagination
|
|
48
|
+
api=""
|
|
49
|
+
onLoadComplete={(tableData, tableParam, total, pageSize, pageNo)=>{
|
|
50
|
+
setTableData(tableData);
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
*/
|
|
54
|
+
onLoadComplete: (tableData: object[], tableParam: PlainObject, total: number, pageSize: number, pageNo: number) => void;
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
};
|
|
57
|
+
export type CustomPaginationRef = {
|
|
58
|
+
/**
|
|
59
|
+
* 获取列表查询条件
|
|
60
|
+
*/
|
|
61
|
+
getParams: () => Record<string, any>;
|
|
62
|
+
/**
|
|
63
|
+
* 按条件查询数据
|
|
64
|
+
*/
|
|
65
|
+
query: (param?: Record<string, any> | null) => void;
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
};
|
|
68
|
+
export type CustomPaginationComponent = ForwardRefExoticComponent<CustomPaginationProps & RefAttributes<CustomPaginationRef>>;
|
package/cems/admin/utils.d.ts
CHANGED
|
@@ -3,3 +3,7 @@ export type GetOrgFlagByTreeIconNum = (treeIconNum: number) => string;
|
|
|
3
3
|
export type MD5 = (text: string) => string;
|
|
4
4
|
export type AES = (text: string, keyString: string, ivString?: string) => string;
|
|
5
5
|
export type RSA = (text: string, publicKey?: string) => string;
|
|
6
|
+
export type InitSchema = (schema: any) => any;
|
|
7
|
+
export type ConvertOptions = (opt: any, callTemplateFunc?: Function) => Array<any>;
|
|
8
|
+
export type RegExpTest = (rules: any, nValue: any) => string | undefined;
|
|
9
|
+
export type CallWhereWhileFunc = (wLogic: any, wValue: any, gFunc: any, fValue?: any, init?: any) => boolean;
|
package/cems/admin/utils.js
CHANGED
package/cems/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ComponentType } from "react";
|
|
2
2
|
import type { CardTableComponent } from './admin/CardTable';
|
|
3
3
|
export type { CardTableProps, CardTableRef } from './admin/CardTable';
|
|
4
|
+
import type { CustomPaginationComponent } from "./admin/CustomPagination";
|
|
5
|
+
export type { CustomPaginationProps, CustomPaginationRef } from "./admin/CustomPagination";
|
|
4
6
|
import type { EasyuiTreeComponent } from './admin/EasyuiTree';
|
|
5
7
|
export type { EasyuiTreeProps } from './admin/EasyuiTree';
|
|
6
8
|
import type { AsyncSelectComponent } from './admin/AsyncSelect';
|
|
@@ -9,8 +11,9 @@ interface BuiltInAdminComponents {
|
|
|
9
11
|
CardTable: CardTableComponent;
|
|
10
12
|
EasyuiTree: EasyuiTreeComponent;
|
|
11
13
|
AsyncSelect: AsyncSelectComponent;
|
|
14
|
+
CustomPagination: CustomPaginationComponent;
|
|
12
15
|
}
|
|
13
|
-
import type { GetTreeIconNumByOrgFlag, GetOrgFlagByTreeIconNum, MD5, AES, RSA } from './admin/utils';
|
|
16
|
+
import type { GetTreeIconNumByOrgFlag, GetOrgFlagByTreeIconNum, MD5, AES, RSA, InitSchema, ConvertOptions, RegExpTest, CallWhereWhileFunc } from './admin/utils';
|
|
14
17
|
import type { Validator } from './admin/validator';
|
|
15
18
|
interface BuiltInAdminUtils {
|
|
16
19
|
getTreeIconNumByOrgFlag: GetTreeIconNumByOrgFlag;
|
|
@@ -19,6 +22,10 @@ interface BuiltInAdminUtils {
|
|
|
19
22
|
md5: MD5;
|
|
20
23
|
aes: AES;
|
|
21
24
|
rsa: RSA;
|
|
25
|
+
initSchema: InitSchema;
|
|
26
|
+
convertOptions: ConvertOptions;
|
|
27
|
+
regExpTest: RegExpTest;
|
|
28
|
+
callWhereWhileFunc: CallWhereWhileFunc;
|
|
22
29
|
}
|
|
23
30
|
import type { ChartBarComponent, ChartBaseComponent, ChartPieComponent } from './assets/Charts';
|
|
24
31
|
export type { ChartBarProps, ChartBaseProps, ChartPieProps, ChartRef, } from "./assets/Charts";
|
|
@@ -166,12 +173,17 @@ export declare const UTILS: BuiltInUtils;
|
|
|
166
173
|
export declare const CardTable: CardTableComponent;
|
|
167
174
|
export declare const EasyuiTree: EasyuiTreeComponent;
|
|
168
175
|
export declare const AsyncSelect: AsyncSelectComponent;
|
|
176
|
+
export declare const CustomPagination: CustomPaginationComponent;
|
|
169
177
|
export declare const getTreeIconNumByOrgFlag: GetTreeIconNumByOrgFlag;
|
|
170
178
|
export declare const getOrgFlagByTreeIconNum: GetOrgFlagByTreeIconNum;
|
|
171
179
|
export declare const validator: Validator;
|
|
172
180
|
export declare const md5: MD5;
|
|
173
181
|
export declare const aes: AES;
|
|
174
182
|
export declare const rsa: RSA;
|
|
183
|
+
export declare const initSchema: InitSchema;
|
|
184
|
+
export declare const convertOptions: ConvertOptions;
|
|
185
|
+
export declare const regExpTest: RegExpTest;
|
|
186
|
+
export declare const callWhereWhileFunc: CallWhereWhileFunc;
|
|
175
187
|
export declare const ChartBase: ChartBaseComponent;
|
|
176
188
|
export declare const ChartBar: ChartBarComponent;
|
|
177
189
|
export declare const ChartPie: ChartPieComponent;
|
package/cems/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.registerComponent = exports.ComponentLibrary = exports.useDForm = exports.convertArrayToObject = exports.convertObjectToArray = exports.compareVersion = exports.uuid = exports.checkIpPort = exports.checkIpRange = exports.checkIPRangeIntersect = exports.DDrawer = exports.DIcon = exports.DDiv = exports.DCol = exports.DUpload = void 0;
|
|
3
|
+
exports.DSlider = exports.DSelect = exports.DSCTable = exports.DRadio = exports.DLabel = exports.DInput = exports.DDynamicTreeSelect = exports.DDynamicSelect = exports.DDatePicker = exports.DColorPicker = exports.DCheckboxGroup = exports.DCheckbox = exports.DButton = exports.DApiTable = exports.DForm = exports.CForm = exports.formatCols = exports.formatColumns = exports.useDApiGlobal = exports.useDApi = exports.useDModals = exports.getReload = exports.AjaxPostData = exports.Patch = exports.DivWidth = exports.Sensitive = exports.DModalInfo = exports.DInfo = exports.DModalTable = exports.DTable = exports.CUpload = exports.ChartPie = exports.ChartBar = exports.ChartBase = exports.callWhereWhileFunc = exports.regExpTest = exports.convertOptions = exports.initSchema = exports.rsa = exports.aes = exports.md5 = exports.validator = exports.getOrgFlagByTreeIconNum = exports.getTreeIconNumByOrgFlag = exports.CustomPagination = exports.AsyncSelect = exports.EasyuiTree = exports.CardTable = exports.UTILS = exports.COMPONENTS = void 0;
|
|
4
|
+
exports.registerComponent = exports.ComponentLibrary = exports.useDForm = exports.convertArrayToObject = exports.convertObjectToArray = exports.compareVersion = exports.uuid = exports.checkIpPort = exports.checkIpRange = exports.checkIPRangeIntersect = exports.DDrawer = exports.DIcon = exports.DDiv = exports.DCol = exports.DUpload = exports.DTree = exports.DTimePicker = exports.DPTable = exports.DTab = exports.DSwitch = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* 说明,如需要使用 `vap2/deps/cems` 请确保是 CEMS 应用/模块
|
|
7
7
|
*/
|
|
@@ -14,6 +14,7 @@ exports.UTILS = (0, _Support_1.globalDefault)(CEMS_UTILS, {});
|
|
|
14
14
|
exports.CardTable = exports.COMPONENTS['CardTable'];
|
|
15
15
|
exports.EasyuiTree = exports.COMPONENTS['EasyuiTree'];
|
|
16
16
|
exports.AsyncSelect = exports.COMPONENTS['AsyncSelect'];
|
|
17
|
+
exports.CustomPagination = exports.COMPONENTS['CustomPagination'];
|
|
17
18
|
// export admin utils
|
|
18
19
|
exports.getTreeIconNumByOrgFlag = exports.UTILS['getTreeIconNumByOrgFlag'];
|
|
19
20
|
exports.getOrgFlagByTreeIconNum = exports.UTILS['getOrgFlagByTreeIconNum'];
|
|
@@ -21,6 +22,10 @@ exports.validator = exports.UTILS['validator'];
|
|
|
21
22
|
exports.md5 = exports.UTILS['md5'];
|
|
22
23
|
exports.aes = exports.UTILS['aes'];
|
|
23
24
|
exports.rsa = exports.UTILS['rsa'];
|
|
25
|
+
exports.initSchema = exports.UTILS['initSchema'];
|
|
26
|
+
exports.convertOptions = exports.UTILS['convertOptions'];
|
|
27
|
+
exports.regExpTest = exports.UTILS['regExpTest'];
|
|
28
|
+
exports.callWhereWhileFunc = exports.UTILS['callWhereWhileFunc'];
|
|
24
29
|
// export assets components
|
|
25
30
|
exports.ChartBase = exports.COMPONENTS['ChartBase'];
|
|
26
31
|
exports.ChartBar = exports.COMPONENTS['ChartBar'];
|
|
@@ -13,4 +13,5 @@ export declare const ApiTable: React.ForwardRefExoticComponent<import("./index")
|
|
|
13
13
|
selectDisabled?: (record: any) => boolean;
|
|
14
14
|
actionBar?: Array<import("./Components/ActionBar").TableActionButton[]> | React.ReactNode;
|
|
15
15
|
autoLoad?: false;
|
|
16
|
+
fixHeader?: boolean;
|
|
16
17
|
} & Pick<ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & React.RefAttributes<ApiModel>>;
|
|
@@ -13,6 +13,7 @@ export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").
|
|
|
13
13
|
selectDisabled?: (record: any) => boolean;
|
|
14
14
|
actionBar?: Array<import("./Components/ActionBar").TableActionButton[]> | React.ReactNode;
|
|
15
15
|
autoLoad?: false;
|
|
16
|
+
fixHeader?: boolean;
|
|
16
17
|
} & Pick<import("../../hooks/useApiBase").ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & Omit<import("antd/es/modal").ModalProps, "visible" | "onCancel" | "onOk"> & {
|
|
17
18
|
open?: boolean;
|
|
18
19
|
onOk?: (data?: import("../..").PlainObject) => void;
|
|
@@ -37,6 +37,7 @@ export declare const VTable: React.ForwardRefExoticComponent<import("./index").T
|
|
|
37
37
|
selectDisabled?: (record: any) => boolean;
|
|
38
38
|
actionBar?: Array<TableActionButton[]> | React.ReactNode;
|
|
39
39
|
autoLoad?: false;
|
|
40
|
+
fixHeader?: boolean;
|
|
40
41
|
} & {
|
|
41
42
|
/**
|
|
42
43
|
* 列表模型,可以使用系统提供的 useApi/useArray 等,也可自行实现列表模型
|
|
@@ -59,6 +59,14 @@ export type BaseTableProps = TableDefine & Pick<BoxProps, 'mode' | 'selectBar' |
|
|
|
59
59
|
* 是否自动查询,默认为TRUE
|
|
60
60
|
*/
|
|
61
61
|
autoLoad?: false;
|
|
62
|
+
/**
|
|
63
|
+
* @experimental
|
|
64
|
+
* 说明: 1.5 版本才有此属性
|
|
65
|
+
* 2.0版本会自动锁定表头
|
|
66
|
+
* 1.5版本有问题: http://192.168.119.213:9999/vap2/why-not/#%E4%B8%BA%E4%BB%80%E4%B9%881-5%E7%89%88%E6%9C%AC%E7%9A%84vtable%E4%B8%8D%E6%94%AF%E6%8C%81%E9%94%81%E5%AE%9A%E8%A1%A8%E5%A4%B4
|
|
67
|
+
* 传此参数后,会试验性的计算,可能会有BUG
|
|
68
|
+
*/
|
|
69
|
+
fixHeader?: boolean;
|
|
62
70
|
};
|
|
63
71
|
import type { ApiTableProps } from './ApiTable';
|
|
64
72
|
export type ApiTable = ForwardRefExoticComponent<ApiTableProps & RefAttributes<ApiModel>> & TableDefined;
|
|
@@ -67,7 +75,7 @@ import type { VTableProps, VTableRef } from './VTable';
|
|
|
67
75
|
export type VTable = ForwardRefExoticComponent<VTableProps & RefAttributes<VTableRef>> & TableDefined;
|
|
68
76
|
export declare const VTable: VTable;
|
|
69
77
|
import type { STableProps } from './STable';
|
|
70
|
-
export type STable =
|
|
78
|
+
export type STable = ForwardRefExoticComponent<STableProps & RefAttributes<VTableRef>> & TableDefined;
|
|
71
79
|
export declare const STable: STable;
|
|
72
80
|
import type { TopTableProps } from './TopTable';
|
|
73
81
|
export type TopTable = ExoticComponent<TopTableProps> & TableDefined;
|
package/hooks/useModals.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UModalProps } from '../components/UForm';
|
|
2
2
|
import type { PlainObject } from "../basetype";
|
|
3
|
-
type ModalsState = {
|
|
3
|
+
export type ModalsState = {
|
|
4
4
|
modalProps: Pick<UModalProps, 'open' | 'onCancel' | 'data' | 'isEdit'>;
|
|
5
5
|
open: boolean;
|
|
6
6
|
isEdit: boolean;
|
|
@@ -37,4 +37,3 @@ export declare const useModals: () => {
|
|
|
37
37
|
showUpload: (extra?: any) => void;
|
|
38
38
|
showDetail: (data?: PlainObject, extra?: any) => void;
|
|
39
39
|
};
|
|
40
|
-
export {};
|
package/index.d.ts
CHANGED
|
@@ -165,5 +165,8 @@ export { Role, type RoleProps } from './components/_common/Role';
|
|
|
165
165
|
export { IAutoComplete, type IAutoCompleteProps } from './components/_common/AutoComplete';
|
|
166
166
|
export { PromiseLabel, type PromiseLabelProps } from './components/_common/PromiseLabel';
|
|
167
167
|
export type { Key, BaseTypes, PlainObject, BaseItem, BaseOption, PageProps, } from './basetype';
|
|
168
|
-
export type { ApiModel, ListModel } from './hooks/_list';
|
|
169
168
|
export type { Moment as Dayjs } from 'dayjs';
|
|
169
|
+
export type { FC, ForwardRefExoticComponent, ReactNode, PropsWithChildren, CSSProperties, RefAttributes, MutableRefObject, } from 'react';
|
|
170
|
+
export type { ModalsState } from './hooks/useModals';
|
|
171
|
+
export type { ApiModel, ListModel } from './hooks/_list';
|
|
172
|
+
export type { OpenState } from './hooks/useOpenState';
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"vap1","version":"0.5.
|
|
1
|
+
{"name":"vap1","version":"0.5.4","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}
|