@bit-sun/business-component 4.0.13-alpha.9 → 4.2.0-aiwei-alpha.1

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 (150) hide show
  1. package/.umirc.ts +21 -10
  2. package/dist/components/Business/AddSelectBusiness/index.d.ts +3 -4
  3. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -2
  4. package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +1 -2
  5. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
  6. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +1 -1
  7. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +2 -2
  8. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +1 -2
  9. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +1 -2
  10. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
  11. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +1 -2
  12. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +1 -2
  13. package/dist/components/Business/BsLayouts/index.d.ts +1 -1
  14. package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +5 -5
  15. package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -2
  16. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +11 -8
  17. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +14 -15
  18. package/dist/components/Business/CommodityEntry/index.d.ts +1 -2
  19. package/dist/components/Business/CommonAlert/index.d.ts +1 -2
  20. package/dist/components/Business/CommonGuideWrapper/index.d.ts +3 -3
  21. package/dist/components/Business/DetailPageWrapper/index.d.ts +11 -6
  22. package/dist/components/Business/HomePageWrapper/index.d.ts +1 -2
  23. package/dist/components/Business/ItemPropertySelector/index.d.ts +2 -0
  24. package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +1 -2
  25. package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +1 -2
  26. package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +1 -2
  27. package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +1 -2
  28. package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +1 -2
  29. package/dist/components/Business/ModalUtils/index.d.ts +8 -0
  30. package/dist/components/Business/PropertyModal/index.d.ts +1 -2
  31. package/dist/components/Business/PropertyModal/propertyGroup.d.ts +1 -1
  32. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  33. package/dist/components/Business/SearchSelect/utils.d.ts +4 -2
  34. package/dist/components/Business/StateFlow/index.d.ts +1 -2
  35. package/dist/components/Business/SystemLog/index.d.ts +78 -0
  36. package/dist/components/Business/TreeSearchSelect/index.d.ts +1 -1
  37. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +9 -8
  38. package/dist/components/Business/columnSettingTable/components/TableSumComponent.d.ts +1 -2
  39. package/dist/components/Business/columnSettingTable/index.d.ts +21 -4
  40. package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +22 -5
  41. package/dist/components/Business/columnSettingTable/utils.d.ts +1 -2
  42. package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
  43. package/dist/components/Common/ParagraphCopier/index.d.ts +1 -1
  44. package/dist/components/Common/Section/index.d.ts +1 -1
  45. package/dist/components/Functional/AddSelect/index.d.ts +1 -2
  46. package/dist/components/Functional/AuthButton/index.d.ts +1 -2
  47. package/dist/components/Functional/DataImport/index.d.ts +3 -3
  48. package/dist/components/Functional/DataValidation/index.d.ts +15 -5
  49. package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -2
  50. package/dist/components/Functional/QueryMutipleInput/index.d.ts +3 -3
  51. package/dist/components/Functional/QueryMutipleSelect/index.d.ts +1 -2
  52. package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
  53. package/dist/components/Functional/SearchSelect/utils.d.ts +4 -4
  54. package/dist/components/Functional/TreeSearchSelect/index.d.ts +1 -2
  55. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +1 -1
  56. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +1 -2
  57. package/dist/components/Solution/RuleComponent/Formula.d.ts +1 -2
  58. package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +1 -2
  59. package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +1 -2
  60. package/dist/components/Solution/RuleSetter/RuleInstance.d.ts +1 -2
  61. package/dist/components/Solution/RuleSetter/baseRule.d.ts +1 -1
  62. package/dist/components/Solution/RuleSetter/index.d.ts +1 -1
  63. package/dist/index.d.ts +2 -0
  64. package/dist/index.esm.js +4238 -2124
  65. package/dist/index.js +4247 -2122
  66. package/dist/plugin/TableColumnSetting/index.d.ts +6 -5
  67. package/dist/utils/RequestCacheManager.d.ts +82 -0
  68. package/dist/utils/TableUtils.d.ts +18 -19
  69. package/dist/utils/cachedRequest.d.ts +76 -0
  70. package/dist/utils/index.d.ts +1 -0
  71. package/dist/utils/utils.d.ts +41 -0
  72. package/package.json +16 -14
  73. package/src/assets/btn-cancel.svg +3 -0
  74. package/src/assets/btn-copy.svg +3 -0
  75. package/src/assets/btn-delete.svg +2 -29
  76. package/src/assets/btn-edit.svg +2 -19
  77. package/src/assets/btn-hangUp.svg +3 -0
  78. package/src/assets/btn-print.svg +3 -0
  79. package/src/assets/btn-refresh.svg +3 -0
  80. package/src/assets/btn-unhook.svg +3 -0
  81. package/src/components/Business/AddSelectBusiness/index.md +8 -2
  82. package/src/components/Business/AddSelectBusiness/index.tsx +4 -1
  83. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +1 -1
  84. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +1 -1
  85. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +1 -1
  86. package/src/components/Business/BsLayouts/Components/RightContent/home.less +1 -1
  87. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +2 -2
  88. package/src/components/Business/BsLayouts/service.ts +1 -1
  89. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +6 -5
  90. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +0 -4
  91. package/src/components/Business/BsSulaQueryTable/index.less +5 -3
  92. package/src/components/Business/BsSulaQueryTable/index.md +45 -32
  93. package/src/components/Business/BsSulaQueryTable/index.tsx +154 -76
  94. package/src/components/Business/BsSulaQueryTable/setting.tsx +47 -11
  95. package/src/components/Business/BsSulaQueryTable/utils.less +1 -1
  96. package/src/components/Business/BsSulaQueryTable/utils.tsx +15 -12
  97. package/src/components/Business/CommodityEntry/index.md +1 -1
  98. package/src/components/Business/CommodityEntry/index.tsx +11 -9
  99. package/src/components/Business/DetailPageWrapper/index.less +1 -1
  100. package/src/components/Business/DetailPageWrapper/index.tsx +24 -5
  101. package/src/components/Business/DetailPageWrapper/utils.tsx +7 -2
  102. package/src/components/Business/HomePageWrapper/index.less +1 -1
  103. package/src/components/Business/ItemPropertySelector/index.tsx +88 -0
  104. package/src/components/Business/JsonQueryTable/function.ts +1 -1
  105. package/src/components/Business/JsonQueryTable/index.tsx +1 -1
  106. package/src/components/Business/ModalUtils/index.tsx +45 -0
  107. package/src/components/Business/PropertyModal/index.tsx +1 -1
  108. package/src/components/Business/SearchSelect/BusinessUtils.tsx +625 -76
  109. package/src/components/Business/SearchSelect/index.md +4 -4
  110. package/src/components/Business/SearchSelect/utils.ts +27 -5
  111. package/src/components/Business/SystemLog/index.md +37 -0
  112. package/src/components/Business/SystemLog/index.tsx +87 -0
  113. package/src/components/Business/columnSettingTable/columnSetting.tsx +28 -12
  114. package/src/components/Business/columnSettingTable/index.less +5 -3
  115. package/src/components/Business/columnSettingTable/index.md +200 -136
  116. package/src/components/Business/columnSettingTable/index.tsx +168 -39
  117. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +188 -56
  118. package/src/components/Functional/AddSelect/helps.ts +1 -1
  119. package/src/components/Functional/AddSelect/index.tsx +132 -13
  120. package/src/components/Functional/BillEntry/index.less +3 -0
  121. package/src/components/Functional/BillEntry/index.tsx +1 -1
  122. package/src/components/Functional/DataImport/index.tsx +1 -1
  123. package/src/components/Functional/DataValidation/index.md +1 -0
  124. package/src/components/Functional/DataValidation/index.tsx +161 -27
  125. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +1 -1
  126. package/src/components/Functional/QueryMutipleInput/index.tsx +12 -3
  127. package/src/components/Functional/QueryMutipleSelect/index.tsx +3 -2
  128. package/src/components/Functional/SearchSelect/index.less +4 -0
  129. package/src/components/Functional/SearchSelect/index.tsx +68 -24
  130. package/src/components/Functional/SearchSelect/utils.tsx +17 -11
  131. package/src/components/Functional/TreeSearchSelect/index.tsx +3 -2
  132. package/src/components/Solution/RuleComponent/InnerSelect.tsx +1 -0
  133. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +11 -2
  134. package/src/components/Solution/RuleComponent/index.js +75 -4
  135. package/src/components/Solution/RuleComponent/ruleFiled.js +26 -2
  136. package/src/components/Solution/RuleComponent/services.ts +1 -1
  137. package/src/components/Solution/RuleSetter/service.js +1 -1
  138. package/src/index.ts +3 -0
  139. package/src/plugin/TableColumnSetting/index.less +5 -3
  140. package/src/plugin/TableColumnSetting/index.tsx +80 -13
  141. package/src/styles/bsDefault.less +9 -3
  142. package/src/utils/RequestCacheManager.ts +213 -0
  143. package/src/utils/RequestCache_Examples.md +137 -0
  144. package/src/utils/RequestCache_README.md +170 -0
  145. package/src/utils/TableUtils.less +1 -1
  146. package/src/utils/cachedRequest.ts +288 -0
  147. package/src/utils/index.ts +1 -0
  148. package/src/utils/request.ts +8 -4
  149. package/src/utils/requestUtils.ts +1 -1
  150. package/src/utils/utils.ts +52 -16
