ls-pro-common 3.1.46 → 3.1.48
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/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/InputTable.d.ts +2 -2
- package/es/components/InputTable.js +67 -21
- package/es/components/Select/Base.js +3 -4
- package/es/utils/index.d.ts +4 -3
- package/es/utils/index.js +14 -3
- package/es/utils/pasteUpload.d.ts +13 -13
- package/es/utils/pasteUpload.js +14 -15
- package/lib/components/InputTable.d.ts +2 -2
- package/lib/components/InputTable.js +67 -21
- package/lib/components/Select/Base.js +3 -4
- package/lib/utils/index.d.ts +4 -3
- package/lib/utils/index.js +14 -3
- package/lib/utils/pasteUpload.d.ts +13 -13
- package/lib/utils/pasteUpload.js +14 -15
- package/package.json +1 -1
package/lib/utils/index.js
CHANGED
|
@@ -313,13 +313,19 @@ export var off = function off(eventName, fn, el) {
|
|
|
313
313
|
* @param bodyParam Post传参数
|
|
314
314
|
* @param param Get传参数
|
|
315
315
|
* @param method 请求方式,默认post
|
|
316
|
+
* @param isNewPrintCenter 是否是新的打印中心,默认false
|
|
316
317
|
* @returns
|
|
317
318
|
*/
|
|
318
319
|
export var printView = function printView(templateNo, reqUrl) {
|
|
319
320
|
var bodyParam = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
320
321
|
var param = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
321
322
|
var method = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'POST';
|
|
322
|
-
var
|
|
323
|
+
var isNewPrintCenter = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
324
|
+
var api = '/petrel-print-center-api/report/remote/print/dataStr';
|
|
325
|
+
if (isNewPrintCenter) {
|
|
326
|
+
api = '/lesoon-basic-api/basic/ireport/preview/print/dataStr';
|
|
327
|
+
}
|
|
328
|
+
var printCenterUrl = toGatewayUrl(api);
|
|
323
329
|
reqUrl = toGatewayUrl(reqUrl);
|
|
324
330
|
if (!reqUrl.includes(location.origin)) {
|
|
325
331
|
reqUrl = location.origin + reqUrl;
|
|
@@ -339,7 +345,7 @@ export var printView = function printView(templateNo, reqUrl) {
|
|
|
339
345
|
return openWin;
|
|
340
346
|
};
|
|
341
347
|
/**
|
|
342
|
-
*
|
|
348
|
+
* 直接打印,通过打印组件进行打印。
|
|
343
349
|
*
|
|
344
350
|
* @param taskName 打印任务名
|
|
345
351
|
* @param templateNo 打印模板
|
|
@@ -353,7 +359,12 @@ export var printAsync = function printAsync(taskName, templateNo, reqUrl) {
|
|
|
353
359
|
var bodyParam = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
354
360
|
var param = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
|
355
361
|
var method = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'POST';
|
|
356
|
-
var
|
|
362
|
+
var isNewPrintCenter = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
363
|
+
var api = '/petrel-print-center-api/report/client/print';
|
|
364
|
+
if (isNewPrintCenter) {
|
|
365
|
+
api = '/lesoon-basic-api/basic/report/client/template/print';
|
|
366
|
+
}
|
|
367
|
+
var printCenterUrl = toGatewayUrl(api);
|
|
357
368
|
if (!printCenterUrl.includes(location.origin)) {
|
|
358
369
|
printCenterUrl = location.origin + printCenterUrl;
|
|
359
370
|
}
|
|
@@ -4,19 +4,19 @@ import { UploadProgressCallback } from '../http';
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```tsx // 在 TextArea 组件中使用
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
7
|
+
* const handlePaste = async (event: React.ClipboardEvent<HTMLTextAreaElement>) => {
|
|
8
|
+
* event.preventDefault(); // 阻止默认粘贴行为
|
|
9
|
+
* try {
|
|
10
|
+
* const result = await pasteUpload(event, { userId: '123' }, 'imgs');
|
|
11
|
+
* // 处理上传结果
|
|
12
|
+
* console.log('图片URL:', result.rows?.[0]?.shareUrl);
|
|
13
|
+
* } catch (error) {
|
|
14
|
+
* message.error('图片上传失败');
|
|
15
|
+
* }
|
|
16
|
+
* };
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* <Input.TextArea onPaste={handlePaste} />
|
|
19
|
+
* ```;
|
|
20
20
|
*
|
|
21
21
|
* @param event 粘贴事件对象
|
|
22
22
|
* @param params 附加其它参数 {key:value}
|
|
@@ -24,4 +24,4 @@ import { UploadProgressCallback } from '../http';
|
|
|
24
24
|
* @param onProgress 上传进度回调函数,参数为 0-100 的进度百分比
|
|
25
25
|
* @returns 返回上传结果的 Promise,resolve 时返回上传成功的数据,reject 时返回错误信息
|
|
26
26
|
*/
|
|
27
|
-
export declare const pasteUpload: (event: React.ClipboardEvent<any
|
|
27
|
+
export declare const pasteUpload: (event: React.ClipboardEvent<any> | ClipboardEvent, params?: Record<string, any>, catalogName?: string, onProgress?: UploadProgressCallback | undefined) => Promise<any>;
|
package/lib/utils/pasteUpload.js
CHANGED
|
@@ -6,19 +6,19 @@ import { httpUpload } from '../http';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx // 在 TextArea 组件中使用
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
9
|
+
* const handlePaste = async (event: React.ClipboardEvent<HTMLTextAreaElement>) => {
|
|
10
|
+
* event.preventDefault(); // 阻止默认粘贴行为
|
|
11
|
+
* try {
|
|
12
|
+
* const result = await pasteUpload(event, { userId: '123' }, 'imgs');
|
|
13
|
+
* // 处理上传结果
|
|
14
|
+
* console.log('图片URL:', result.rows?.[0]?.shareUrl);
|
|
15
|
+
* } catch (error) {
|
|
16
|
+
* message.error('图片上传失败');
|
|
17
|
+
* }
|
|
18
|
+
* };
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* <Input.TextArea onPaste={handlePaste} />
|
|
21
|
+
* ```;
|
|
22
22
|
*
|
|
23
23
|
* @param event 粘贴事件对象
|
|
24
24
|
* @param params 附加其它参数 {key:value}
|
|
@@ -32,8 +32,8 @@ export var pasteUpload = /*#__PURE__*/function () {
|
|
|
32
32
|
catalogName,
|
|
33
33
|
onProgress,
|
|
34
34
|
clipboardData,
|
|
35
|
-
items,
|
|
36
35
|
file,
|
|
36
|
+
items,
|
|
37
37
|
i,
|
|
38
38
|
item,
|
|
39
39
|
files,
|
|
@@ -54,9 +54,8 @@ export var pasteUpload = /*#__PURE__*/function () {
|
|
|
54
54
|
}
|
|
55
55
|
return _context.abrupt("return");
|
|
56
56
|
case 6:
|
|
57
|
-
// 优先从剪贴板 items 中获取文件
|
|
57
|
+
file = null; // 优先从剪贴板 items 中获取文件
|
|
58
58
|
items = clipboardData.items;
|
|
59
|
-
file = null;
|
|
60
59
|
if (!items) {
|
|
61
60
|
_context.next = 19;
|
|
62
61
|
break;
|