ls-pro-common 3.0.13 → 3.0.15
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/CHANGELOG.md +746 -0
- package/es/components/404.d.ts +3 -0
- package/es/components/404.jpg +0 -0
- package/es/components/404.js +9 -0
- package/es/components/AreaCascader.d.ts +4 -0
- package/es/components/AreaCascader.js +76 -0
- package/es/components/AreaCascaderPanel.d.ts +5 -0
- package/es/components/AreaCascaderPanel.js +230 -0
- package/es/components/DescritionCard.d.ts +11 -0
- package/es/components/DescritionCard.js +79 -0
- package/es/components/DtlLayout.d.ts +44 -0
- package/es/components/DtlLayout.js +116 -0
- package/es/components/GroupTip.d.ts +10 -0
- package/es/components/GroupTip.js +31 -0
- package/es/components/IconBack.d.ts +3 -0
- package/es/components/IconBack.js +20 -0
- package/es/components/IconBell.d.ts +3 -0
- package/es/components/IconBell.js +22 -0
- package/es/components/IconQuestion.d.ts +3 -0
- package/es/components/IconQuestion.js +26 -0
- package/es/components/IconSearch.d.ts +3 -0
- package/es/components/IconSearch.js +22 -0
- package/es/components/IconSelector.d.ts +14 -0
- package/es/components/IconSelector.js +222 -0
- package/es/components/IconText.d.ts +3 -0
- package/es/components/IconText.js +30 -0
- package/es/components/ImageSelector.d.ts +31 -0
- package/es/components/ImageSelector.js +437 -0
- package/es/components/InputMultiLine.d.ts +46 -0
- package/es/components/InputMultiLine.js +139 -0
- package/es/components/InputTable.d.ts +106 -0
- package/es/components/InputTable.js +473 -0
- package/es/components/Loading.d.ts +8 -0
- package/es/components/Loading.js +20 -0
- package/es/components/Permission.d.ts +6 -0
- package/es/components/Permission.js +13 -0
- package/es/components/antd-custom.less +356 -0
- package/es/components/common.less +474 -0
- package/es/hooks/useDtl/index.d.ts +47 -0
- package/es/hooks/useDtl/index.js +949 -0
- package/es/hooks/useGetState.d.ts +1 -0
- package/es/hooks/useGetState.js +17 -0
- package/es/hooks/usePermission/index.d.ts +15 -0
- package/es/hooks/usePermission/index.js +58 -0
- package/es/hooks/useSingle/index.d.ts +54 -0
- package/es/hooks/useSingle/index.js +662 -0
- package/es/http/index.d.ts +53 -0
- package/es/http/index.js +309 -0
- package/es/index.d.ts +32 -0
- package/es/index.js +26 -0
- package/es/service/BaseService.d.ts +24 -0
- package/es/service/BaseService.js +214 -0
- package/es/typing.d.ts +53 -0
- package/es/typing.js +1 -0
- package/es/utils/index.d.ts +258 -0
- package/es/utils/index.js +682 -0
- package/lib/components/404.d.ts +3 -0
- package/lib/components/404.jpg +0 -0
- package/lib/components/404.js +17 -0
- package/lib/components/AreaCascader.d.ts +4 -0
- package/lib/components/AreaCascader.js +85 -0
- package/lib/components/AreaCascaderPanel.d.ts +5 -0
- package/lib/components/AreaCascaderPanel.js +239 -0
- package/lib/components/DescritionCard.d.ts +11 -0
- package/lib/components/DescritionCard.js +88 -0
- package/lib/components/DtlLayout.d.ts +44 -0
- package/lib/components/DtlLayout.js +125 -0
- package/lib/components/GroupTip.d.ts +10 -0
- package/lib/components/GroupTip.js +39 -0
- package/lib/components/IconBack.d.ts +3 -0
- package/lib/components/IconBack.js +28 -0
- package/lib/components/IconBell.d.ts +3 -0
- package/lib/components/IconBell.js +30 -0
- package/lib/components/IconQuestion.d.ts +3 -0
- package/lib/components/IconQuestion.js +34 -0
- package/lib/components/IconSearch.d.ts +3 -0
- package/lib/components/IconSearch.js +30 -0
- package/lib/components/IconSelector.d.ts +14 -0
- package/lib/components/IconSelector.js +230 -0
- package/lib/components/IconText.d.ts +3 -0
- package/lib/components/IconText.js +38 -0
- package/lib/components/ImageSelector.d.ts +31 -0
- package/lib/components/ImageSelector.js +445 -0
- package/lib/components/InputMultiLine.d.ts +46 -0
- package/lib/components/InputMultiLine.js +148 -0
- package/lib/components/InputTable.d.ts +106 -0
- package/lib/components/InputTable.js +482 -0
- package/lib/components/Loading.d.ts +8 -0
- package/lib/components/Loading.js +28 -0
- package/lib/components/Permission.d.ts +6 -0
- package/lib/components/Permission.js +21 -0
- package/lib/components/antd-custom.less +356 -0
- package/lib/components/common.less +474 -0
- package/lib/hooks/useDtl/index.d.ts +47 -0
- package/lib/hooks/useDtl/index.js +957 -0
- package/lib/hooks/useGetState.d.ts +1 -0
- package/lib/hooks/useGetState.js +24 -0
- package/lib/hooks/usePermission/index.d.ts +15 -0
- package/lib/hooks/usePermission/index.js +65 -0
- package/lib/hooks/useSingle/index.d.ts +54 -0
- package/lib/hooks/useSingle/index.js +670 -0
- package/lib/http/index.d.ts +53 -0
- package/lib/http/index.js +323 -0
- package/lib/index.d.ts +32 -0
- package/lib/service/BaseService.d.ts +24 -0
- package/lib/service/BaseService.js +222 -0
- package/lib/typing.d.ts +53 -0
- package/lib/typing.js +5 -0
- package/lib/utils/index.d.ts +258 -0
- package/lib/utils/index.js +779 -0
- package/package.json +5 -13
package/es/typing.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** @name 接口返回值 */
|
|
2
|
+
export declare type ApiResponse = Record<string, any> & {
|
|
3
|
+
flag?: {
|
|
4
|
+
retCode?: string;
|
|
5
|
+
retMsg?: string;
|
|
6
|
+
retDetail?: string;
|
|
7
|
+
faultCode?: string;
|
|
8
|
+
requestId?: string;
|
|
9
|
+
};
|
|
10
|
+
rows?: [];
|
|
11
|
+
data?: any;
|
|
12
|
+
total?: 0;
|
|
13
|
+
id?: string;
|
|
14
|
+
billNo?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type TableToolbar = {
|
|
17
|
+
add?: boolean;
|
|
18
|
+
edit?: boolean;
|
|
19
|
+
remove?: boolean;
|
|
20
|
+
export?: boolean;
|
|
21
|
+
import?: boolean;
|
|
22
|
+
audit?: boolean;
|
|
23
|
+
config?: boolean;
|
|
24
|
+
print?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** 基础模块接口类型 */
|
|
27
|
+
export declare type BaseApiType = {
|
|
28
|
+
/**加载数据api */
|
|
29
|
+
load?: string;
|
|
30
|
+
/**新增数据api */
|
|
31
|
+
add?: string;
|
|
32
|
+
/**更改数据api,如果跟新增接口一样,可不指定 */
|
|
33
|
+
edit?: string;
|
|
34
|
+
/**删除数据api */
|
|
35
|
+
delete?: string;
|
|
36
|
+
/**主从一起保存方法,新增,现改,删除共用一个接口 */
|
|
37
|
+
mstDtl?: string;
|
|
38
|
+
/**导入数据api */
|
|
39
|
+
import?: string;
|
|
40
|
+
/**导出数据api,如果跟加载数据api一致,可不指定 */
|
|
41
|
+
export?: string;
|
|
42
|
+
/** 审核接口 */
|
|
43
|
+
audit?: string;
|
|
44
|
+
};
|
|
45
|
+
/**请求后端接口方法 */
|
|
46
|
+
export declare type MethodType = {
|
|
47
|
+
/**加载数据对应的方法,默认为get, 如果请求参数太长时,后端可能会改为post */
|
|
48
|
+
get: 'get' | 'post';
|
|
49
|
+
/** 更改数据的请求方法,默认为 put, 也可以是post,根据后端接口而定 */
|
|
50
|
+
edit: 'put' | 'post';
|
|
51
|
+
/** 删除数据的请求方法,默认为delete, 也可以是post,根据后端接口而定 */
|
|
52
|
+
delete: 'delete' | 'post';
|
|
53
|
+
};
|
package/es/typing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { ModalFuncProps } from 'antd';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export { throttle, debounce } from 'lodash';
|
|
5
|
+
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table';
|
|
6
|
+
/**
|
|
7
|
+
* 设置文档title
|
|
8
|
+
* @param {*} title
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const setTitle: (title: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* 日期格式化
|
|
14
|
+
* @param dt 日期
|
|
15
|
+
* @param showTime 是否显示时间 默认true
|
|
16
|
+
* @returns YYYY-MM-DD hh:mm:ss
|
|
17
|
+
*/
|
|
18
|
+
export declare const formatDate: (dt: Date | null | undefined, showTime?: boolean | undefined) => string;
|
|
19
|
+
/**
|
|
20
|
+
* 返回当前日期
|
|
21
|
+
* @returns YYYY-MM-DD
|
|
22
|
+
*/
|
|
23
|
+
export declare const today: () => string;
|
|
24
|
+
/**
|
|
25
|
+
* 返回当前日期时间
|
|
26
|
+
* @returns YYYY-MM-DD hh:mm:ss
|
|
27
|
+
*/
|
|
28
|
+
export declare const now: () => string;
|
|
29
|
+
/**
|
|
30
|
+
* 时间加减
|
|
31
|
+
* @param dt 原始时间,传 null 为当前时间
|
|
32
|
+
* @param addDay 添加添数,可为负数
|
|
33
|
+
* @param addMonth 添加月数,可为负数
|
|
34
|
+
* @param addYear 添加年数,可以负责
|
|
35
|
+
* @returns YYYY-MM-DD hh:mm:ss
|
|
36
|
+
*/
|
|
37
|
+
export declare const dateAdd: (dt: Date | null, addDay: number, addMonth?: number, addYear?: number) => string;
|
|
38
|
+
/**
|
|
39
|
+
* 当前时间加减
|
|
40
|
+
* @param addDay 添加添数,可为负数
|
|
41
|
+
* @param addMonth 添加月数,可为负数
|
|
42
|
+
* @param addYear 添加年数,可以负责
|
|
43
|
+
* @returns YYYY-MM-DD hh:mm:ss
|
|
44
|
+
*/
|
|
45
|
+
export declare const nowAdd: (addDay: number, addMonth?: number, addYear?: number) => string;
|
|
46
|
+
/**
|
|
47
|
+
* 当前日期加减
|
|
48
|
+
* @param addDay 添加添数,可为负数
|
|
49
|
+
* @param addMonth 添加月数,可为负数
|
|
50
|
+
* @param addYear 添加年数,可以负责
|
|
51
|
+
* @returns YYYY-MM-DD
|
|
52
|
+
*/
|
|
53
|
+
export declare const todayAdd: (addDay: number, addMonth?: number, addYear?: number) => string;
|
|
54
|
+
/**
|
|
55
|
+
* 千位符格式化数值
|
|
56
|
+
* @param num 数值
|
|
57
|
+
* @param dec 小数位数,默认为2位小数
|
|
58
|
+
* @returns xx,xxx.xx
|
|
59
|
+
*/
|
|
60
|
+
export declare const formatMoney: (num: number | string, dec?: number) => string;
|
|
61
|
+
/**
|
|
62
|
+
* 获取Cookie
|
|
63
|
+
* @param {String} name cookie名
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export declare const getCookie: (name: string) => string | null;
|
|
67
|
+
/**
|
|
68
|
+
* 设置Cookie
|
|
69
|
+
* @param {*} key Cookie名称
|
|
70
|
+
* @param {*} value Cookie 值
|
|
71
|
+
* @param { Number } day 有效天数 默认1天,
|
|
72
|
+
*/
|
|
73
|
+
export declare const setCookie: (key: string, value: string | number, day?: number, sameSite?: boolean) => void;
|
|
74
|
+
/**
|
|
75
|
+
* 判断是否登录
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
export declare const isLogin: () => boolean;
|
|
79
|
+
export declare const getFullScreenElement: () => any;
|
|
80
|
+
/**
|
|
81
|
+
* 设置本地缓存
|
|
82
|
+
* @param { String } key 关键字
|
|
83
|
+
* @param { Object } data 值
|
|
84
|
+
* @param { Boolean } session 保存到 sessionStorage 还是 localStorage,默认 localStorage
|
|
85
|
+
*/
|
|
86
|
+
export declare const setCache: (key: string, data: any, session?: boolean) => void;
|
|
87
|
+
/**
|
|
88
|
+
* 读取本地缓存
|
|
89
|
+
* @param { String } key 关键字
|
|
90
|
+
* @param { boolean } session 从 sessionStorage 取数还是从 localStorage 中取数 默认从 localStorage
|
|
91
|
+
* @returns 关键字对应的值
|
|
92
|
+
*/
|
|
93
|
+
export declare const getCache: (key: string, session?: boolean) => string | null;
|
|
94
|
+
/**
|
|
95
|
+
* 读取本地缓存,优先从sessionStorage 取,取不到时再从 localStorage取
|
|
96
|
+
* @param key
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
export declare const getCacheSessionFirst: (key: string) => string | null;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @param key 关键字,不传清除所有
|
|
103
|
+
* @param session 是否session storage , 默认 localStorage
|
|
104
|
+
*/
|
|
105
|
+
export declare const clearCache: (key?: string | undefined, session?: boolean) => void;
|
|
106
|
+
/** @name 显示错误 */
|
|
107
|
+
export declare const showError: (text: string, duration?: number) => void;
|
|
108
|
+
/** @name 显示警示 */
|
|
109
|
+
export declare const showWarn: (text: string, duration?: number) => void;
|
|
110
|
+
/** @name 显示成功 */
|
|
111
|
+
export declare const showSuccess: (text: string, duration?: number) => void;
|
|
112
|
+
/**
|
|
113
|
+
* 弹框提示
|
|
114
|
+
* @param text 提示信息
|
|
115
|
+
* @param title 标题,默认 系统提示
|
|
116
|
+
* @param type 类型
|
|
117
|
+
* @param opts 附加参数
|
|
118
|
+
* @returns Promise<Boolean>
|
|
119
|
+
*/
|
|
120
|
+
export declare const showAlert: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn', opts?: ModalFuncProps) => Promise<unknown>;
|
|
121
|
+
export declare const httpError: (retMsg?: string | undefined, retCode?: string | undefined, faultCode?: string | undefined, opts?: ModalFuncProps) => Promise<unknown>;
|
|
122
|
+
export declare const exitAlert: () => void;
|
|
123
|
+
/** @name 显示确认 */
|
|
124
|
+
export declare const showConfirm: (text: string, title?: string) => Promise<unknown>;
|
|
125
|
+
/**
|
|
126
|
+
* token过期重新登录
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
129
|
+
export declare const reLogin: () => void;
|
|
130
|
+
/**
|
|
131
|
+
* 日期组选择转换
|
|
132
|
+
* @param values 选择的值
|
|
133
|
+
* @param startField 第一个字段
|
|
134
|
+
* @param endField 第二个字段
|
|
135
|
+
* @param endSuffix
|
|
136
|
+
* @returns
|
|
137
|
+
*/
|
|
138
|
+
export declare const rangeToSearch: (values: any, startField: string, endField: string, endSuffix?: string, startSuffex?: string) => any;
|
|
139
|
+
/** @name 状态列表 */
|
|
140
|
+
export declare const statusList: {
|
|
141
|
+
value: number;
|
|
142
|
+
text: string;
|
|
143
|
+
label: string;
|
|
144
|
+
}[];
|
|
145
|
+
/** @name 是否列表 */
|
|
146
|
+
export declare const yesnoList: {
|
|
147
|
+
value: number;
|
|
148
|
+
text: string;
|
|
149
|
+
label: string;
|
|
150
|
+
}[];
|
|
151
|
+
/**
|
|
152
|
+
* 遍历树
|
|
153
|
+
* @param list 树对象
|
|
154
|
+
* @param fn 回调函数
|
|
155
|
+
* @param children 树属性字段
|
|
156
|
+
*/
|
|
157
|
+
export declare const treeEach: (list: any[], fn: (item: any, index: any, list: any[]) => void, children?: string) => void;
|
|
158
|
+
/**
|
|
159
|
+
* 查询数
|
|
160
|
+
* @param list 树对象
|
|
161
|
+
* @param key 查询属性
|
|
162
|
+
* @param val 查询值
|
|
163
|
+
* @param children 树属性字段
|
|
164
|
+
* @returns 返回符合条件的第一条对象
|
|
165
|
+
*/
|
|
166
|
+
export declare const treeFind: (list: any[], key: string, val: any, children?: string) => any;
|
|
167
|
+
/**
|
|
168
|
+
* 处理普通的尺码横排
|
|
169
|
+
* @param orgSizeHeader 后端返回的原始尺码组表头
|
|
170
|
+
* @param typeWidth 尺码组宽 sizeTypeNo,默认120
|
|
171
|
+
* @param sizeWidth 尺码宽f1~f100, 默认100
|
|
172
|
+
* @returns 返回已处理好的表头[{dataIndex:sizeTypeNo,title:'国标码',width:120,children[...]},{dataIndex:'f1',...}...]
|
|
173
|
+
*/
|
|
174
|
+
export declare const handleSizeCols: (orgSizeHeader: any[], typeWidth?: number, sizeWidth?: number) => any[];
|
|
175
|
+
/**
|
|
176
|
+
* 绑定事件
|
|
177
|
+
* @param eventName 事件名
|
|
178
|
+
* @param fn 调用函数
|
|
179
|
+
* @param el 源对象,默认为window
|
|
180
|
+
*/
|
|
181
|
+
export declare const on: (eventName: string, fn: Function, el: any | undefined) => void;
|
|
182
|
+
/**
|
|
183
|
+
* 解绑事件
|
|
184
|
+
* @param eventName 事件名
|
|
185
|
+
* @param fn 调用函数
|
|
186
|
+
* @param el 源对象,默认为window
|
|
187
|
+
*/
|
|
188
|
+
export declare const off: (eventName: string, fn: Function, el: any | undefined) => void;
|
|
189
|
+
/**
|
|
190
|
+
* 打印预览
|
|
191
|
+
* @param templateNo 打印模板编码
|
|
192
|
+
* @param reqUrl 业务请求api
|
|
193
|
+
* @param bodyParam Post传参数
|
|
194
|
+
* @param param get传参数
|
|
195
|
+
* @param method 请求方式,默认post
|
|
196
|
+
* @returns
|
|
197
|
+
*/
|
|
198
|
+
export declare const printView: (templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET') => any;
|
|
199
|
+
/**
|
|
200
|
+
* 直接打印
|
|
201
|
+
* @param taskName 打印任务名
|
|
202
|
+
* @param templateNo 打印模板
|
|
203
|
+
* @param reqUrl 业务请求api
|
|
204
|
+
* @param bodyParam Post传参数
|
|
205
|
+
* @param param get传参数
|
|
206
|
+
* @param method 请求方式,默认post
|
|
207
|
+
* @returns
|
|
208
|
+
*/
|
|
209
|
+
export declare const printAsync: (taskName: string, templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET') => Promise<any>;
|
|
210
|
+
export declare const isDev: boolean;
|
|
211
|
+
export declare type UserType = {
|
|
212
|
+
id?: string;
|
|
213
|
+
userId?: string;
|
|
214
|
+
userName?: string;
|
|
215
|
+
loginName?: string;
|
|
216
|
+
companyId?: string;
|
|
217
|
+
companyCode?: string;
|
|
218
|
+
companyName?: string;
|
|
219
|
+
email?: string;
|
|
220
|
+
employeeAttr?: string;
|
|
221
|
+
expireTime?: string;
|
|
222
|
+
icon?: string;
|
|
223
|
+
idCard?: string;
|
|
224
|
+
ifAdmin?: number | string;
|
|
225
|
+
orgId?: string;
|
|
226
|
+
orgParentIds?: string;
|
|
227
|
+
phoneNumber?: string;
|
|
228
|
+
remarks?: string;
|
|
229
|
+
};
|
|
230
|
+
/** @name 用户信息 */
|
|
231
|
+
export declare const getUserInfo: () => UserType | null;
|
|
232
|
+
/** @name 用户名 */
|
|
233
|
+
export declare const getUserName: () => string | undefined;
|
|
234
|
+
/** @name 登录名 */
|
|
235
|
+
export declare const getLoginName: () => string | undefined;
|
|
236
|
+
/** @name 公司Id */
|
|
237
|
+
export declare const getCompanyId: () => string | undefined;
|
|
238
|
+
/** @name 微前端原生路径 */
|
|
239
|
+
export declare const appPath: (path?: string) => any;
|
|
240
|
+
/**
|
|
241
|
+
* 深度复制对象
|
|
242
|
+
* @param obj
|
|
243
|
+
* @returns
|
|
244
|
+
*/
|
|
245
|
+
export declare const deepClone: (obj: any) => any;
|
|
246
|
+
/**
|
|
247
|
+
* 在主工程中打开模块
|
|
248
|
+
* @param option {path:模块路由,需要加工程编码, resourceId: 资源Id,两者传一个即可,data:参数}
|
|
249
|
+
*/
|
|
250
|
+
export declare const openPageInMain: (option: {
|
|
251
|
+
path?: string;
|
|
252
|
+
resourceId?: string;
|
|
253
|
+
data?: any;
|
|
254
|
+
ifRefreshTarget?: boolean;
|
|
255
|
+
}) => void;
|
|
256
|
+
export declare const showLoading: (text?: string) => void;
|
|
257
|
+
export declare const exitLoading: () => void;
|
|
258
|
+
export declare const handleTheme: () => void;
|