@@ -0,0 +1,288 @@
1
+ /**
2
+ * 带缓存功能的请求工具
3
+ * 基于现有的request工具,增加1秒缓存机制
4
+ */
5
+
6
+ import request from "umi-request";
7
+ import RequestCacheManager from "./RequestCacheManager";
8
+ import { message } from "antd";
9
+ import { judgeIsRequestError } from "./requestUtils";
10
+
11
+ // 创建缓存管理器实例,设置1秒缓存时间
12
+ const cacheManager = RequestCacheManager.getInstance({
13
+ ttl: 1000, // 1秒缓存时间
14
+ maxSize: 100 // 最大缓存100个请求
15
+ });
16
+
17
+ interface RequestOptions {
18
+ url?: string;
19
+ method?: string;
20
+ params?: any;
21
+ data?: any;
22
+ headers?: any;
23
+ [key: string]: any;
24
+ }
25
+
26
+ /**
27
+ * 处理响应数据
28
+ */
29
+ const handleResponseData = async (response: any) => {
30
+ return Promise.resolve({
31
+ data: response,
32
+ status: response.status
33
+ });
34
+ };
35
+
36
+ /**
37
+ * 生成请求配置的唯一标识
38
+ */
39
+ const generateRequestId = (url: string, options?: RequestOptions): string => {
40
+ return `${url}_${JSON.stringify(options || {})}`;
41
+ };
42
+
43
+ /**
44
+ * 带缓存的请求方法(支持并发请求合并)
45
+ */
46
+ const cachedRequest = async (url: string, options?: RequestOptions) => {
47
+ const startTime = Date.now();
48
+ const method = (options?.method || 'GET').toUpperCase();
49
+ const params = options?.params || options?.data;
50
+
51
+ // 1) 检查缓存命中
52
+ const cachedData = cacheManager.getCache(url, params, method);
53
+ if (cachedData) {
54
+ console.log(`[RequestCache] 命中缓存: ${url}`, {
55
+ 原始起止时间: `${cachedData.startTime} - ${cachedData.endTime}`,
56
+ 更新时间: Date.now()
57
+ });
58
+
59
+ // 返回缓存数据,起止时间在缓存命中时已更新
60
+ return Promise.resolve({
61
+ data: cachedData.data,
62
+ status: cachedData.data.status
63
+ });
64
+ }
65
+
66
+ // 2) 检查是否已有进行中的同键请求,若有则直接复用该Promise
67
+ const pending = cacheManager.getPending(url, params, method);
68
+ if (pending) {
69
+ console.log(`[RequestCache] 复用进行中请求: ${url}`);
70
+ return pending.then((response) => handleResponseData(response));
71
+ }
72
+
73
+ // 3) 没有缓存且没有进行中请求,发起真实请求并注册为进行中
74
+ // 兼容部分旧代码使用的 body 字段(映射到 data)
75
+ const normalizedOptions = { ...(options || {}) };
76
+ if (normalizedOptions.body !== undefined && normalizedOptions.data === undefined) {
77
+ normalizedOptions.data = normalizedOptions.body;
78
+ delete normalizedOptions.body;
79
+ }
80
+ const realRequestPromise = request(url, normalizedOptions)
81
+ .then((response) => {
82
+ const endTime = Date.now();
83
+ // 缓存成功的响应
84
+ if (!judgeIsRequestError(response)) {
85
+ cacheManager.setCache(url, params, method, response, startTime, endTime);
86
+ console.log(`[RequestCache] 缓存请求: ${url}`, {
87
+ 起止时间: `${startTime} - ${endTime}`,
88
+ 耗时: endTime - startTime
89
+ });
90
+ }
91
+ return response;
92
+ })
93
+ .catch((error) => {
94
+ console.error(`[RequestCache] 请求失败: ${url}`, error);
95
+ throw error;
96
+ })
97
+ .finally(() => {
98
+ // 无论成功失败都清理进行中状态
99
+ cacheManager.clearPending(url, params, method);
100
+ });
101
+
102
+ cacheManager.setPending(url, params, method, realRequestPromise);
103
+ return realRequestPromise.then((response) => handleResponseData(response));
104
+ };
105
+
106
+ /**
107
+ * GET 请求
108
+ */
109
+ // 兼容旧签名与 umi-request 签名的辅助函数
110
+ const normalizeParamsOptions = (paramsOrOptions?: any, options?: RequestOptions): { params?: any; options?: RequestOptions } => {
111
+ if (options !== undefined) {
112
+ return { params: paramsOrOptions, options };
113
+ }
114
+ const o = paramsOrOptions;
115
+ if (o && (o.params !== undefined || o.headers !== undefined || o.data !== undefined || o.method !== undefined || o.timeout !== undefined)) {
116
+ return { options: o };
117
+ }
118
+ return { params: o };
119
+ };
120
+
121
+ /**
122
+ * GET 请求(兼容两种签名:get(url, params?, options?) 与 get(url, options))
123
+ */
124
+ const cachedGet = (url: string, paramsOrOptions?: any, options?: RequestOptions) => {
125
+ const { params, options: opt } = normalizeParamsOptions(paramsOrOptions, options);
126
+ return cachedRequest(url, {
127
+ ...opt,
128
+ method: 'GET',
129
+ params
130
+ });
131
+ };
132
+
133
+ /**
134
+ * POST 请求(兼容两种签名:post(url, data?, options?) 与 post(url, options))
135
+ */
136
+ const cachedPost = (url: string, dataOrOptions?: any, options?: RequestOptions) => {
137
+ let data = undefined;
138
+ let opt: RequestOptions | undefined = undefined;
139
+ if (options !== undefined) {
140
+ data = dataOrOptions;
141
+ opt = options;
142
+ } else {
143
+ const o = dataOrOptions;
144
+ if (o && (o.params !== undefined || o.headers !== undefined || o.data !== undefined || o.method !== undefined || o.timeout !== undefined)) {
145
+ opt = o;
146
+ data = o?.data;
147
+ } else {
148
+ data = o;
149
+ }
150
+ }
151
+ return cachedRequest(url, {
152
+ ...opt,
153
+ method: 'POST',
154
+ data
155
+ });
156
+ };
157
+
158
+ /**
159
+ * PATCH 请求(兼容两种签名)
160
+ */
161
+ const cachedPatch = (url: string, dataOrOptions?: any, options?: RequestOptions) => {
162
+ let data = undefined;
163
+ let opt: RequestOptions | undefined = undefined;
164
+ if (options !== undefined) {
165
+ data = dataOrOptions;
166
+ opt = options;
167
+ } else {
168
+ const o = dataOrOptions;
169
+ if (o && (o.params !== undefined || o.headers !== undefined || o.data !== undefined || o.method !== undefined || o.timeout !== undefined)) {
170
+ opt = o;
171
+ data = o?.data;
172
+ } else {
173
+ data = o;
174
+ }
175
+ }
176
+ return cachedRequest(url, {
177
+ ...opt,
178
+ method: 'PATCH',
179
+ data
180
+ });
181
+ };
182
+
183
+ /**
184
+ * PUT 请求(兼容两种签名)
185
+ */
186
+ const cachedPut = (url: string, dataOrOptions?: any, options?: RequestOptions) => {
187
+ let data = undefined;
188
+ let opt: RequestOptions | undefined = undefined;
189
+ if (options !== undefined) {
190
+ data = dataOrOptions;
191
+ opt = options;
192
+ } else {
193
+ const o = dataOrOptions;
194
+ if (o && (o.params !== undefined || o.headers !== undefined || o.data !== undefined || o.method !== undefined || o.timeout !== undefined)) {
195
+ opt = o;
196
+ data = o?.data;
197
+ } else {
198
+ data = o;
199
+ }
200
+ }
201
+ return cachedRequest(url, {
202
+ ...opt,
203
+ method: 'PUT',
204
+ data
205
+ });
206
+ };
207
+
208
+ /**
209
+ * DELETE 请求(兼容两种签名)
210
+ */
211
+ const cachedDelete = (url: string, dataOrOptions?: any, options?: RequestOptions) => {
212
+ let data = undefined;
213
+ let opt: RequestOptions | undefined = undefined;
214
+ if (options !== undefined) {
215
+ data = dataOrOptions;
216
+ opt = options;
217
+ } else {
218
+ const o = dataOrOptions;
219
+ if (o && (o.params !== undefined || o.headers !== undefined || o.data !== undefined || o.method !== undefined || o.timeout !== undefined)) {
220
+ opt = o;
221
+ data = o?.data;
222
+ } else {
223
+ data = o;
224
+ }
225
+ }
226
+ return cachedRequest(url, {
227
+ ...opt,
228
+ method: 'DELETE',
229
+ data
230
+ });
231
+ };
232
+
233
+ /**
234
+ * 通用请求方法(兼容现有接口)
235
+ * 支持两种调用:
236
+ * 1) request(url: string, options?: RequestOptions)
237
+ * 2) request({ url: string, ...options })
238
+ */
239
+ const cachedRequestUtil: any = (...args: any[]) => {
240
+ if (typeof args[0] === 'string') {
241
+ const url: string = args[0];
242
+ const options: RequestOptions = args[1] || {};
243
+ return cachedRequest(url, options);
244
+ }
245
+ if (typeof args[0] === 'object' && args[0] && args[0].url) {
246
+ const { url, ...parms } = args[0];
247
+ return cachedRequest(url, parms);
248
+ }
249
+ throw new Error('[RequestCache] invalid request arguments');
250
+ };
251
+
252
+ /**
253
+ * 清除缓存
254
+ */
255
+ const clearRequestCache = (url?: string, params?: any, method?: string) => {
256
+ cacheManager.clearCache(url, params, method);
257
+ console.log(`[RequestCache] 清除缓存: ${url || '所有缓存'}`);
258
+ };
259
+
260
+ /**
261
+ * 获取缓存统计信息
262
+ */
263
+ const getCacheStats = () => {
264
+ const stats = cacheManager.getCacheStats();
265
+ console.log('[RequestCache] 缓存统计:', stats);
266
+ return stats;
267
+ };
268
+
269
+ // 绑定方法到请求工具对象
270
+ cachedRequestUtil.get = cachedGet;
271
+ cachedRequestUtil.post = cachedPost;
272
+ cachedRequestUtil.patch = cachedPatch;
273
+ cachedRequestUtil.put = cachedPut;
274
+ cachedRequestUtil.delete = cachedDelete;
275
+ cachedRequestUtil.clearCache = clearRequestCache;
276
+ cachedRequestUtil.getCacheStats = getCacheStats;
277
+
278
+ export default cachedRequestUtil;
279
+ export {
280
+ cachedRequest,
281
+ cachedGet,
282
+ cachedPost,
283
+ cachedPatch,
284
+ cachedPut,
285
+ cachedDelete,
286
+ clearRequestCache,
287
+ getCacheStats
288
+ };
@@ -18,4 +18,5 @@ export * from './businessUtils';
18
18
  export * from './utils';
