ls-pro-common 3.0.11 → 3.0.13

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.
Files changed (113) hide show
  1. package/README.md +22 -22
  2. package/dist/common.css +122 -21
  3. package/dist/common.js +1 -1
  4. package/dist/common.min.css +122 -21
  5. package/dist/common.min.js +1 -1
  6. package/lib/index.js +8 -1
  7. package/package.json +48 -48
  8. package/CHANGELOG.md +0 -746
  9. package/es/components/404.d.ts +0 -3
  10. package/es/components/404.jpg +0 -0
  11. package/es/components/404.js +0 -9
  12. package/es/components/AreaCascader.d.ts +0 -4
  13. package/es/components/AreaCascader.js +0 -76
  14. package/es/components/AreaCascaderPanel.d.ts +0 -5
  15. package/es/components/AreaCascaderPanel.js +0 -230
  16. package/es/components/DescritionCard.d.ts +0 -11
  17. package/es/components/DescritionCard.js +0 -79
  18. package/es/components/DtlLayout.d.ts +0 -44
  19. package/es/components/DtlLayout.js +0 -115
  20. package/es/components/GroupTip.d.ts +0 -10
  21. package/es/components/GroupTip.js +0 -31
  22. package/es/components/IconBack.d.ts +0 -3
  23. package/es/components/IconBack.js +0 -20
  24. package/es/components/IconBell.d.ts +0 -3
  25. package/es/components/IconBell.js +0 -22
  26. package/es/components/IconQuestion.d.ts +0 -3
  27. package/es/components/IconQuestion.js +0 -26
  28. package/es/components/IconSearch.d.ts +0 -3
  29. package/es/components/IconSearch.js +0 -22
  30. package/es/components/IconSelector.d.ts +0 -14
  31. package/es/components/IconSelector.js +0 -222
  32. package/es/components/IconText.d.ts +0 -3
  33. package/es/components/IconText.js +0 -30
  34. package/es/components/ImageSelector.d.ts +0 -31
  35. package/es/components/ImageSelector.js +0 -437
  36. package/es/components/InputMultiLine.d.ts +0 -46
  37. package/es/components/InputMultiLine.js +0 -139
  38. package/es/components/InputTable.d.ts +0 -106
  39. package/es/components/InputTable.js +0 -477
  40. package/es/components/Loading.d.ts +0 -8
  41. package/es/components/Loading.js +0 -20
  42. package/es/components/Permission.d.ts +0 -6
  43. package/es/components/Permission.js +0 -13
  44. package/es/components/antd-custom.less +0 -262
  45. package/es/components/common.less +0 -468
  46. package/es/hooks/useDtl/index.d.ts +0 -48
  47. package/es/hooks/useDtl/index.js +0 -949
  48. package/es/hooks/usePermission/index.d.ts +0 -15
  49. package/es/hooks/usePermission/index.js +0 -58
  50. package/es/hooks/useSingle/index.d.ts +0 -55
  51. package/es/hooks/useSingle/index.js +0 -662
  52. package/es/http/index.d.ts +0 -53
  53. package/es/http/index.js +0 -301
  54. package/es/index.d.ts +0 -31
  55. package/es/index.js +0 -25
  56. package/es/service/BaseService.d.ts +0 -24
  57. package/es/service/BaseService.js +0 -214
  58. package/es/typing.d.ts +0 -53
  59. package/es/typing.js +0 -1
  60. package/es/utils/index.d.ts +0 -252
  61. package/es/utils/index.js +0 -671
  62. package/lib/components/404.d.ts +0 -3
  63. package/lib/components/404.jpg +0 -0
  64. package/lib/components/404.js +0 -17
  65. package/lib/components/AreaCascader.d.ts +0 -4
  66. package/lib/components/AreaCascader.js +0 -85
  67. package/lib/components/AreaCascaderPanel.d.ts +0 -5
  68. package/lib/components/AreaCascaderPanel.js +0 -239
  69. package/lib/components/DescritionCard.d.ts +0 -11
  70. package/lib/components/DescritionCard.js +0 -88
  71. package/lib/components/DtlLayout.d.ts +0 -44
  72. package/lib/components/DtlLayout.js +0 -124
  73. package/lib/components/GroupTip.d.ts +0 -10
  74. package/lib/components/GroupTip.js +0 -39
  75. package/lib/components/IconBack.d.ts +0 -3
  76. package/lib/components/IconBack.js +0 -28
  77. package/lib/components/IconBell.d.ts +0 -3
  78. package/lib/components/IconBell.js +0 -30
  79. package/lib/components/IconQuestion.d.ts +0 -3
  80. package/lib/components/IconQuestion.js +0 -34
  81. package/lib/components/IconSearch.d.ts +0 -3
  82. package/lib/components/IconSearch.js +0 -30
  83. package/lib/components/IconSelector.d.ts +0 -14
  84. package/lib/components/IconSelector.js +0 -230
  85. package/lib/components/IconText.d.ts +0 -3
  86. package/lib/components/IconText.js +0 -38
  87. package/lib/components/ImageSelector.d.ts +0 -31
  88. package/lib/components/ImageSelector.js +0 -445
  89. package/lib/components/InputMultiLine.d.ts +0 -46
  90. package/lib/components/InputMultiLine.js +0 -148
  91. package/lib/components/InputTable.d.ts +0 -106
  92. package/lib/components/InputTable.js +0 -486
  93. package/lib/components/Loading.d.ts +0 -8
  94. package/lib/components/Loading.js +0 -28
  95. package/lib/components/Permission.d.ts +0 -6
  96. package/lib/components/Permission.js +0 -21
  97. package/lib/components/antd-custom.less +0 -262
  98. package/lib/components/common.less +0 -468
  99. package/lib/hooks/useDtl/index.d.ts +0 -48
  100. package/lib/hooks/useDtl/index.js +0 -957
  101. package/lib/hooks/usePermission/index.d.ts +0 -15
  102. package/lib/hooks/usePermission/index.js +0 -65
  103. package/lib/hooks/useSingle/index.d.ts +0 -55
  104. package/lib/hooks/useSingle/index.js +0 -670
  105. package/lib/http/index.d.ts +0 -53
  106. package/lib/http/index.js +0 -315
  107. package/lib/index.d.ts +0 -31
  108. package/lib/service/BaseService.d.ts +0 -24
  109. package/lib/service/BaseService.js +0 -222
  110. package/lib/typing.d.ts +0 -53
  111. package/lib/typing.js +0 -5
  112. package/lib/utils/index.d.ts +0 -252
  113. package/lib/utils/index.js +0 -767
