ls-pro-common 1.0.85 → 1.0.86
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/ImageSelector.js +1 -3
- package/es/utils/index.d.ts +12 -2
- package/es/utils/index.js +21 -4
- package/lib/components/ImageSelector.js +1 -3
- package/lib/utils/index.d.ts +12 -2
- package/lib/utils/index.js +27 -5
- package/package.json +1 -1
|
@@ -377,9 +377,7 @@ function ImageSelector(prop) {
|
|
|
377
377
|
return loadData(searchKey);
|
|
378
378
|
}
|
|
379
379
|
}, nextMarker ? '加载更多' : '刷新')),
|
|
380
|
-
getContainer:
|
|
381
|
-
return document.body;
|
|
382
|
-
}
|
|
380
|
+
getContainer: false
|
|
383
381
|
}, modalProps), /*#__PURE__*/React.createElement("div", {
|
|
384
382
|
style: {
|
|
385
383
|
minHeight: '120px'
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModalFuncProps } from 'antd';
|
|
1
2
|
import ReactDOM from 'react-dom';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table';
|
|
@@ -100,8 +101,17 @@ export declare const showError: (text: string) => void;
|
|
|
100
101
|
export declare const showWarn: (text: string) => void;
|
|
101
102
|
/** @name 显示成功 */
|
|
102
103
|
export declare const showSuccess: (text: string) => void;
|
|
103
|
-
export declare const
|
|
104
|
-
|
|
104
|
+
export declare const getFullScreenElement: () => any;
|
|
105
|
+
/**
|
|
106
|
+
* 弹框提示
|
|
107
|
+
* @param text 提示信息
|
|
108
|
+
* @param title 标题,默认 系统提示
|
|
109
|
+
* @param type 类型
|
|
110
|
+
* @param opts 附加参数
|
|
111
|
+
* @returns Promise<Boolean>
|
|
112
|
+
*/
|
|
113
|
+
export declare const showAlert: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn', opts?: ModalFuncProps) => Promise<unknown>;
|
|
114
|
+
export declare const httpError: (retMsg?: string | undefined, retCode?: string | undefined, faultCode?: string | undefined, opts?: ModalFuncProps) => Promise<unknown>;
|
|
105
115
|
export declare const exitAlert: () => void;
|
|
106
116
|
/** @name 显示确认 */
|
|
107
117
|
export declare const showConfirm: (text: string, title?: string) => Promise<unknown>;
|
package/es/utils/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "antd/es/spin/style";
|
|
2
2
|
import _Spin from "antd/es/spin";
|
|
3
3
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
4
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
5
|
import "antd/es/modal/style";
|
|
5
6
|
import _Modal from "antd/es/modal";
|
|
6
7
|
import "antd/es/message/style";
|
|
@@ -246,25 +247,41 @@ export var showWarn = function showWarn(text) {
|
|
|
246
247
|
export var showSuccess = function showSuccess(text) {
|
|
247
248
|
_message.success(text);
|
|
248
249
|
};
|
|
250
|
+
export var getFullScreenElement = function getFullScreenElement() {
|
|
251
|
+
//@ts-ignore
|
|
252
|
+
return document.fullscreenElement || document.mozFullScreenElement || document.msFullScreenElement || document.webkitFullscreenElement || null;
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* 弹框提示
|
|
256
|
+
* @param text 提示信息
|
|
257
|
+
* @param title 标题,默认 系统提示
|
|
258
|
+
* @param type 类型
|
|
259
|
+
* @param opts 附加参数
|
|
260
|
+
* @returns Promise<Boolean>
|
|
261
|
+
*/
|
|
262
|
+
|
|
249
263
|
export var showAlert = function showAlert(text) {
|
|
250
264
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
251
265
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';
|
|
266
|
+
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
252
267
|
return new Promise(function (resolve, reject) {
|
|
253
|
-
_Modal[type]({
|
|
268
|
+
_Modal[type](_objectSpread({
|
|
254
269
|
content: text,
|
|
255
270
|
title: title,
|
|
271
|
+
getContainer: getFullScreenElement() || false,
|
|
256
272
|
onOk: function onOk() {
|
|
257
273
|
resolve(true);
|
|
258
274
|
},
|
|
259
275
|
onCancel: function onCancel() {
|
|
260
276
|
reject(false);
|
|
261
277
|
}
|
|
262
|
-
});
|
|
278
|
+
}, opts));
|
|
263
279
|
});
|
|
264
280
|
};
|
|
265
|
-
export var httpError = function httpError(retMsg, retCode, faultCode
|
|
281
|
+
export var httpError = function httpError(retMsg, retCode, faultCode) {
|
|
282
|
+
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
266
283
|
var msg = /*#__PURE__*/React.createElement(React.Fragment, null, "\u9519\u8BEF\u539F\u56E0:", /*#__PURE__*/React.createElement("b", null, retMsg), /*#__PURE__*/React.createElement("br", null), "\u9519\u8BEF\u7801:", /*#__PURE__*/React.createElement("b", null, retCode), /*#__PURE__*/React.createElement("br", null), "\u6545\u969C\u7801:", /*#__PURE__*/React.createElement("b", null, faultCode));
|
|
267
|
-
return showAlert(msg, '请求接口出错', 'error');
|
|
284
|
+
return showAlert(msg, '请求接口出错', 'error', opts);
|
|
268
285
|
};
|
|
269
286
|
export var exitAlert = function exitAlert() {
|
|
270
287
|
_Modal.destroyAll();
|
|
@@ -407,9 +407,7 @@ function ImageSelector(prop) {
|
|
|
407
407
|
return loadData(searchKey);
|
|
408
408
|
}
|
|
409
409
|
}, nextMarker ? '加载更多' : '刷新')),
|
|
410
|
-
getContainer:
|
|
411
|
-
return document.body;
|
|
412
|
-
}
|
|
410
|
+
getContainer: false
|
|
413
411
|
}, modalProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
414
412
|
style: {
|
|
415
413
|
minHeight: '120px'
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModalFuncProps } from 'antd';
|
|
1
2
|
import ReactDOM from 'react-dom';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table';
|
|
@@ -100,8 +101,17 @@ export declare const showError: (text: string) => void;
|
|
|
100
101
|
export declare const showWarn: (text: string) => void;
|
|
101
102
|
/** @name 显示成功 */
|
|
102
103
|
export declare const showSuccess: (text: string) => void;
|
|
103
|
-
export declare const
|
|
104
|
-
|
|
104
|
+
export declare const getFullScreenElement: () => any;
|
|
105
|
+
/**
|
|
106
|
+
* 弹框提示
|
|
107
|
+
* @param text 提示信息
|
|
108
|
+
* @param title 标题,默认 系统提示
|
|
109
|
+
* @param type 类型
|
|
110
|
+
* @param opts 附加参数
|
|
111
|
+
* @returns Promise<Boolean>
|
|
112
|
+
*/
|
|
113
|
+
export declare const showAlert: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn', opts?: ModalFuncProps) => Promise<unknown>;
|
|
114
|
+
export declare const httpError: (retMsg?: string | undefined, retCode?: string | undefined, faultCode?: string | undefined, opts?: ModalFuncProps) => Promise<unknown>;
|
|
105
115
|
export declare const exitAlert: () => void;
|
|
106
116
|
/** @name 显示确认 */
|
|
107
117
|
export declare const showConfirm: (text: string, title?: string) => Promise<unknown>;
|
package/lib/utils/index.js
CHANGED
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "dateFormat", {
|
|
|
12
12
|
return _lsProTable.dateFormat;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
exports.getLoginName = exports.getCookie = exports.getCompanyId = exports.getCache = exports.formatMoney = exports.formatDate = exports.exitLoading = exports.exitAlert = exports.deepClone = exports.debounce = void 0;
|
|
15
|
+
exports.getLoginName = exports.getFullScreenElement = exports.getCookie = exports.getCompanyId = exports.getCache = exports.formatMoney = exports.formatDate = exports.exitLoading = exports.exitAlert = exports.deepClone = exports.debounce = void 0;
|
|
16
16
|
Object.defineProperty(exports, "getResourceProps", {
|
|
17
17
|
enumerable: true,
|
|
18
18
|
get: function get() {
|
|
@@ -47,6 +47,8 @@ var _spin = _interopRequireDefault(require("antd/es/spin"));
|
|
|
47
47
|
|
|
48
48
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
49
49
|
|
|
50
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
51
|
+
|
|
50
52
|
require("antd/es/modal/style");
|
|
51
53
|
|
|
52
54
|
var _modal = _interopRequireDefault(require("antd/es/modal"));
|
|
@@ -347,29 +349,49 @@ var showSuccess = function showSuccess(text) {
|
|
|
347
349
|
|
|
348
350
|
exports.showSuccess = showSuccess;
|
|
349
351
|
|
|
352
|
+
var getFullScreenElement = function getFullScreenElement() {
|
|
353
|
+
//@ts-ignore
|
|
354
|
+
return document.fullscreenElement || document.mozFullScreenElement || document.msFullScreenElement || document.webkitFullscreenElement || null;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* 弹框提示
|
|
358
|
+
* @param text 提示信息
|
|
359
|
+
* @param title 标题,默认 系统提示
|
|
360
|
+
* @param type 类型
|
|
361
|
+
* @param opts 附加参数
|
|
362
|
+
* @returns Promise<Boolean>
|
|
363
|
+
*/
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
exports.getFullScreenElement = getFullScreenElement;
|
|
367
|
+
|
|
350
368
|
var showAlert = function showAlert(text) {
|
|
351
369
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
352
370
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';
|
|
371
|
+
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
353
372
|
return new Promise(function (resolve, reject) {
|
|
354
|
-
_modal.default[type]({
|
|
373
|
+
_modal.default[type]((0, _objectSpread2.default)({
|
|
355
374
|
content: text,
|
|
356
375
|
title: title,
|
|
376
|
+
getContainer: getFullScreenElement() || false,
|
|
357
377
|
onOk: function onOk() {
|
|
358
378
|
resolve(true);
|
|
359
379
|
},
|
|
360
380
|
onCancel: function onCancel() {
|
|
361
381
|
reject(false);
|
|
362
382
|
}
|
|
363
|
-
});
|
|
383
|
+
}, opts));
|
|
364
384
|
});
|
|
365
385
|
};
|
|
366
386
|
|
|
367
387
|
exports.showAlert = showAlert;
|
|
368
388
|
|
|
369
|
-
var httpError = function httpError(retMsg, retCode, faultCode
|
|
389
|
+
var httpError = function httpError(retMsg, retCode, faultCode) {
|
|
390
|
+
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
391
|
+
|
|
370
392
|
var msg = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "\u9519\u8BEF\u539F\u56E0:", /*#__PURE__*/_react.default.createElement("b", null, retMsg), /*#__PURE__*/_react.default.createElement("br", null), "\u9519\u8BEF\u7801:", /*#__PURE__*/_react.default.createElement("b", null, retCode), /*#__PURE__*/_react.default.createElement("br", null), "\u6545\u969C\u7801:", /*#__PURE__*/_react.default.createElement("b", null, faultCode));
|
|
371
393
|
|
|
372
|
-
return showAlert(msg, '请求接口出错', 'error');
|
|
394
|
+
return showAlert(msg, '请求接口出错', 'error', opts);
|
|
373
395
|
};
|
|
374
396
|
|
|
375
397
|
exports.httpError = httpError;
|