ls-pro-common 1.0.49 → 1.0.53
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.css +42 -8
- package/dist/common.js +1 -1
- package/dist/common.min.css +42 -8
- package/dist/common.min.js +1 -1
- package/es/components/IconSelector.d.ts +2 -1
- package/es/components/IconSelector.js +8 -4
- package/es/components/InputMultiLine.d.ts +2 -0
- package/es/components/InputMultiLine.js +7 -2
- package/es/components/InputTable.d.ts +2 -0
- package/es/components/InputTable.js +9 -3
- package/es/http/index.js +30 -15
- package/es/utils/index.js +1 -1
- package/lib/components/IconSelector.d.ts +2 -1
- package/lib/components/IconSelector.js +8 -4
- package/lib/components/InputMultiLine.d.ts +2 -0
- package/lib/components/InputMultiLine.js +7 -2
- package/lib/components/InputTable.d.ts +2 -0
- package/lib/components/InputTable.js +9 -3
- package/lib/components/common.less +51 -51
- package/lib/http/index.js +30 -15
- package/lib/utils/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { InputProps } from 'antd';
|
|
2
|
+
import type { InputProps, ModalProps } from 'antd';
|
|
3
3
|
import type { ProFormItemProps } from 'ls-pro-form';
|
|
4
4
|
export declare type IconSelectorProps = ProFormItemProps<InputProps> & {
|
|
5
5
|
/** @name 图标类型 */
|
|
@@ -14,6 +14,7 @@ export declare type IconSelectorProps = ProFormItemProps<InputProps> & {
|
|
|
14
14
|
* @name 最大值, 默认2M
|
|
15
15
|
*/
|
|
16
16
|
maxSize?: number;
|
|
17
|
+
modalProps?: ModalProps;
|
|
17
18
|
};
|
|
18
19
|
declare function IconSelector(prop: IconSelectorProps): JSX.Element;
|
|
19
20
|
export default IconSelector;
|
|
@@ -14,7 +14,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
14
14
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
15
15
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
16
16
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
17
|
-
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize"];
|
|
17
|
+
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps"];
|
|
18
18
|
import React from "react";
|
|
19
19
|
import { useMemo, useState, useEffect, useContext } from 'react';
|
|
20
20
|
import { ProFormText, ProFormContext } from 'ls-pro-form';
|
|
@@ -72,6 +72,7 @@ function IconSelector(prop) {
|
|
|
72
72
|
name = prop.name,
|
|
73
73
|
_prop$maxSize = prop.maxSize,
|
|
74
74
|
maxSize = _prop$maxSize === void 0 ? 2 : _prop$maxSize,
|
|
75
|
+
modalProps = prop.modalProps,
|
|
75
76
|
rest = _objectWithoutProperties(prop, _excluded);
|
|
76
77
|
|
|
77
78
|
var uploadImgApi = useMemo(function () {
|
|
@@ -214,7 +215,7 @@ function IconSelector(prop) {
|
|
|
214
215
|
}, rest.fieldProps, {
|
|
215
216
|
readOnly: readonly,
|
|
216
217
|
allowClear: allowClear
|
|
217
|
-
}))), /*#__PURE__*/React.createElement(_Modal, {
|
|
218
|
+
}))), /*#__PURE__*/React.createElement(_Modal, _extends({
|
|
218
219
|
title: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, title), /*#__PURE__*/React.createElement("span", {
|
|
219
220
|
style: {
|
|
220
221
|
display: 'inline-block',
|
|
@@ -274,8 +275,11 @@ function IconSelector(prop) {
|
|
|
274
275
|
onClick: function onClick() {
|
|
275
276
|
return loadData(page, searchKey);
|
|
276
277
|
}
|
|
277
|
-
}, "\u5237\u65B0"))
|
|
278
|
-
|
|
278
|
+
}, "\u5237\u65B0")),
|
|
279
|
+
getContainer: function getContainer() {
|
|
280
|
+
return document.body;
|
|
281
|
+
}
|
|
282
|
+
}, modalProps), /*#__PURE__*/React.createElement("div", {
|
|
279
283
|
style: {
|
|
280
284
|
minHeight: '120px'
|
|
281
285
|
}
|
|
@@ -14,6 +14,7 @@ export declare type InputMultiLineProps = ProFormItemProps<InputProps> & {
|
|
|
14
14
|
rows?: number;
|
|
15
15
|
/** @name 最大输入行数 */
|
|
16
16
|
maxRows?: number;
|
|
17
|
+
getPopupContainer?: (triggerNode: any) => HTMLElement;
|
|
17
18
|
};
|
|
18
19
|
declare const InputMultiLine: React.ForwardRefExoticComponent<{
|
|
19
20
|
fieldProps?: (import("../../../form/lib/interface").FieldProps & InputProps) | undefined;
|
|
@@ -37,5 +38,6 @@ declare const InputMultiLine: React.ForwardRefExoticComponent<{
|
|
|
37
38
|
rows?: number | undefined;
|
|
38
39
|
/** @name 最大输入行数 */
|
|
39
40
|
maxRows?: number | undefined;
|
|
41
|
+
getPopupContainer?: ((triggerNode: any) => HTMLElement) | undefined;
|
|
40
42
|
} & React.RefAttributes<unknown>>;
|
|
41
43
|
export default InputMultiLine;
|
|
@@ -6,7 +6,7 @@ import _Input from "antd/es/input";
|
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
8
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
9
|
-
var _excluded = ["name", "rows", "maxRows", "placement", "popWidth", "fieldProps", "defaultValue", "allowClear"];
|
|
9
|
+
var _excluded = ["name", "rows", "maxRows", "placement", "popWidth", "fieldProps", "defaultValue", "allowClear", "getPopupContainer"];
|
|
10
10
|
import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
|
|
11
11
|
import { ProFormText, ProFormContext } from 'ls-pro-form';
|
|
12
12
|
import { UnorderedListOutlined } from '@ant-design/icons';
|
|
@@ -48,6 +48,10 @@ var InputMultiLine = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
48
48
|
defaultValue = prop.defaultValue,
|
|
49
49
|
_prop$allowClear = prop.allowClear,
|
|
50
50
|
allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
|
|
51
|
+
_prop$getPopupContain = prop.getPopupContainer,
|
|
52
|
+
getPopupContainer = _prop$getPopupContain === void 0 ? function (triggerNode) {
|
|
53
|
+
return triggerNode.parentNode;
|
|
54
|
+
} : _prop$getPopupContain,
|
|
51
55
|
rest = _objectWithoutProperties(prop, _excluded); // 设置初始值
|
|
52
56
|
|
|
53
57
|
|
|
@@ -112,7 +116,8 @@ var InputMultiLine = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
112
116
|
})),
|
|
113
117
|
trigger: "click",
|
|
114
118
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
115
|
-
onVisibleChange: setVisible
|
|
119
|
+
onVisibleChange: setVisible,
|
|
120
|
+
getPopupContainer: getPopupContainer
|
|
116
121
|
}, /*#__PURE__*/React.createElement(UnorderedListOutlined, {
|
|
117
122
|
onClick: function onClick(e) {
|
|
118
123
|
setVisible(true);
|
|
@@ -41,6 +41,7 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
41
41
|
beforeLoad?: (param: any) => void;
|
|
42
42
|
/**@name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
43
43
|
afterLoad?: (rows: any[]) => void;
|
|
44
|
+
getPopupContainer?: (triggerNode: any) => HTMLElement;
|
|
44
45
|
};
|
|
45
46
|
declare const InputTable: React.ForwardRefExoticComponent<{
|
|
46
47
|
fieldProps?: (import("../../../form/lib/interface").FieldProps & InputProps) | undefined;
|
|
@@ -91,5 +92,6 @@ declare const InputTable: React.ForwardRefExoticComponent<{
|
|
|
91
92
|
beforeLoad?: ((param: any) => void) | undefined;
|
|
92
93
|
/**@name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
93
94
|
afterLoad?: ((rows: any[]) => void) | undefined;
|
|
95
|
+
getPopupContainer?: ((triggerNode: any) => HTMLElement) | undefined;
|
|
94
96
|
} & React.RefAttributes<unknown>>;
|
|
95
97
|
export default InputTable;
|
|
@@ -10,7 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
10
10
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
11
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
13
|
-
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck"],
|
|
13
|
+
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck", "getPopupContainer"],
|
|
14
14
|
_excluded2 = ["current", "pageSize"];
|
|
15
15
|
import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
|
|
16
16
|
import ProTable from 'ls-pro-table';
|
|
@@ -77,6 +77,10 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
77
77
|
loadOnShow = _prop$loadOnShow === void 0 ? false : _prop$loadOnShow,
|
|
78
78
|
_prop$triggerCheck = prop.triggerCheck,
|
|
79
79
|
triggerCheck = _prop$triggerCheck === void 0 ? 'entry' : _prop$triggerCheck,
|
|
80
|
+
_prop$getPopupContain = prop.getPopupContainer,
|
|
81
|
+
getPopupContainer = _prop$getPopupContain === void 0 ? function (triggerNode) {
|
|
82
|
+
return triggerNode.parentNode;
|
|
83
|
+
} : _prop$getPopupContain,
|
|
80
84
|
rest = _objectWithoutProperties(prop, _excluded); //显示输入框绑定的name,如果不设置textName,设置为$name__text
|
|
81
85
|
|
|
82
86
|
|
|
@@ -348,7 +352,8 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
348
352
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
349
353
|
trigger: "click",
|
|
350
354
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
351
|
-
onVisibleChange: setVisible
|
|
355
|
+
onVisibleChange: setVisible,
|
|
356
|
+
getPopupContainer: getPopupContainer
|
|
352
357
|
}, /*#__PURE__*/React.createElement(MoreOutlined, {
|
|
353
358
|
onClick: function onClick(e) {
|
|
354
359
|
setVisible(true);
|
|
@@ -385,7 +390,8 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
385
390
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
386
391
|
trigger: "click",
|
|
387
392
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
388
|
-
onVisibleChange: setVisible
|
|
393
|
+
onVisibleChange: setVisible,
|
|
394
|
+
getPopupContainer: getPopupContainer
|
|
389
395
|
}, /*#__PURE__*/React.createElement(MoreOutlined, {
|
|
390
396
|
onClick: function onClick(e) {
|
|
391
397
|
setVisible(true);
|
package/es/http/index.js
CHANGED
|
@@ -40,36 +40,51 @@ request.interceptors.request.use(function (url, options) {
|
|
|
40
40
|
|
|
41
41
|
request.interceptors.response.use( /*#__PURE__*/function () {
|
|
42
42
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response, options) {
|
|
43
|
-
var noMsg, _data$flag, _data$flag2,
|
|
43
|
+
var noMsg, _data$flag, data, _data$flag2, _data$flag3, _data, retCode, retMsg, status;
|
|
44
44
|
|
|
45
45
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
46
46
|
while (1) {
|
|
47
47
|
switch (_context.prev = _context.next) {
|
|
48
48
|
case 0:
|
|
49
|
-
noMsg = getUrlQuery('noMsg', options.url);
|
|
49
|
+
noMsg = getUrlQuery('noMsg', options.url); // http 状态码错误
|
|
50
50
|
|
|
51
51
|
if (!(response.status < 200 || response.status >= 300)) {
|
|
52
|
-
_context.next =
|
|
52
|
+
_context.next = 14;
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
_context.prev = 2;
|
|
57
|
+
_context.next = 5;
|
|
58
|
+
return response.clone().json();
|
|
59
|
+
|
|
60
|
+
case 5:
|
|
61
|
+
data = _context.sent;
|
|
62
|
+
showError(options.url + ((_data$flag = data.flag) === null || _data$flag === void 0 ? void 0 : _data$flag.retMsg));
|
|
63
|
+
_context.next = 12;
|
|
64
|
+
break;
|
|
65
|
+
|
|
66
|
+
case 9:
|
|
67
|
+
_context.prev = 9;
|
|
68
|
+
_context.t0 = _context["catch"](2);
|
|
56
69
|
showError(options.url + response.statusText);
|
|
57
|
-
|
|
70
|
+
|
|
71
|
+
case 12:
|
|
72
|
+
_context.next = 22;
|
|
58
73
|
break;
|
|
59
74
|
|
|
60
|
-
case
|
|
61
|
-
if (!(noMsg
|
|
62
|
-
_context.next =
|
|
75
|
+
case 14:
|
|
76
|
+
if (!(noMsg !== '1')) {
|
|
77
|
+
_context.next = 22;
|
|
63
78
|
break;
|
|
64
79
|
}
|
|
65
80
|
|
|
66
|
-
_context.next =
|
|
81
|
+
_context.next = 17;
|
|
67
82
|
return response.clone().json();
|
|
68
83
|
|
|
69
|
-
case
|
|
70
|
-
|
|
71
|
-
retCode = (
|
|
72
|
-
retMsg = ((_data$
|
|
84
|
+
case 17:
|
|
85
|
+
_data = _context.sent;
|
|
86
|
+
retCode = (_data === null || _data === void 0 ? void 0 : (_data$flag2 = _data.flag) === null || _data$flag2 === void 0 ? void 0 : _data$flag2.retCode) || '0';
|
|
87
|
+
retMsg = ((_data$flag3 = _data.flag) === null || _data$flag3 === void 0 ? void 0 : _data$flag3.retMsg) || '访问接口出错';
|
|
73
88
|
status = (getUrlQuery('apiStatus') || '0').split(',');
|
|
74
89
|
|
|
75
90
|
if (retCode && !status.includes(retCode)) {
|
|
@@ -80,15 +95,15 @@ request.interceptors.response.use( /*#__PURE__*/function () {
|
|
|
80
95
|
}
|
|
81
96
|
}
|
|
82
97
|
|
|
83
|
-
case
|
|
98
|
+
case 22:
|
|
84
99
|
return _context.abrupt("return", response);
|
|
85
100
|
|
|
86
|
-
case
|
|
101
|
+
case 23:
|
|
87
102
|
case "end":
|
|
88
103
|
return _context.stop();
|
|
89
104
|
}
|
|
90
105
|
}
|
|
91
|
-
}, _callee);
|
|
106
|
+
}, _callee, null, [[2, 9]]);
|
|
92
107
|
}));
|
|
93
108
|
|
|
94
109
|
return function (_x, _x2) {
|
package/es/utils/index.js
CHANGED
|
@@ -150,7 +150,7 @@ export var setCookie = function setCookie(key, value) {
|
|
|
150
150
|
var d = new Date(Date.now() + day * 24 * 60 * 60 * 1000);
|
|
151
151
|
document.cookie = "".concat(key, "=").concat(value, ";expires=").concat(d.toUTCString(), ";path=/");
|
|
152
152
|
} else {
|
|
153
|
-
document.cookie = key + "
|
|
153
|
+
document.cookie = key + "=" + value + ";path=/";
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { InputProps } from 'antd';
|
|
2
|
+
import type { InputProps, ModalProps } from 'antd';
|
|
3
3
|
import type { ProFormItemProps } from 'ls-pro-form';
|
|
4
4
|
export declare type IconSelectorProps = ProFormItemProps<InputProps> & {
|
|
5
5
|
/** @name 图标类型 */
|
|
@@ -14,6 +14,7 @@ export declare type IconSelectorProps = ProFormItemProps<InputProps> & {
|
|
|
14
14
|
* @name 最大值, 默认2M
|
|
15
15
|
*/
|
|
16
16
|
maxSize?: number;
|
|
17
|
+
modalProps?: ModalProps;
|
|
17
18
|
};
|
|
18
19
|
declare function IconSelector(prop: IconSelectorProps): JSX.Element;
|
|
19
20
|
export default IconSelector;
|
|
@@ -51,7 +51,7 @@ var _http = require("../http");
|
|
|
51
51
|
|
|
52
52
|
var _utils = require("../utils");
|
|
53
53
|
|
|
54
|
-
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize"];
|
|
54
|
+
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps"];
|
|
55
55
|
var fileCenter = (0, _utils.getCache)('file-center-api') || '/zuul/petrel-file-center-api/';
|
|
56
56
|
var pageSize = 16;
|
|
57
57
|
|
|
@@ -103,6 +103,7 @@ function IconSelector(prop) {
|
|
|
103
103
|
name = prop.name,
|
|
104
104
|
_prop$maxSize = prop.maxSize,
|
|
105
105
|
maxSize = _prop$maxSize === void 0 ? 2 : _prop$maxSize,
|
|
106
|
+
modalProps = prop.modalProps,
|
|
106
107
|
rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
|
|
107
108
|
var uploadImgApi = (0, _react.useMemo)(function () {
|
|
108
109
|
return (0, _utils.toGatewayUrl)(fileCenter + 'file/upload/' + type);
|
|
@@ -244,7 +245,7 @@ function IconSelector(prop) {
|
|
|
244
245
|
}, rest.fieldProps, {
|
|
245
246
|
readOnly: readonly,
|
|
246
247
|
allowClear: allowClear
|
|
247
|
-
}))), /*#__PURE__*/_react.default.createElement(_modal.default, {
|
|
248
|
+
}))), /*#__PURE__*/_react.default.createElement(_modal.default, (0, _extends2.default)({
|
|
248
249
|
title: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", null, title), /*#__PURE__*/_react.default.createElement("span", {
|
|
249
250
|
style: {
|
|
250
251
|
display: 'inline-block',
|
|
@@ -304,8 +305,11 @@ function IconSelector(prop) {
|
|
|
304
305
|
onClick: function onClick() {
|
|
305
306
|
return loadData(page, searchKey);
|
|
306
307
|
}
|
|
307
|
-
}, "\u5237\u65B0"))
|
|
308
|
-
|
|
308
|
+
}, "\u5237\u65B0")),
|
|
309
|
+
getContainer: function getContainer() {
|
|
310
|
+
return document.body;
|
|
311
|
+
}
|
|
312
|
+
}, modalProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
309
313
|
style: {
|
|
310
314
|
minHeight: '120px'
|
|
311
315
|
}
|
|
@@ -14,6 +14,7 @@ export declare type InputMultiLineProps = ProFormItemProps<InputProps> & {
|
|
|
14
14
|
rows?: number;
|
|
15
15
|
/** @name 最大输入行数 */
|
|
16
16
|
maxRows?: number;
|
|
17
|
+
getPopupContainer?: (triggerNode: any) => HTMLElement;
|
|
17
18
|
};
|
|
18
19
|
declare const InputMultiLine: React.ForwardRefExoticComponent<{
|
|
19
20
|
fieldProps?: (import("../../../form/lib/interface").FieldProps & InputProps) | undefined;
|
|
@@ -37,5 +38,6 @@ declare const InputMultiLine: React.ForwardRefExoticComponent<{
|
|
|
37
38
|
rows?: number | undefined;
|
|
38
39
|
/** @name 最大输入行数 */
|
|
39
40
|
maxRows?: number | undefined;
|
|
41
|
+
getPopupContainer?: ((triggerNode: any) => HTMLElement) | undefined;
|
|
40
42
|
} & React.RefAttributes<unknown>>;
|
|
41
43
|
export default InputMultiLine;
|
|
@@ -31,7 +31,7 @@ var _lsProForm = require("ls-pro-form");
|
|
|
31
31
|
|
|
32
32
|
var _icons = require("@ant-design/icons");
|
|
33
33
|
|
|
34
|
-
var _excluded = ["name", "rows", "maxRows", "placement", "popWidth", "fieldProps", "defaultValue", "allowClear"];
|
|
34
|
+
var _excluded = ["name", "rows", "maxRows", "placement", "popWidth", "fieldProps", "defaultValue", "allowClear", "getPopupContainer"];
|
|
35
35
|
|
|
36
36
|
var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
37
37
|
//@ts-ignore
|
|
@@ -70,6 +70,10 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
70
70
|
defaultValue = prop.defaultValue,
|
|
71
71
|
_prop$allowClear = prop.allowClear,
|
|
72
72
|
allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
|
|
73
|
+
_prop$getPopupContain = prop.getPopupContainer,
|
|
74
|
+
getPopupContainer = _prop$getPopupContain === void 0 ? function (triggerNode) {
|
|
75
|
+
return triggerNode.parentNode;
|
|
76
|
+
} : _prop$getPopupContain,
|
|
73
77
|
rest = (0, _objectWithoutProperties2.default)(prop, _excluded); // 设置初始值
|
|
74
78
|
|
|
75
79
|
(0, _react.useEffect)(function () {
|
|
@@ -133,7 +137,8 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
133
137
|
})),
|
|
134
138
|
trigger: "click",
|
|
135
139
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
136
|
-
onVisibleChange: setVisible
|
|
140
|
+
onVisibleChange: setVisible,
|
|
141
|
+
getPopupContainer: getPopupContainer
|
|
137
142
|
}, /*#__PURE__*/_react.default.createElement(_icons.UnorderedListOutlined, {
|
|
138
143
|
onClick: function onClick(e) {
|
|
139
144
|
setVisible(true);
|
|
@@ -41,6 +41,7 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
41
41
|
beforeLoad?: (param: any) => void;
|
|
42
42
|
/**@name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
43
43
|
afterLoad?: (rows: any[]) => void;
|
|
44
|
+
getPopupContainer?: (triggerNode: any) => HTMLElement;
|
|
44
45
|
};
|
|
45
46
|
declare const InputTable: React.ForwardRefExoticComponent<{
|
|
46
47
|
fieldProps?: (import("../../../form/lib/interface").FieldProps & InputProps) | undefined;
|
|
@@ -91,5 +92,6 @@ declare const InputTable: React.ForwardRefExoticComponent<{
|
|
|
91
92
|
beforeLoad?: ((param: any) => void) | undefined;
|
|
92
93
|
/**@name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
93
94
|
afterLoad?: ((rows: any[]) => void) | undefined;
|
|
95
|
+
getPopupContainer?: ((triggerNode: any) => HTMLElement) | undefined;
|
|
94
96
|
} & React.RefAttributes<unknown>>;
|
|
95
97
|
export default InputTable;
|
|
@@ -45,7 +45,7 @@ var _http = require("../http");
|
|
|
45
45
|
|
|
46
46
|
var _utils = require("../utils");
|
|
47
47
|
|
|
48
|
-
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck"],
|
|
48
|
+
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck", "getPopupContainer"],
|
|
49
49
|
_excluded2 = ["current", "pageSize"];
|
|
50
50
|
|
|
51
51
|
var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
@@ -106,6 +106,10 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
106
106
|
loadOnShow = _prop$loadOnShow === void 0 ? false : _prop$loadOnShow,
|
|
107
107
|
_prop$triggerCheck = prop.triggerCheck,
|
|
108
108
|
triggerCheck = _prop$triggerCheck === void 0 ? 'entry' : _prop$triggerCheck,
|
|
109
|
+
_prop$getPopupContain = prop.getPopupContainer,
|
|
110
|
+
getPopupContainer = _prop$getPopupContain === void 0 ? function (triggerNode) {
|
|
111
|
+
return triggerNode.parentNode;
|
|
112
|
+
} : _prop$getPopupContain,
|
|
109
113
|
rest = (0, _objectWithoutProperties2.default)(prop, _excluded); //显示输入框绑定的name,如果不设置textName,设置为$name__text
|
|
110
114
|
|
|
111
115
|
var textNameProp = (0, _react.useMemo)(function () {
|
|
@@ -377,7 +381,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
377
381
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
378
382
|
trigger: "click",
|
|
379
383
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
380
|
-
onVisibleChange: setVisible
|
|
384
|
+
onVisibleChange: setVisible,
|
|
385
|
+
getPopupContainer: getPopupContainer
|
|
381
386
|
}, /*#__PURE__*/_react.default.createElement(_icons.MoreOutlined, {
|
|
382
387
|
onClick: function onClick(e) {
|
|
383
388
|
setVisible(true);
|
|
@@ -414,7 +419,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
414
419
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
415
420
|
trigger: "click",
|
|
416
421
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
417
|
-
onVisibleChange: setVisible
|
|
422
|
+
onVisibleChange: setVisible,
|
|
423
|
+
getPopupContainer: getPopupContainer
|
|
418
424
|
}, /*#__PURE__*/_react.default.createElement(_icons.MoreOutlined, {
|
|
419
425
|
onClick: function onClick(e) {
|
|
420
426
|
setVisible(true);
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
body {
|
|
2
|
-
--ant-primary-color: #4997E6;
|
|
3
|
-
--ant-primary-color-hover: #74b7f2;
|
|
4
|
-
--ant-primary-color-active: #3475bf;
|
|
5
|
-
--ant-primary-color-outline: rgba(73, 151, 230, 0.2);
|
|
6
|
-
--ant-primary-1: #f0faff;
|
|
7
|
-
--ant-primary-2: #f0f9ff;
|
|
8
|
-
--ant-primary-3: #ccebff;
|
|
9
|
-
--ant-primary-4: #a3d7ff;
|
|
10
|
-
--ant-primary-5: #74b7f2;
|
|
11
|
-
--ant-primary-6: #4997E6;
|
|
12
|
-
--ant-primary-7: #3475bf;
|
|
13
|
-
--ant-primary-color-deprecated-pure: #e6f1fc;
|
|
14
|
-
--ant-primary-color-deprecated-l-35: #e6f1fc;
|
|
15
|
-
--ant-primary-color-deprecated-l-20: #a3caf2;
|
|
16
|
-
--ant-primary-color-deprecated-t-20: #6daceb;
|
|
17
|
-
--ant-primary-color-deprecated-t-50: #a4cbf3;
|
|
18
|
-
--ant-primary-color-deprecated-f-12: rgba(73, 151, 230, 0.12);
|
|
2
|
+
--ant-primary-color : #4997E6;
|
|
3
|
+
--ant-primary-color-hover : #74b7f2;
|
|
4
|
+
--ant-primary-color-active : #3475bf;
|
|
5
|
+
--ant-primary-color-outline : rgba(73, 151, 230, 0.2);
|
|
6
|
+
--ant-primary-1 : #f0faff;
|
|
7
|
+
--ant-primary-2 : #f0f9ff;
|
|
8
|
+
--ant-primary-3 : #ccebff;
|
|
9
|
+
--ant-primary-4 : #a3d7ff;
|
|
10
|
+
--ant-primary-5 : #74b7f2;
|
|
11
|
+
--ant-primary-6 : #4997E6;
|
|
12
|
+
--ant-primary-7 : #3475bf;
|
|
13
|
+
--ant-primary-color-deprecated-pure : #e6f1fc;
|
|
14
|
+
--ant-primary-color-deprecated-l-35 : #e6f1fc;
|
|
15
|
+
--ant-primary-color-deprecated-l-20 : #a3caf2;
|
|
16
|
+
--ant-primary-color-deprecated-t-20 : #6daceb;
|
|
17
|
+
--ant-primary-color-deprecated-t-50 : #a4cbf3;
|
|
18
|
+
--ant-primary-color-deprecated-f-12 : rgba(73, 151, 230, 0.12);
|
|
19
19
|
--ant-primary-color-active-deprecated-f-30: rgba(240, 250, 255, 0.3);
|
|
20
20
|
--ant-primary-color-active-deprecated-d-02: #e6f7ff;
|
|
21
|
-
--ant-success-color: #52c41a;
|
|
22
|
-
--ant-success-color-hover: #73d13d;
|
|
23
|
-
--ant-success-color-active: #389e0d;
|
|
24
|
-
--ant-success-color-outline: rgba(82, 196, 26, 0.2);
|
|
25
|
-
--ant-success-color-deprecated-bg: #f6ffed;
|
|
26
|
-
--ant-success-color-deprecated-border: #b7eb8f;
|
|
27
|
-
--ant-error-color: #ff4d4f;
|
|
28
|
-
--ant-error-color-hover: #ff7875;
|
|
29
|
-
--ant-error-color-active: #d9363e;
|
|
30
|
-
--ant-error-color-outline: rgba(255, 77, 79, 0.2);
|
|
31
|
-
--ant-error-color-deprecated-bg: #fff2f0;
|
|
32
|
-
--ant-error-color-deprecated-border: #ffccc7;
|
|
33
|
-
--ant-warning-color: #faad14;
|
|
34
|
-
--ant-warning-color-hover: #ffc53d;
|
|
35
|
-
--ant-warning-color-active: #d48806;
|
|
36
|
-
--ant-warning-color-outline: rgba(250, 173, 20, 0.2);
|
|
37
|
-
--ant-warning-color-deprecated-bg: #fffbe6;
|
|
38
|
-
--ant-warning-color-deprecated-border: #ffe58f;
|
|
39
|
-
--ant-info-color: #4997E6;
|
|
40
|
-
--ant-info-color-deprecated-bg: #f0faff;
|
|
41
|
-
--ant-info-color-deprecated-border: #ccebff;
|
|
42
|
-
|
|
21
|
+
--ant-success-color : #52c41a;
|
|
22
|
+
--ant-success-color-hover : #73d13d;
|
|
23
|
+
--ant-success-color-active : #389e0d;
|
|
24
|
+
--ant-success-color-outline : rgba(82, 196, 26, 0.2);
|
|
25
|
+
--ant-success-color-deprecated-bg : #f6ffed;
|
|
26
|
+
--ant-success-color-deprecated-border : #b7eb8f;
|
|
27
|
+
--ant-error-color : #ff4d4f;
|
|
28
|
+
--ant-error-color-hover : #ff7875;
|
|
29
|
+
--ant-error-color-active : #d9363e;
|
|
30
|
+
--ant-error-color-outline : rgba(255, 77, 79, 0.2);
|
|
31
|
+
--ant-error-color-deprecated-bg : #fff2f0;
|
|
32
|
+
--ant-error-color-deprecated-border : #ffccc7;
|
|
33
|
+
--ant-warning-color : #faad14;
|
|
34
|
+
--ant-warning-color-hover : #ffc53d;
|
|
35
|
+
--ant-warning-color-active : #d48806;
|
|
36
|
+
--ant-warning-color-outline : rgba(250, 173, 20, 0.2);
|
|
37
|
+
--ant-warning-color-deprecated-bg : #fffbe6;
|
|
38
|
+
--ant-warning-color-deprecated-border : #ffe58f;
|
|
39
|
+
--ant-info-color : #4997E6;
|
|
40
|
+
--ant-info-color-deprecated-bg : #f0faff;
|
|
41
|
+
--ant-info-color-deprecated-border : #ccebff;
|
|
42
|
+
}
|
|
43
43
|
|
|
44
44
|
.dtl-layout {
|
|
45
45
|
position : absolute;
|
|
@@ -135,24 +135,24 @@ body {
|
|
|
135
135
|
border-radius: 4px;
|
|
136
136
|
border-color : var(--ant-primary-color);
|
|
137
137
|
color : var(--ant-primary-color);
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
&:active {
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
border-color: var(--ant-primary-color-hover);
|
|
141
|
+
color : var(--ant-primary-color-hover);
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.ant-btn-primary {
|
|
146
146
|
color: #fff;
|
|
147
|
-
|
|
147
|
+
}
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
color: var(--ant-error-color);
|
|
149
|
+
.ant-btn-dangerous {
|
|
150
|
+
color : var(--ant-error-color);
|
|
151
151
|
border-color: var(--ant-error-color);
|
|
152
|
-
background: #fff;
|
|
153
|
-
|
|
152
|
+
background : #fff;
|
|
153
|
+
}
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
a {
|
|
156
156
|
color: var(--ant-primary-color);
|
|
157
157
|
}
|
|
158
158
|
|
package/lib/http/index.js
CHANGED
|
@@ -59,36 +59,51 @@ request.interceptors.request.use(function (url, options) {
|
|
|
59
59
|
|
|
60
60
|
request.interceptors.response.use( /*#__PURE__*/function () {
|
|
61
61
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response, options) {
|
|
62
|
-
var noMsg, _data$flag, _data$flag2,
|
|
62
|
+
var noMsg, _data$flag, data, _data$flag2, _data$flag3, _data, retCode, retMsg, status;
|
|
63
63
|
|
|
64
64
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
65
65
|
while (1) {
|
|
66
66
|
switch (_context.prev = _context.next) {
|
|
67
67
|
case 0:
|
|
68
|
-
noMsg = (0, _utils.getUrlQuery)('noMsg', options.url);
|
|
68
|
+
noMsg = (0, _utils.getUrlQuery)('noMsg', options.url); // http 状态码错误
|
|
69
69
|
|
|
70
70
|
if (!(response.status < 200 || response.status >= 300)) {
|
|
71
|
-
_context.next =
|
|
71
|
+
_context.next = 14;
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
_context.prev = 2;
|
|
76
|
+
_context.next = 5;
|
|
77
|
+
return response.clone().json();
|
|
78
|
+
|
|
79
|
+
case 5:
|
|
80
|
+
data = _context.sent;
|
|
81
|
+
(0, _utils.showError)(options.url + ((_data$flag = data.flag) === null || _data$flag === void 0 ? void 0 : _data$flag.retMsg));
|
|
82
|
+
_context.next = 12;
|
|
83
|
+
break;
|
|
84
|
+
|
|
85
|
+
case 9:
|
|
86
|
+
_context.prev = 9;
|
|
87
|
+
_context.t0 = _context["catch"](2);
|
|
75
88
|
(0, _utils.showError)(options.url + response.statusText);
|
|
76
|
-
|
|
89
|
+
|
|
90
|
+
case 12:
|
|
91
|
+
_context.next = 22;
|
|
77
92
|
break;
|
|
78
93
|
|
|
79
|
-
case
|
|
80
|
-
if (!(noMsg
|
|
81
|
-
_context.next =
|
|
94
|
+
case 14:
|
|
95
|
+
if (!(noMsg !== '1')) {
|
|
96
|
+
_context.next = 22;
|
|
82
97
|
break;
|
|
83
98
|
}
|
|
84
99
|
|
|
85
|
-
_context.next =
|
|
100
|
+
_context.next = 17;
|
|
86
101
|
return response.clone().json();
|
|
87
102
|
|
|
88
|
-
case
|
|
89
|
-
|
|
90
|
-
retCode = (
|
|
91
|
-
retMsg = ((_data$
|
|
103
|
+
case 17:
|
|
104
|
+
_data = _context.sent;
|
|
105
|
+
retCode = (_data === null || _data === void 0 ? void 0 : (_data$flag2 = _data.flag) === null || _data$flag2 === void 0 ? void 0 : _data$flag2.retCode) || '0';
|
|
106
|
+
retMsg = ((_data$flag3 = _data.flag) === null || _data$flag3 === void 0 ? void 0 : _data$flag3.retMsg) || '访问接口出错';
|
|
92
107
|
status = ((0, _utils.getUrlQuery)('apiStatus') || '0').split(',');
|
|
93
108
|
|
|
94
109
|
if (retCode && !status.includes(retCode)) {
|
|
@@ -99,15 +114,15 @@ request.interceptors.response.use( /*#__PURE__*/function () {
|
|
|
99
114
|
}
|
|
100
115
|
}
|
|
101
116
|
|
|
102
|
-
case
|
|
117
|
+
case 22:
|
|
103
118
|
return _context.abrupt("return", response);
|
|
104
119
|
|
|
105
|
-
case
|
|
120
|
+
case 23:
|
|
106
121
|
case "end":
|
|
107
122
|
return _context.stop();
|
|
108
123
|
}
|
|
109
124
|
}
|
|
110
|
-
}, _callee);
|
|
125
|
+
}, _callee, null, [[2, 9]]);
|
|
111
126
|
}));
|
|
112
127
|
|
|
113
128
|
return function (_x, _x2) {
|
package/lib/utils/index.js
CHANGED
|
@@ -225,7 +225,7 @@ var setCookie = function setCookie(key, value) {
|
|
|
225
225
|
var d = new Date(Date.now() + day * 24 * 60 * 60 * 1000);
|
|
226
226
|
document.cookie = "".concat(key, "=").concat(value, ";expires=").concat(d.toUTCString(), ";path=/");
|
|
227
227
|
} else {
|
|
228
|
-
document.cookie = key + "
|
|
228
|
+
document.cookie = key + "=" + value + ";path=/";
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ls-pro-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"description": "ls-pro-common",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antd",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ant-design/icons": "^4.3.0",
|
|
31
|
-
"ls-pro-table": "2.62.
|
|
32
|
-
"ls-pro-form": "1.52.
|
|
31
|
+
"ls-pro-table": "2.62.40",
|
|
32
|
+
"ls-pro-form": "1.52.28",
|
|
33
33
|
"@babel/runtime": "^7.16.3",
|
|
34
34
|
"classnames": "^2.2.6",
|
|
35
35
|
"moment": "^2.27.0",
|