package/es/typing.d.ts DELETED
@@ -1,53 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,252 +0,0 @@
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
- *
96
- * @param key 关键字,不传清除所有
97
- * @param session 是否session storage , 默认 localStorage
98
- */
99
- export declare const clearCache: (key?: string | undefined, session?: boolean) => void;
100
- /** @name 显示错误 */
101
- export declare const showError: (text: string, duration?: number) => void;
102
- /** @name 显示警示 */
103
- export declare const showWarn: (text: string, duration?: number) => void;
104
- /** @name 显示成功 */
105
- export declare const showSuccess: (text: string, duration?: number) => void;
106
- /**
107
- * 弹框提示
108
- * @param text 提示信息
109
- * @param title 标题,默认 系统提示
110
- * @param type 类型
111
- * @param opts 附加参数
112
- * @returns Promise<Boolean>
113
- */
114
- export declare const showAlert: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn', opts?: ModalFuncProps) => Promise<unknown>;
115
- export declare const httpError: (retMsg?: string | undefined, retCode?: string | undefined, faultCode?: string | undefined, opts?: ModalFuncProps) => Promise<unknown>;
116
- export declare const exitAlert: () => void;
117
- /** @name 显示确认 */
118
- export declare const showConfirm: (text: string, title?: string) => Promise<unknown>;
119
- /**
120
- * token过期重新登录
121
- * @returns
122
- */
123
- export declare const reLogin: () => void;
124
- /**
125
- * 日期组选择转换
126
- * @param values 选择的值
127
- * @param startField 第一个字段
128
- * @param endField 第二个字段
129
- * @param endSuffix
130
- * @returns
131
- */
132
- export declare const rangeToSearch: (values: any, startField: string, endField: string, endSuffix?: string, startSuffex?: string) => any;
133
- /** @name 状态列表 */
134
- export declare const statusList: {
135
- value: number;
136
- text: string;
137
- label: string;
138
- }[];
139
- /** @name 是否列表 */
140
- export declare const yesnoList: {
141
- value: number;
142
- text: string;
143
- label: string;
144
- }[];
145
- /**
146
- * 遍历树
147
- * @param list 树对象
148
- * @param fn 回调函数
149
- * @param children 树属性字段
150
- */
151
- export declare const treeEach: (list: any[], fn: (item: any, index: any, list: any[]) => void, children?: string) => void;
152
- /**
153
- * 查询数
154
- * @param list 树对象
155
- * @param key 查询属性
156
- * @param val 查询值
157
- * @param children 树属性字段
158
- * @returns 返回符合条件的第一条对象
159
- */
160
- export declare const treeFind: (list: any[], key: string, val: any, children?: string) => any;
161
- /**
162
- * 处理普通的尺码横排
163
- * @param orgSizeHeader 后端返回的原始尺码组表头
164
- * @param typeWidth 尺码组宽 sizeTypeNo,默认120
165
- * @param sizeWidth 尺码宽f1~f100, 默认100
166
- * @returns 返回已处理好的表头[{dataIndex:sizeTypeNo,title:'国标码',width:120,children[...]},{dataIndex:'f1',...}...]
167
- */
168
- export declare const handleSizeCols: (orgSizeHeader: any[], typeWidth?: number, sizeWidth?: number) => any[];
169
- /**
170
- * 绑定事件
171
- * @param eventName 事件名
172
- * @param fn 调用函数
173
- * @param el 源对象,默认为window
174
- */
175
- export declare const on: (eventName: string, fn: Function, el: any | undefined) => void;
176
- /**
177
- * 解绑事件
178
- * @param eventName 事件名
179
- * @param fn 调用函数
180
- * @param el 源对象,默认为window
181
- */
182
- export declare const off: (eventName: string, fn: Function, el: any | undefined) => void;
183
- /**
184
- * 打印预览
185
- * @param templateNo 打印模板编码
186
- * @param reqUrl 业务请求api
187
- * @param bodyParam Post传参数
188
- * @param param get传参数
189
- * @param method 请求方式,默认post
190
- * @returns
191
- */
192
- export declare const printView: (templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET') => any;
193
- /**
194
- * 直接打印
195
- * @param taskName 打印任务名
196
- * @param templateNo 打印模板
197
- * @param reqUrl 业务请求api
198
- * @param bodyParam Post传参数
199
- * @param param get传参数
200
- * @param method 请求方式,默认post
201
- * @returns
202
- */
203
- export declare const printAsync: (taskName: string, templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET') => Promise<any>;
204
- export declare const isDev: boolean;
205
- export declare type UserType = {
206
- id?: string;
207
- userId?: string;
208
- userName?: string;
209
- loginName?: string;
210
- companyId?: string;
211
- companyCode?: string;
212
- companyName?: string;
213
- email?: string;
214
- employeeAttr?: string;
215
- expireTime?: string;
216
- icon?: string;
217
- idCard?: string;
218
- ifAdmin?: number | string;
219
- orgId?: string;
220
- orgParentIds?: string;
221
- phoneNumber?: string;
222
- remarks?: string;
223
- };
224
- /** @name 用户信息 */
225
- export declare const getUserInfo: () => UserType | null;
226
- /** @name 用户名 */
227
- export declare const getUserName: () => string | undefined;
228
- /** @name 登录名 */
229
- export declare const getLoginName: () => string | undefined;
230
- /** @name 公司Id */
231
- export declare const getCompanyId: () => string | undefined;
232
- /** @name 微前端原生路径 */
233
- export declare const appPath: (path?: string) => any;
234
- /**
235
- * 深度复制对象
236
- * @param obj
237
- * @returns
238
- */
239
- export declare const deepClone: (obj: any) => any;
240
- /**
241
- * 在主工程中打开模块
242
- * @param option {path:模块路由,需要加工程编码, resourceId: 资源Id,两者传一个即可,data:参数}
243
- */
244
- export declare const openPageInMain: (option: {
245
- path?: string;
246
- resourceId?: string;
247
- data?: any;
248
- ifRefreshTarget?: boolean;
249
- }) => void;
250
- export declare const showLoading: (text?: string) => void;
251
- export declare const exitLoading: () => void;
252
- export declare const handleTheme: () => void;