@kordar/easyui-tpl 2.0.7 → 2.0.9
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.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.css +1 -0
- package/dist/index.umd.cjs +11 -0
- package/dist/index.umd.cjs.map +1 -0
- package/dist/public/en.json +199 -0
- package/dist/public/iconfont.json +93 -0
- package/dist/public/zh_CN.json +209 -0
- package/dist/types/components/BaseLayout.d.ts +3 -0
- package/dist/types/components/LayoutContext.d.ts +10 -0
- package/dist/types/components/LocaleBarItem.d.ts +3 -0
- package/dist/types/components/PaginationPanel.d.ts +4 -0
- package/dist/types/components/RememberMeBox.d.ts +8 -0
- package/dist/types/components/SettingBarItem.d.ts +3 -0
- package/dist/types/components/ThemeSwitch.d.ts +7 -0
- package/dist/types/components/UserBarItem.d.ts +3 -0
- package/dist/types/composable/useAppRedirect.d.ts +1 -0
- package/dist/types/composable/useAppStarter.d.ts +7 -0
- package/dist/types/composable/useLocalTable.d.ts +3 -0
- package/dist/types/composable/useMenuAndTabData.d.ts +43 -0
- package/dist/types/composable/useRefreshKey.d.ts +1 -0
- package/dist/types/composable/useRemoteTable.d.ts +3 -0
- package/dist/types/hoc/withDocHoc.d.ts +4 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/init.d.ts +7 -0
- package/dist/types/service/AdminService.d.ts +23 -0
- package/dist/types/service/AuthService.d.ts +13 -0
- package/dist/types/service/ConfigService.d.ts +6 -0
- package/dist/types/service/RbacService.d.ts +80 -0
- package/dist/types/service/ResourceService.d.ts +25 -0
- package/dist/types/util/form.d.ts +8 -0
- package/dist/types/util/helper.d.ts +7 -0
- package/dist/types/util/interface.d.ts +66 -0
- package/dist/types/util/lazy.d.ts +2 -0
- package/dist/types/util/tables.d.ts +5 -0
- package/dist/types/views/admin/assign.d.ts +4 -0
- package/dist/types/views/admin/context.d.ts +3 -0
- package/dist/types/views/admin/form_dlg.d.ts +4 -0
- package/dist/types/views/admin/index.d.ts +3 -0
- package/dist/types/views/admin/search.d.ts +3 -0
- package/dist/types/views/admin/table.d.ts +4 -0
- package/dist/types/views/dict/context.d.ts +3 -0
- package/dist/types/views/dict/dialog.d.ts +5 -0
- package/dist/types/views/dict/form.d.ts +4 -0
- package/dist/types/views/dict/index.d.ts +3 -0
- package/dist/types/views/dict/search.d.ts +3 -0
- package/dist/types/views/dict/table.d.ts +4 -0
- package/dist/types/views/dict-item/context.d.ts +3 -0
- package/dist/types/views/dict-item/dialog.d.ts +4 -0
- package/dist/types/views/dict-item/form.d.ts +4 -0
- package/dist/types/views/dict-item/index.d.ts +3 -0
- package/dist/types/views/dict-item/search.d.ts +3 -0
- package/dist/types/views/dict-item/table.d.ts +4 -0
- package/dist/types/views/home/index.d.ts +2 -0
- package/dist/types/views/icon/context.d.ts +3 -0
- package/dist/types/views/icon/index.d.ts +2 -0
- package/dist/types/views/icon/parseIcons.d.ts +10 -0
- package/dist/types/views/icon/search.d.ts +3 -0
- package/dist/types/views/icon/table.d.ts +4 -0
- package/dist/types/views/language/index.d.ts +3 -0
- package/dist/types/views/login/form.d.ts +3 -0
- package/dist/types/views/login/header.d.ts +9 -0
- package/dist/types/views/login/index.d.ts +3 -0
- package/dist/types/views/page/404.d.ts +2 -0
- package/dist/types/views/permissions/context.d.ts +3 -0
- package/dist/types/views/permissions/fastadd_form_dlg.d.ts +4 -0
- package/dist/types/views/permissions/form_dlg.d.ts +4 -0
- package/dist/types/views/permissions/index.d.ts +3 -0
- package/dist/types/views/permissions/search.d.ts +3 -0
- package/dist/types/views/permissions/table.d.ts +3 -0
- package/dist/types/views/roles/assign.d.ts +4 -0
- package/dist/types/views/roles/context.d.ts +3 -0
- package/dist/types/views/roles/form_dlg.d.ts +4 -0
- package/dist/types/views/roles/index.d.ts +2 -0
- package/dist/types/views/roles/search.d.ts +3 -0
- package/dist/types/views/roles/table.d.ts +4 -0
- package/dist/types/views/router/context.d.ts +3 -0
- package/dist/types/views/router/form_dlg.d.ts +4 -0
- package/dist/types/views/router/index.d.ts +2 -0
- package/dist/types/views/router/search.d.ts +3 -0
- package/dist/types/views/router/table.d.ts +4 -0
- package/dist/types/views/setting/context.d.ts +3 -0
- package/dist/types/views/setting/dialog.d.ts +6 -0
- package/dist/types/views/setting/form.d.ts +4 -0
- package/dist/types/views/setting/index.d.ts +2 -0
- package/dist/types/views/setting/search.d.ts +3 -0
- package/dist/types/views/setting/table.d.ts +4 -0
- package/dist/types/views/srceen/design/container.d.ts +3 -0
- package/dist/types/views/srceen/design/index.d.ts +4 -0
- package/package.json +5 -4
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "./index.scss";
|
|
2
|
+
export * from "./util/lazy";
|
|
3
|
+
export * from "./util/interface";
|
|
4
|
+
export * from "./util/tables";
|
|
5
|
+
export * from "./util/form";
|
|
6
|
+
export * from "./util/helper";
|
|
7
|
+
export * from "./views/icon/parseIcons";
|
|
8
|
+
import { Request } from "@kordar-lib/request";
|
|
9
|
+
export { default as resourceService } from "./service/ResourceService";
|
|
10
|
+
export { default as rbacService } from "./service/RbacService";
|
|
11
|
+
export { default as adminService } from "./service/AdminService";
|
|
12
|
+
export { default as configService } from "./service/ConfigService";
|
|
13
|
+
export { default as authService } from "./service/AuthService";
|
|
14
|
+
export { default as useMenuAndTabData } from "./composable/useMenuAndTabData";
|
|
15
|
+
export { default as useAppStarter } from "./composable/useAppStarter";
|
|
16
|
+
export { default as useLocalTable } from "./composable/useLocalTable";
|
|
17
|
+
export { default as useTable } from "./composable/useRemoteTable";
|
|
18
|
+
export { default as useAppRedirect } from "./composable/useAppRedirect";
|
|
19
|
+
export { default as AdminView } from "./views/admin";
|
|
20
|
+
export { default as HomeView } from "./views/home";
|
|
21
|
+
export { default as SettingView } from "./views/setting";
|
|
22
|
+
export { default as LoginView } from "./views/login";
|
|
23
|
+
export { default as RolesView } from "./views/roles";
|
|
24
|
+
export { default as PermissionsView } from "./views/permissions";
|
|
25
|
+
export { default as DictView } from "./views/dict";
|
|
26
|
+
export { default as RouterView } from "./views/router";
|
|
27
|
+
export { default as NotFoundView } from "./views/page/404";
|
|
28
|
+
export { default as ScreenDesign } from "./views/srceen/design";
|
|
29
|
+
import { AppLayoutContext } from "./components/LayoutContext";
|
|
30
|
+
import BaseLayout from "./components/BaseLayout";
|
|
31
|
+
import LocaleBarItem from "./components/LocaleBarItem";
|
|
32
|
+
import PaginationPanel from "./components/PaginationPanel";
|
|
33
|
+
import SettingBarItem from "./components/SettingBarItem";
|
|
34
|
+
import { Tooltip } from 'rc-easyui';
|
|
35
|
+
import { default as RememberMeBox } from "./components/RememberMeBox";
|
|
36
|
+
import ThemeSwitch from "./components/ThemeSwitch";
|
|
37
|
+
import withDocHoc from "./hoc/withDocHoc";
|
|
38
|
+
export interface AdminConfig {
|
|
39
|
+
request: Request;
|
|
40
|
+
apis?: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export declare function install(cfg: AdminConfig): void;
|
|
45
|
+
export { BaseLayout, LocaleBarItem, PaginationPanel, SettingBarItem, ThemeSwitch, withDocHoc, AppLayoutContext, Tooltip, RememberMeBox, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Request } from "@kordar-lib/request";
|
|
2
|
+
import { MenuService } from "@kordar-lib/menus";
|
|
3
|
+
export declare function loadRequest(request: Request): void;
|
|
4
|
+
export declare function getRequest(): Request;
|
|
5
|
+
export declare const menuService: MenuService<number | string>;
|
|
6
|
+
export declare function registerApis(data: any): void;
|
|
7
|
+
export declare function getApi(key: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare class AdminService {
|
|
2
|
+
/**
|
|
3
|
+
* 注册用户
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
register(data?: any): Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
* 修改密码
|
|
9
|
+
* @param data
|
|
10
|
+
*/
|
|
11
|
+
resetPassword(data?: any): Promise<any>;
|
|
12
|
+
/**
|
|
13
|
+
* 用户菜单
|
|
14
|
+
*/
|
|
15
|
+
menus(): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* 获取用户基本信息
|
|
18
|
+
* @param id
|
|
19
|
+
*/
|
|
20
|
+
info(id: number | string): Promise<any>;
|
|
21
|
+
}
|
|
22
|
+
declare const adminService: AdminService;
|
|
23
|
+
export default adminService;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare class AuthService {
|
|
2
|
+
/**
|
|
3
|
+
* 获取验证码
|
|
4
|
+
*/
|
|
5
|
+
captcha(): Promise<any>;
|
|
6
|
+
/**
|
|
7
|
+
* 登录系统
|
|
8
|
+
*/
|
|
9
|
+
login(params: any, success: Function, fail: Function): Promise<void>;
|
|
10
|
+
configs(): Promise<any>;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: AuthService;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare class RbacService {
|
|
2
|
+
/**
|
|
3
|
+
* 获取角色列表
|
|
4
|
+
*/
|
|
5
|
+
roles(): Promise<any>;
|
|
6
|
+
/**
|
|
7
|
+
* 添加角色
|
|
8
|
+
*/
|
|
9
|
+
addRole(object: any): Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* 更新角色
|
|
12
|
+
*/
|
|
13
|
+
updateRole(object: any): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* 删除角色
|
|
16
|
+
*/
|
|
17
|
+
deleteRole(object: any): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* 批量删除角色
|
|
20
|
+
*/
|
|
21
|
+
batchDeleteRole(object: any): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* 获取权限列表
|
|
24
|
+
*/
|
|
25
|
+
permissions(): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* 添加权限
|
|
28
|
+
*/
|
|
29
|
+
addPermission(object: any): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* 更新权限
|
|
32
|
+
*/
|
|
33
|
+
updatePermission(object: any): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* 删除权限
|
|
36
|
+
*/
|
|
37
|
+
deletePermission(object: any): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* 批量删除权限
|
|
40
|
+
*/
|
|
41
|
+
batchDeletePermission(object: any): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* 获取规则列表
|
|
44
|
+
*/
|
|
45
|
+
rules(): Promise<any>;
|
|
46
|
+
/**
|
|
47
|
+
* 添加规则
|
|
48
|
+
*/
|
|
49
|
+
addRule(object: any): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* 删除规则
|
|
52
|
+
*/
|
|
53
|
+
deleteRule(object: any): Promise<any>;
|
|
54
|
+
/**
|
|
55
|
+
* 获取子item
|
|
56
|
+
*/
|
|
57
|
+
getChildren(params: any): Promise<any>;
|
|
58
|
+
/**
|
|
59
|
+
* 分配权限节点
|
|
60
|
+
*/
|
|
61
|
+
addPermissionChildren(data: any): Promise<any>;
|
|
62
|
+
/**
|
|
63
|
+
* 通过用户获取角色
|
|
64
|
+
*/
|
|
65
|
+
getRolesByUser(userId: any): Promise<any>;
|
|
66
|
+
/**
|
|
67
|
+
* 设置节点到用户
|
|
68
|
+
*/
|
|
69
|
+
assignItemToUser(data: any): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* 快速添加权限
|
|
72
|
+
*/
|
|
73
|
+
fastAddPermission(data: any): Promise<any>;
|
|
74
|
+
/**
|
|
75
|
+
* 获取当前用户的所有权限
|
|
76
|
+
*/
|
|
77
|
+
getPermissionsByUser(userId: any): Promise<any>;
|
|
78
|
+
}
|
|
79
|
+
declare const rbacService: RbacService;
|
|
80
|
+
export default rbacService;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EditorBody, FormBody, RemoveBody, SearchBody } from "@kordar-lib/crud";
|
|
2
|
+
import { FormDataType } from "@kordar-lib/base";
|
|
3
|
+
declare class ResourceService {
|
|
4
|
+
result(code: any, message: string, data: any, count: number, success: Function, fail?: Function): void;
|
|
5
|
+
private buildQueryString;
|
|
6
|
+
listWithQuery(api: string, query: any, data?: SearchBody): Promise<any>;
|
|
7
|
+
list(api: string, data?: SearchBody): Promise<any>;
|
|
8
|
+
listResult(api: string, req: SearchBody | undefined, success: Function): Promise<void>;
|
|
9
|
+
configs(api: string, data?: any): Promise<any>;
|
|
10
|
+
configsResult(api: string, req: any | undefined, success: Function): Promise<void>;
|
|
11
|
+
edit(api: string, editorBody: EditorBody): Promise<any>;
|
|
12
|
+
editResult(api: string, editorBody: EditorBody, success: Function): Promise<void>;
|
|
13
|
+
add(api: string, formBody: FormBody): Promise<any>;
|
|
14
|
+
update(api: string, formBody: FormBody): Promise<any>;
|
|
15
|
+
saveResult(api: string, type: FormDataType, formBody: FormBody, success: Function): Promise<void>;
|
|
16
|
+
del(api: string, data: RemoveBody): Promise<any>;
|
|
17
|
+
delResult(api: string, removeBody: RemoveBody, success: Function): Promise<void>;
|
|
18
|
+
info(api: string, data?: any): Promise<any>;
|
|
19
|
+
output(api: string, data?: SearchBody, config?: any): Promise<any>;
|
|
20
|
+
outputOctetStream(api: string, data: SearchBody | undefined, name: string): Promise<any>;
|
|
21
|
+
search(api: string, resource: string, data?: SearchBody): Promise<any>;
|
|
22
|
+
fetch(api: string, resource: string, data: any, config: any): Promise<any>;
|
|
23
|
+
}
|
|
24
|
+
declare const resourceService: ResourceService;
|
|
25
|
+
export default resourceService;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 生成一些通用的function
|
|
3
|
+
*/
|
|
4
|
+
import { CheckAccessEle } from "@kordar-lib/base";
|
|
5
|
+
export declare const resourceAccessItems: (name: string) => Array<CheckAccessEle>;
|
|
6
|
+
export declare const removeEventFn: (ctx: any, content?: string) => ({ fn, params, success, error }: any) => void;
|
|
7
|
+
export declare const resourceRemoveEvent: (ctx: any, content?: string | undefined) => (removeBody: any) => void;
|
|
8
|
+
export declare function convertToText(obj: any): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FormOption, TableContext } from "@kordar-lib/base";
|
|
2
|
+
export declare function permissionTree(data: any[]): any;
|
|
3
|
+
export declare function queryPermissionTress(treeData: Array<any>, set: Set<string>, targetNodes: Array<any>): number;
|
|
4
|
+
export declare function roleTree(data: any[]): any;
|
|
5
|
+
export declare const ctxPageValue: (ctx: TableContext | undefined, key: string) => any;
|
|
6
|
+
export declare const ctxPageValueOptions: (ctx: TableContext | undefined, key: string) => Array<FormOption>;
|
|
7
|
+
export declare const fetchConfigOptions: (fetchConfig: any, key: string) => Array<any>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FormDataType, TableContext, TableContextState } from "@kordar-lib/base";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { RefDialog } from "@kordar/easyui";
|
|
4
|
+
export interface CtxProps {
|
|
5
|
+
ctx: TableContext;
|
|
6
|
+
ctxState: TableContextState;
|
|
7
|
+
}
|
|
8
|
+
export interface TableProps extends CtxProps {
|
|
9
|
+
pageConfig?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
fetchConfig?: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface TablePanelProps extends TableProps {
|
|
17
|
+
searchPanel?: React.ReactNode;
|
|
18
|
+
toolbar?: any;
|
|
19
|
+
}
|
|
20
|
+
export interface SearchProps extends CtxProps {
|
|
21
|
+
}
|
|
22
|
+
export interface FormDataProps extends CtxProps {
|
|
23
|
+
record?: any;
|
|
24
|
+
type?: FormDataType;
|
|
25
|
+
pageConfig?: {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
};
|
|
28
|
+
fetchConfig?: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface DocHocProps {
|
|
33
|
+
name: string;
|
|
34
|
+
fetchConfig?: Function;
|
|
35
|
+
}
|
|
36
|
+
export interface PageProps {
|
|
37
|
+
pageConfig: {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
};
|
|
40
|
+
fetchConfig: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
fetchVersion?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface PageCtxProps {
|
|
46
|
+
version?: any;
|
|
47
|
+
ctx?: TableContext;
|
|
48
|
+
ctxState?: TableContextState;
|
|
49
|
+
pageConfig: {
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
};
|
|
52
|
+
fetchConfig: {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
};
|
|
55
|
+
refs?: {
|
|
56
|
+
[key: string]: RefDialog;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 定义传递到table的数据
|
|
61
|
+
*/
|
|
62
|
+
export interface PagePanelProps {
|
|
63
|
+
SearchPanel?: React.ReactNode;
|
|
64
|
+
toolbar?: any;
|
|
65
|
+
pageVersion?: number;
|
|
66
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { renderTooltip } from "@kordar/easyui";
|
|
2
|
+
export declare const renderType: () => import("react").JSX.Element;
|
|
3
|
+
export declare const renderDateTime02: ({ value }: any) => any;
|
|
4
|
+
export declare const renderText: (text: string, icon?: string) => import("react").JSX.Element;
|
|
5
|
+
export declare const renderFetchConfigValue: (fetchConfig: any, key: string, value: any, defaultValue?: any) => any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface IconItem {
|
|
2
|
+
name: string;
|
|
3
|
+
className: string;
|
|
4
|
+
}
|
|
5
|
+
/** 注册额外图标(在入口文件调用扩展) */
|
|
6
|
+
export declare function registerIcons(items: IconItem[]): void;
|
|
7
|
+
/** 完全替换图标列表 */
|
|
8
|
+
export declare function setIconList(items: IconItem[]): void;
|
|
9
|
+
/** 获取当前所有图标(className 补全 iconfont 前缀以正确渲染) */
|
|
10
|
+
export declare function parseIconList(): IconItem[];
|