ls-pro-common 3.0.12 → 3.0.14

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 (116) hide show
  1. package/README.md +22 -22
  2. package/dist/common.css +121 -21
  3. package/dist/common.js +1 -1
  4. package/dist/common.min.css +121 -21
  5. package/dist/common.min.js +1 -1
  6. package/package.json +48 -48
  7. package/CHANGELOG.md +0 -746
  8. package/es/components/404.d.ts +0 -3
  9. package/es/components/404.jpg +0 -0
  10. package/es/components/404.js +0 -9
  11. package/es/components/AreaCascader.d.ts +0 -4
  12. package/es/components/AreaCascader.js +0 -76
  13. package/es/components/AreaCascaderPanel.d.ts +0 -5
  14. package/es/components/AreaCascaderPanel.js +0 -230
  15. package/es/components/DescritionCard.d.ts +0 -11
  16. package/es/components/DescritionCard.js +0 -79
  17. package/es/components/DtlLayout.d.ts +0 -44
  18. package/es/components/DtlLayout.js +0 -115
  19. package/es/components/GroupTip.d.ts +0 -10
  20. package/es/components/GroupTip.js +0 -31
  21. package/es/components/IconBack.d.ts +0 -3
  22. package/es/components/IconBack.js +0 -20
  23. package/es/components/IconBell.d.ts +0 -3
  24. package/es/components/IconBell.js +0 -22
  25. package/es/components/IconQuestion.d.ts +0 -3
  26. package/es/components/IconQuestion.js +0 -26
  27. package/es/components/IconSearch.d.ts +0 -3
  28. package/es/components/IconSearch.js +0 -22
  29. package/es/components/IconSelector.d.ts +0 -14
  30. package/es/components/IconSelector.js +0 -222
  31. package/es/components/IconText.d.ts +0 -3
  32. package/es/components/IconText.js +0 -30
  33. package/es/components/ImageSelector.d.ts +0 -31
  34. package/es/components/ImageSelector.js +0 -437
  35. package/es/components/InputMultiLine.d.ts +0 -46
  36. package/es/components/InputMultiLine.js +0 -139
  37. package/es/components/InputTable.d.ts +0 -106
  38. package/es/components/InputTable.js +0 -476
  39. package/es/components/Loading.d.ts +0 -8
  40. package/es/components/Loading.js +0 -20
  41. package/es/components/Permission.d.ts +0 -6
  42. package/es/components/Permission.js +0 -13
  43. package/es/components/antd-custom.less +0 -262
  44. package/es/components/common.less +0 -469
  45. package/es/hooks/useDtl/index.d.ts +0 -48
  46. package/es/hooks/useDtl/index.js +0 -949
  47. package/es/hooks/useGetState.d.ts +0 -1
  48. package/es/hooks/useGetState.js +0 -17
  49. package/es/hooks/usePermission/index.d.ts +0 -15
  50. package/es/hooks/usePermission/index.js +0 -58
  51. package/es/hooks/useSingle/index.d.ts +0 -55
  52. package/es/hooks/useSingle/index.js +0 -662
  53. package/es/http/index.d.ts +0 -53
  54. package/es/http/index.js +0 -305
  55. package/es/index.d.ts +0 -32
  56. package/es/index.js +0 -26
  57. package/es/service/BaseService.d.ts +0 -24
  58. package/es/service/BaseService.js +0 -214
  59. package/es/typing.d.ts +0 -53
  60. package/es/typing.js +0 -1
  61. package/es/utils/index.d.ts +0 -258
  62. package/es/utils/index.js +0 -679
  63. package/lib/components/404.d.ts +0 -3
  64. package/lib/components/404.jpg +0 -0
  65. package/lib/components/404.js +0 -17
  66. package/lib/components/AreaCascader.d.ts +0 -4
  67. package/lib/components/AreaCascader.js +0 -85
  68. package/lib/components/AreaCascaderPanel.d.ts +0 -5
  69. package/lib/components/AreaCascaderPanel.js +0 -239
  70. package/lib/components/DescritionCard.d.ts +0 -11
  71. package/lib/components/DescritionCard.js +0 -88
  72. package/lib/components/DtlLayout.d.ts +0 -44
  73. package/lib/components/DtlLayout.js +0 -124
  74. package/lib/components/GroupTip.d.ts +0 -10
  75. package/lib/components/GroupTip.js +0 -39
  76. package/lib/components/IconBack.d.ts +0 -3
  77. package/lib/components/IconBack.js +0 -28
  78. package/lib/components/IconBell.d.ts +0 -3
  79. package/lib/components/IconBell.js +0 -30
  80. package/lib/components/IconQuestion.d.ts +0 -3
  81. package/lib/components/IconQuestion.js +0 -34
  82. package/lib/components/IconSearch.d.ts +0 -3
  83. package/lib/components/IconSearch.js +0 -30
  84. package/lib/components/IconSelector.d.ts +0 -14
  85. package/lib/components/IconSelector.js +0 -230
  86. package/lib/components/IconText.d.ts +0 -3
  87. package/lib/components/IconText.js +0 -38
  88. package/lib/components/ImageSelector.d.ts +0 -31
  89. package/lib/components/ImageSelector.js +0 -445
  90. package/lib/components/InputMultiLine.d.ts +0 -46
  91. package/lib/components/InputMultiLine.js +0 -148
  92. package/lib/components/InputTable.d.ts +0 -106
  93. package/lib/components/InputTable.js +0 -485
  94. package/lib/components/Loading.d.ts +0 -8
  95. package/lib/components/Loading.js +0 -28
  96. package/lib/components/Permission.d.ts +0 -6
  97. package/lib/components/Permission.js +0 -21
  98. package/lib/components/antd-custom.less +0 -262
  99. package/lib/components/common.less +0 -469
  100. package/lib/hooks/useDtl/index.d.ts +0 -48
  101. package/lib/hooks/useDtl/index.js +0 -957
  102. package/lib/hooks/useGetState.d.ts +0 -1
  103. package/lib/hooks/useGetState.js +0 -24
  104. package/lib/hooks/usePermission/index.d.ts +0 -15
  105. package/lib/hooks/usePermission/index.js +0 -65
  106. package/lib/hooks/useSingle/index.d.ts +0 -55
  107. package/lib/hooks/useSingle/index.js +0 -670
  108. package/lib/http/index.d.ts +0 -53
  109. package/lib/http/index.js +0 -319
  110. package/lib/index.d.ts +0 -32
  111. package/lib/service/BaseService.d.ts +0 -24
  112. package/lib/service/BaseService.js +0 -222
  113. package/lib/typing.d.ts +0 -53
  114. package/lib/typing.js +0 -5
  115. package/lib/utils/index.d.ts +0 -258
  116. package/lib/utils/index.js +0 -776
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,258 +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
- * 读取本地缓存,优先从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;