19
19
  export * from './xlsxUtil';
20
20
  export * from './TreeUtils';
21
+ export * from './cachedRequest';
21
22
 
@@ -7,27 +7,31 @@ const get = (url, params?: any) => {
7
7
  }).then(handleResponseData);
8
8
  };
9
9
 
10
- const post = (url, data?: any) => {
10
+ const post = (url, data?: any, params?: any) => {
11
11
  return request.post(url, {
12
12
  data,
13
+ ...params,
13
14
  }).then(handleResponseData);
14
15
  };
15
16
 
16
- const patch = (url, data?: any) => {
17
+ const patch = (url, data?: any, params?: any) => {
17
18
  return request.patch(url, {
18
19
  data,
20
+ ...params,
19
21
  }).then(handleResponseData);
20
22
  };
21
23
 
22
- const put = (url, data?: any) => {
24
+ const put = (url, data?: any, params?: any) => {
23
25
  return request.put(url, {
24
26
  data,
27
+ ...params,
25
28
  }).then(handleResponseData);
26
29
  };
27
30
 
28
- const deleteS = (url, data?: any) => {
31
+ const deleteS = (url, data?: any, params?: any) => {
29
32
  return request.delete(url, {
30
33
  data,
34
+ ...params,
31
35
  }).then(handleResponseData);
32
36
  };
33
37
 
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import request from "umi-request";
3
- import ENUM from './enumConfig';
3
+ // 注意:本文件的导入保留,用于工具函数内部兼容;业务代码请使用 '@/utils/cachedRequest'import ENUM from './enumConfig';
4
4
  import { getCurrentTenantId, getEmployeeId, getSessionId, getAccountId } from './LocalstorageUtils';
5
5
  import { getEekaSessionId, getEekaAccountId, getEekaEmployeeId, getEekaTenantId, getEekaToken,
6
6
  getGuoyaoshukeCompanyId, getGuoyaoshukeTenantId, getGuoyaoshukeTenantCode, getGuoyaoshukeToken, getGuoyaoshukeUscCode
@@ -87,16 +87,13 @@ export const handleBssulaColumnsSpecialParams = (col: any) => {
87
87
  } else if (col.timeRender) {
88
88
  // 处理不显示 时分秒的时间
89
89
  col.render = ({ text }: any) => handleTooltip(text, col.timeRender);
90
- }
91
- // 处理有问题,弃用
92
- // else if (col.textOverflow) {
93
- // // 处理文字太长
94
- // const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width));
95
- // const originalRender = col?.render;
96
- // const renderText = (params) => originalRender ? originalRender(params) : params.text;
97
- // col.render = (params) => handleTextOverflowNoTooltip(renderText(params), colWidth);
98
- // }
99
- else if (col.images) {
90
+ } else if (col.textOverflow) {
91
+ // 处理文字太长
92
+ const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width));
93
+ const originalRender = col?.render;
94
+ const renderText = (params) => originalRender ? originalRender(params) : params.text;
95
+ col.render = (params) => handleTextOverflowNoTooltip(renderText(params), colWidth);
96
+ } else if (col.images) {
100
97
  col.render = ({ text }: any) => tableColumnsImage(text);
101
98
  } else if (col.double) {
102
99
  col.render = ({ record }: any) =>
@@ -127,12 +124,11 @@ export const handleBssulaColumnsSpecialParams = (col: any) => {
127
124
  if (col.timeRender) {
128
125
  col.render = (text: any) => handleTooltip(text, col.timeRender);
129
126
  }
130
- // 处理有问题,弃用
131
127
  // 处理文字太长
132
- // if (col.textOverflow) {
133
- // const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width))
134
- // col.render = (text: any) => handleTextOverflow(text,colWidth);
135
- // }
128
+ if (col.textOverflow) {
129
+ const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width))
130
+ col.render = (text: any) => handleTextOverflow(text,colWidth);
131
+ }
136
132
  if (col.images) {
137
133
  col.render = (text: any) => tableColumnsImage(text);
138
134
  }
@@ -271,4 +267,44 @@ export const handleConvertResponse = (items: any, total: number): object => {
271
267
 
272
268
  export const noEmptyArray = (targetObj: any) => {
273
269
  return Array.isArray(targetObj) && targetObj.length !== 0;
274
- };
270
+ };
271
+
272
+ export const formContainerAndItemLayout = (type: string, title: any, name: string) => {
273
+ return type === 'form' ? {
274
+ container: {
275
+ type: 'card',
276
+ props: {
277
+ title,
278
+ id: Math.random(),
279
+ level: 1,
280
+ name
281
+ },
282
+ },
283
+ itemLayout: {
284
+ span: 8, // span表示每项所占的栅格数
285
+ labelCol: {
286
+ span: 8,
287
+ },
288
+ wrapperCol: {
289
+ span: 18,
290
+ },
291
+ },
292
+ } : {
293
+ container: {
294
+ type: 'card',
295
+ props: {
296
+ title,
297
+ id: Math.random(),
298
+ level: 1,
299
+ bordered: null,
300
+ isWhiteCard: true,
301
+ name
302
+ },
303
+ },
304
+ itemLayout: {
305
+ wrapperCol: {
306
+ span: 0,
307
+ },
308
+ },
309
+ }
310
+ }