ls-pro-common 3.0.29 → 3.0.31
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/es/components/IconBack.d.ts +5 -4
- package/es/components/IconBack.js +1 -1
- package/es/components/IconBell.d.ts +2 -4
- package/es/components/IconBell.js +1 -1
- package/es/components/IconQuestion.d.ts +2 -4
- package/es/components/IconQuestion.js +1 -1
- package/es/components/IconSearch.d.ts +2 -4
- package/es/components/IconSearch.js +1 -1
- package/es/components/IconText.d.ts +2 -4
- package/es/components/IconText.js +1 -1
- package/es/utils/index.d.ts +2 -2
- package/es/utils/index.js +2 -2
- package/lib/components/404.js +7 -15
- package/lib/components/AreaCascader.js +23 -32
- package/lib/components/AreaCascaderPanel.js +52 -61
- package/lib/components/DescritionCard.js +23 -32
- package/lib/components/DtlLayout.js +28 -37
- package/lib/components/GroupTip.js +11 -19
- package/lib/components/IconBack.d.ts +5 -4
- package/lib/components/IconBack.js +7 -15
- package/lib/components/IconBell.d.ts +2 -4
- package/lib/components/IconBell.js +7 -15
- package/lib/components/IconQuestion.d.ts +2 -4
- package/lib/components/IconQuestion.js +9 -17
- package/lib/components/IconSearch.d.ts +2 -4
- package/lib/components/IconSearch.js +7 -15
- package/lib/components/IconSelector.js +49 -57
- package/lib/components/IconText.d.ts +2 -4
- package/lib/components/IconText.js +12 -20
- package/lib/components/ImageSelector.js +93 -101
- package/lib/components/InputMultiLine.js +35 -44
- package/lib/components/InputTable.js +71 -80
- package/lib/components/Loading.js +11 -19
- package/lib/components/Permission.js +7 -15
- package/lib/hooks/useDtl/index.js +88 -96
- package/lib/hooks/useGetState.js +6 -13
- package/lib/hooks/usePermission/index.js +14 -21
- package/lib/hooks/useSingle/index.js +74 -82
- package/lib/http/index.js +42 -56
- package/lib/index.js +26 -207
- package/lib/service/BaseService.js +33 -41
- package/lib/typing.js +1 -5
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +83 -180
- package/package.json +2 -2
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
require("antd/es/popover/style");
|
|
10
|
-
var _popover = _interopRequireDefault(require("antd/es/popover"));
|
|
11
|
-
require("antd/es/input/style");
|
|
12
|
-
var _input = _interopRequireDefault(require("antd/es/input"));
|
|
13
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
-
var _lsProForm = require("ls-pro-form");
|
|
19
|
-
var _icons = require("@ant-design/icons");
|
|
1
|
+
import "antd/es/popover/style";
|
|
2
|
+
import _Popover from "antd/es/popover";
|
|
3
|
+
import "antd/es/input/style";
|
|
4
|
+
import _Input from "antd/es/input";
|
|
5
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
6
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
20
9
|
var _excluded = ["name", "rows", "maxRows", "placement", "popWidth", "fieldProps", "defaultValue", "allowClear", "getPopupContainer", "textAreaProps"];
|
|
21
|
-
|
|
10
|
+
import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
|
|
11
|
+
import { ProFormText, ProFormContext } from 'ls-pro-form';
|
|
12
|
+
import { UnorderedListOutlined } from '@ant-design/icons';
|
|
13
|
+
var InputMultiLine = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
22
14
|
//@ts-ignore
|
|
23
|
-
var _useContext =
|
|
15
|
+
var _useContext = useContext(ProFormContext),
|
|
24
16
|
formRef = _useContext.formRef;
|
|
25
|
-
var _useState =
|
|
26
|
-
_useState2 = (
|
|
17
|
+
var _useState = useState(''),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
19
|
text = _useState2[0],
|
|
28
20
|
setText = _useState2[1];
|
|
29
|
-
var _useState3 =
|
|
30
|
-
_useState4 = (
|
|
21
|
+
var _useState3 = useState(''),
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
23
|
lineText = _useState4[0],
|
|
32
24
|
setLineText = _useState4[1];
|
|
33
|
-
var _useState5 =
|
|
34
|
-
_useState6 = (
|
|
25
|
+
var _useState5 = useState(false),
|
|
26
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
35
27
|
visible = _useState6[0],
|
|
36
28
|
setVisible = _useState6[1];
|
|
37
|
-
var inputRef =
|
|
38
|
-
|
|
29
|
+
var inputRef = useRef();
|
|
30
|
+
useImperativeHandle(ref, function () {
|
|
39
31
|
return inputRef.current;
|
|
40
32
|
});
|
|
41
33
|
var name = prop.name,
|
|
@@ -56,9 +48,9 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
56
48
|
return triggerNode.parentNode.parentNode.parentNode.parentNode;
|
|
57
49
|
} : _prop$getPopupContain,
|
|
58
50
|
textAreaProps = prop.textAreaProps,
|
|
59
|
-
rest = (
|
|
51
|
+
rest = _objectWithoutProperties(prop, _excluded);
|
|
60
52
|
// 设置初始值
|
|
61
|
-
|
|
53
|
+
useEffect(function () {
|
|
62
54
|
if (defaultValue) {
|
|
63
55
|
setText(defaultValue);
|
|
64
56
|
} else if (name && (formRef === null || formRef === void 0 ? void 0 : formRef.current)) {
|
|
@@ -68,17 +60,17 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
68
60
|
}
|
|
69
61
|
}, []);
|
|
70
62
|
// 显示多行输入时,赋值给多行文本框
|
|
71
|
-
|
|
63
|
+
useEffect(function () {
|
|
72
64
|
if (!visible) return;
|
|
73
65
|
var line = (text || '').split(',').join('\n');
|
|
74
66
|
setLineText(line);
|
|
75
67
|
}, [visible, text]);
|
|
76
68
|
// 输入框值变化时,赋值给表单项
|
|
77
|
-
|
|
69
|
+
useEffect(function () {
|
|
78
70
|
var _formRef$current2, _formRef$current2$get, _formRef$current3, _formRef$current3$set;
|
|
79
71
|
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2)) || {};
|
|
80
72
|
formValue[name] = text;
|
|
81
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, (
|
|
73
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, _objectSpread({}, formValue));
|
|
82
74
|
}, [text]);
|
|
83
75
|
var lineInput = function lineInput(e) {
|
|
84
76
|
var line = (e.target.value || '').split('\n').filter(function (o, i) {
|
|
@@ -97,13 +89,13 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
97
89
|
setLineText('');
|
|
98
90
|
}
|
|
99
91
|
};
|
|
100
|
-
var PopoverDom =
|
|
101
|
-
return /*#__PURE__*/
|
|
102
|
-
content: /*#__PURE__*/
|
|
92
|
+
var PopoverDom = useMemo(function () {
|
|
93
|
+
return /*#__PURE__*/React.createElement(_Popover, {
|
|
94
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
103
95
|
style: {
|
|
104
96
|
width: popWidth
|
|
105
97
|
}
|
|
106
|
-
}, /*#__PURE__*/
|
|
98
|
+
}, /*#__PURE__*/React.createElement(_Input.TextArea, _extends({
|
|
107
99
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
108
100
|
}, textAreaProps, {
|
|
109
101
|
rows: rows,
|
|
@@ -117,15 +109,15 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
117
109
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
118
110
|
onVisibleChange: setVisible,
|
|
119
111
|
getPopupContainer: getPopupContainer
|
|
120
|
-
}, /*#__PURE__*/
|
|
112
|
+
}, /*#__PURE__*/React.createElement(UnorderedListOutlined, {
|
|
121
113
|
onClick: function onClick(e) {
|
|
122
114
|
setVisible(true);
|
|
123
115
|
}
|
|
124
116
|
}));
|
|
125
117
|
}, [visible, popWidth, lineText, rest]);
|
|
126
|
-
return /*#__PURE__*/
|
|
118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, rest.label && name ? /*#__PURE__*/React.createElement(ProFormText, _extends({
|
|
127
119
|
name: name
|
|
128
|
-
}, rest), /*#__PURE__*/
|
|
120
|
+
}, rest), /*#__PURE__*/React.createElement(_Input, _extends({
|
|
129
121
|
suffix: PopoverDom,
|
|
130
122
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
131
123
|
}, fieldProps, {
|
|
@@ -133,7 +125,7 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
133
125
|
onInput: textInput,
|
|
134
126
|
allowClear: allowClear,
|
|
135
127
|
ref: inputRef
|
|
136
|
-
}))) : /*#__PURE__*/
|
|
128
|
+
}))) : /*#__PURE__*/React.createElement(_Input, _extends({
|
|
137
129
|
suffix: PopoverDom,
|
|
138
130
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
139
131
|
allowClear: allowClear
|
|
@@ -144,5 +136,4 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
144
136
|
ref: inputRef
|
|
145
137
|
})));
|
|
146
138
|
});
|
|
147
|
-
|
|
148
|
-
exports.default = _default;
|
|
139
|
+
export default InputMultiLine;
|
|
@@ -1,53 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
-
require("antd/es/button/style");
|
|
16
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
|
-
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
20
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
21
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
22
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
23
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
24
|
-
var _lsProTable = _interopRequireDefault(require("ls-pro-table"));
|
|
25
|
-
var _lsProForm = require("ls-pro-form");
|
|
26
|
-
var _icons = require("@ant-design/icons");
|
|
27
|
-
var _http = require("../http");
|
|
28
|
-
var _utils = require("../utils");
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import "antd/es/popover/style";
|
|
4
|
+
import _Popover from "antd/es/popover";
|
|
5
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
6
|
+
import "antd/es/button/style";
|
|
7
|
+
import _Button from "antd/es/button";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
10
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
11
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
12
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
13
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
29
14
|
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", "placement", "arrowPointAtCenter", "rowKey"],
|
|
30
15
|
_excluded2 = ["current", "pageSize"];
|
|
31
|
-
|
|
16
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
17
|
+
import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
|
|
18
|
+
import ProTable from 'ls-pro-table';
|
|
19
|
+
import { ProFormText, ProFormContext } from 'ls-pro-form';
|
|
20
|
+
import { MoreOutlined } from '@ant-design/icons';
|
|
21
|
+
import { httpGet } from '../http';
|
|
22
|
+
import { isDev, showWarn } from '../utils';
|
|
23
|
+
var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
32
24
|
//@ts-ignore
|
|
33
|
-
var _useContext =
|
|
25
|
+
var _useContext = useContext(ProFormContext),
|
|
34
26
|
formRef = _useContext.formRef;
|
|
35
|
-
var tableRef =
|
|
36
|
-
var selectRowRef =
|
|
37
|
-
var _useState =
|
|
38
|
-
_useState2 = (
|
|
27
|
+
var tableRef = useRef();
|
|
28
|
+
var selectRowRef = useRef([]);
|
|
29
|
+
var _useState = useState([]),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
31
|
selectedKeys = _useState2[0],
|
|
40
32
|
setSelectedKeys = _useState2[1];
|
|
41
|
-
var _useState3 =
|
|
42
|
-
_useState4 = (
|
|
33
|
+
var _useState3 = useState(false),
|
|
34
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
43
35
|
visible = _useState4[0],
|
|
44
36
|
setVisible = _useState4[1];
|
|
45
|
-
var _useState5 =
|
|
46
|
-
_useState6 = (
|
|
37
|
+
var _useState5 = useState(''),
|
|
38
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
47
39
|
text = _useState6[0],
|
|
48
40
|
setText = _useState6[1];
|
|
49
|
-
var inputRef =
|
|
50
|
-
|
|
41
|
+
var inputRef = useRef();
|
|
42
|
+
useImperativeHandle(ref, function () {
|
|
51
43
|
return inputRef.current;
|
|
52
44
|
});
|
|
53
45
|
var columns = prop.columns,
|
|
@@ -91,23 +83,23 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
91
83
|
_prop$arrowPointAtCen = prop.arrowPointAtCenter,
|
|
92
84
|
arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
|
|
93
85
|
rowKey = prop.rowKey,
|
|
94
|
-
rest = (
|
|
95
|
-
if (!valueField &&
|
|
86
|
+
rest = _objectWithoutProperties(prop, _excluded);
|
|
87
|
+
if (!valueField && isDev) {
|
|
96
88
|
console.error('valueField 属性必须设置');
|
|
97
89
|
}
|
|
98
|
-
if (!url &&
|
|
90
|
+
if (!url && isDev) {
|
|
99
91
|
console.error('url 属性必须设置');
|
|
100
92
|
}
|
|
101
|
-
if (!name &&
|
|
93
|
+
if (!name && isDev) {
|
|
102
94
|
console.error('name 属性必须设置');
|
|
103
95
|
}
|
|
104
96
|
var tableKey = (tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowKey) || valueField || 'id';
|
|
105
97
|
//显示输入框绑定的name,如果不设置textName,设置为$name__text
|
|
106
|
-
var textNameProp =
|
|
98
|
+
var textNameProp = useMemo(function () {
|
|
107
99
|
return textName || name + '__text';
|
|
108
100
|
}, [textName, name]);
|
|
109
101
|
// 输入框回车时,调用查询参数字段
|
|
110
|
-
var searchKey =
|
|
102
|
+
var searchKey = useMemo(function () {
|
|
111
103
|
if (searchField) return searchField;
|
|
112
104
|
var col;
|
|
113
105
|
//先取显示字段
|
|
@@ -126,12 +118,12 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
126
118
|
return textField || valueField;
|
|
127
119
|
}, [columns, searchField, valueField, textField]);
|
|
128
120
|
var loadData = /*#__PURE__*/function () {
|
|
129
|
-
var _ref = (
|
|
121
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
|
|
130
122
|
var current, pageSize, rest, data, _tableRef$current, _tableRef$current$cle, result, rows, _formRef$current, _formRef$current$getF, val, _selectRowRef$current, arr, pageSelectedRows;
|
|
131
|
-
return
|
|
123
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
132
124
|
while (1) switch (_context.prev = _context.next) {
|
|
133
125
|
case 0:
|
|
134
|
-
current = param.current, pageSize = param.pageSize, rest = (
|
|
126
|
+
current = param.current, pageSize = param.pageSize, rest = _objectWithoutProperties(param, _excluded2);
|
|
135
127
|
data = {};
|
|
136
128
|
if (isV2) {
|
|
137
129
|
data['page.pn'] = current;
|
|
@@ -144,7 +136,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
144
136
|
if (Object.keys(rest).length && !isV2) {
|
|
145
137
|
data.where = rest;
|
|
146
138
|
} else {
|
|
147
|
-
data = (
|
|
139
|
+
data = _objectSpread(_objectSpread({}, data), rest);
|
|
148
140
|
}
|
|
149
141
|
if (!keepSelect) {
|
|
150
142
|
selectRowRef.current = [];
|
|
@@ -155,7 +147,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
155
147
|
}
|
|
156
148
|
;
|
|
157
149
|
_context.next = 10;
|
|
158
|
-
return
|
|
150
|
+
return httpGet(url, data);
|
|
159
151
|
case 10:
|
|
160
152
|
result = _context.sent;
|
|
161
153
|
rows = result.rows || [];
|
|
@@ -175,8 +167,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
175
167
|
return o[valueField] === row[valueField];
|
|
176
168
|
});
|
|
177
169
|
});
|
|
178
|
-
(_selectRowRef$current = selectRowRef.current).push.apply(_selectRowRef$current, (
|
|
179
|
-
selectedKeys.push.apply(selectedKeys, (
|
|
170
|
+
(_selectRowRef$current = selectRowRef.current).push.apply(_selectRowRef$current, _toConsumableArray(pageSelectedRows));
|
|
171
|
+
selectedKeys.push.apply(selectedKeys, _toConsumableArray(pageSelectedRows.map(function (o) {
|
|
180
172
|
return o[tableKey];
|
|
181
173
|
})));
|
|
182
174
|
setSelectedKeys(Array.from(new Set(selectedKeys)));
|
|
@@ -198,7 +190,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
198
190
|
};
|
|
199
191
|
}();
|
|
200
192
|
// 初始化数据
|
|
201
|
-
|
|
193
|
+
useEffect(function () {
|
|
202
194
|
setTimeout(function () {
|
|
203
195
|
var txt = '',
|
|
204
196
|
val = '';
|
|
@@ -221,10 +213,10 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
221
213
|
setText(val);
|
|
222
214
|
if (rowKey) {
|
|
223
215
|
var _formRef$current5, _formRef$current5$set;
|
|
224
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$set = _formRef$current5.setFieldsValue) === null || _formRef$current5$set === void 0 ? void 0 : _formRef$current5$set.call(_formRef$current5, (
|
|
216
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$set = _formRef$current5.setFieldsValue) === null || _formRef$current5$set === void 0 ? void 0 : _formRef$current5$set.call(_formRef$current5, _defineProperty({}, rowKey, _objectSpread(_objectSpread({}, row), {}, _defineProperty({}, textNameProp, val))));
|
|
225
217
|
} else {
|
|
226
218
|
var _formRef$current6, _formRef$current6$set;
|
|
227
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, (
|
|
219
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, _defineProperty({}, textNameProp, val));
|
|
228
220
|
}
|
|
229
221
|
}
|
|
230
222
|
}, 0);
|
|
@@ -273,10 +265,10 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
273
265
|
setVisible(false);
|
|
274
266
|
if (rowKey) {
|
|
275
267
|
var _formRef$current8, _formRef$current8$set;
|
|
276
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$set = _formRef$current8.setFieldsValue) === null || _formRef$current8$set === void 0 ? void 0 : _formRef$current8$set.call(_formRef$current8, (
|
|
268
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$set = _formRef$current8.setFieldsValue) === null || _formRef$current8$set === void 0 ? void 0 : _formRef$current8$set.call(_formRef$current8, _defineProperty({}, rowKey, formValue));
|
|
277
269
|
} else {
|
|
278
270
|
var _formRef$current9, _formRef$current9$set;
|
|
279
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, (
|
|
271
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, _objectSpread({}, formValue));
|
|
280
272
|
}
|
|
281
273
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
282
274
|
};
|
|
@@ -294,7 +286,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
294
286
|
var rows = result.data || [];
|
|
295
287
|
if (!rows.length) {
|
|
296
288
|
handleValue({});
|
|
297
|
-
|
|
289
|
+
showWarn("".concat(val, "\u67E5\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u8BB0\u5F55\uFF01"));
|
|
298
290
|
} else if (multiple) {
|
|
299
291
|
handleValue(rows);
|
|
300
292
|
} else {
|
|
@@ -318,10 +310,10 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
318
310
|
setText(val);
|
|
319
311
|
if (rowKey) {
|
|
320
312
|
var _formRef$current11, _formRef$current11$se;
|
|
321
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$se = _formRef$current11.setFieldsValue) === null || _formRef$current11$se === void 0 ? void 0 : _formRef$current11$se.call(_formRef$current11, (
|
|
313
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$se = _formRef$current11.setFieldsValue) === null || _formRef$current11$se === void 0 ? void 0 : _formRef$current11$se.call(_formRef$current11, _defineProperty({}, rowKey, formValue));
|
|
322
314
|
} else {
|
|
323
315
|
var _formRef$current12, _formRef$current12$se;
|
|
324
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, (
|
|
316
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, _objectSpread({}, formValue));
|
|
325
317
|
}
|
|
326
318
|
};
|
|
327
319
|
// 当表单重置或点clear时,处理值
|
|
@@ -337,21 +329,21 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
337
329
|
formValue[textNameProp] = '';
|
|
338
330
|
if (rowKey) {
|
|
339
331
|
var _formRef$current14, _formRef$current14$se;
|
|
340
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current14 = formRef.current) === null || _formRef$current14 === void 0 ? void 0 : (_formRef$current14$se = _formRef$current14.setFieldsValue) === null || _formRef$current14$se === void 0 ? void 0 : _formRef$current14$se.call(_formRef$current14, (
|
|
332
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current14 = formRef.current) === null || _formRef$current14 === void 0 ? void 0 : (_formRef$current14$se = _formRef$current14.setFieldsValue) === null || _formRef$current14$se === void 0 ? void 0 : _formRef$current14$se.call(_formRef$current14, _defineProperty({}, rowKey, formValue));
|
|
341
333
|
} else {
|
|
342
334
|
var _formRef$current15, _formRef$current15$se;
|
|
343
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current15 = formRef.current) === null || _formRef$current15 === void 0 ? void 0 : (_formRef$current15$se = _formRef$current15.setFieldsValue) === null || _formRef$current15$se === void 0 ? void 0 : _formRef$current15$se.call(_formRef$current15, (
|
|
335
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current15 = formRef.current) === null || _formRef$current15 === void 0 ? void 0 : (_formRef$current15$se = _formRef$current15.setFieldsValue) === null || _formRef$current15$se === void 0 ? void 0 : _formRef$current15$se.call(_formRef$current15, _objectSpread({}, formValue));
|
|
344
336
|
}
|
|
345
337
|
}
|
|
346
338
|
};
|
|
347
|
-
|
|
339
|
+
useEffect(function () {
|
|
348
340
|
if (!text && multiple) {
|
|
349
341
|
var _tableRef$current2, _tableRef$current2$cl;
|
|
350
342
|
selectRowRef.current = [];
|
|
351
343
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
|
|
352
344
|
}
|
|
353
345
|
}, [text, multiple]);
|
|
354
|
-
var tableDom = /*#__PURE__*/
|
|
346
|
+
var tableDom = /*#__PURE__*/React.createElement(ProTable, _extends({
|
|
355
347
|
className: "ls-input-table",
|
|
356
348
|
columns: columns,
|
|
357
349
|
request: loadData,
|
|
@@ -381,7 +373,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
381
373
|
};
|
|
382
374
|
},
|
|
383
375
|
toolBarRender: function toolBarRender() {
|
|
384
|
-
return multiple ? [/*#__PURE__*/
|
|
376
|
+
return multiple ? [/*#__PURE__*/React.createElement(_Button, {
|
|
385
377
|
key: "btnConfirm",
|
|
386
378
|
onClick: function onClick() {
|
|
387
379
|
handleValue(selectRowRef.current || []);
|
|
@@ -406,7 +398,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
406
398
|
} : false
|
|
407
399
|
}));
|
|
408
400
|
// 处理有值时,可清空
|
|
409
|
-
|
|
401
|
+
useEffect(function () {
|
|
410
402
|
if (rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled)) return;
|
|
411
403
|
try {
|
|
412
404
|
var el = inputRef.current.input.parentNode;
|
|
@@ -418,17 +410,17 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
418
410
|
}
|
|
419
411
|
} catch (e) {}
|
|
420
412
|
}, [text, rest, fieldProps]);
|
|
421
|
-
return /*#__PURE__*/
|
|
413
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
422
414
|
style: {
|
|
423
415
|
display: 'none'
|
|
424
416
|
}
|
|
425
|
-
}, /*#__PURE__*/
|
|
417
|
+
}, /*#__PURE__*/React.createElement(ProFormText, {
|
|
426
418
|
name: name
|
|
427
|
-
})), rest.label ? /*#__PURE__*/
|
|
419
|
+
})), rest.label ? /*#__PURE__*/React.createElement(ProFormText, _extends({
|
|
428
420
|
name: textNameProp
|
|
429
|
-
}, rest), /*#__PURE__*/
|
|
430
|
-
suffix: /*#__PURE__*/
|
|
431
|
-
content: /*#__PURE__*/
|
|
421
|
+
}, rest), /*#__PURE__*/React.createElement(_Input, _extends({
|
|
422
|
+
suffix: /*#__PURE__*/React.createElement(_Popover, {
|
|
423
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
432
424
|
style: {
|
|
433
425
|
width: tableWidth + 'px',
|
|
434
426
|
height: tableHeight + 'px',
|
|
@@ -448,7 +440,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
448
440
|
getPopupContainer: getPopupContainer,
|
|
449
441
|
placement: placement,
|
|
450
442
|
arrowPointAtCenter: arrowPointAtCenter
|
|
451
|
-
}, /*#__PURE__*/
|
|
443
|
+
}, /*#__PURE__*/React.createElement(MoreOutlined, {
|
|
452
444
|
onClick: function onClick(e) {
|
|
453
445
|
if (rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled)) return;
|
|
454
446
|
setVisible(true);
|
|
@@ -473,9 +465,9 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
473
465
|
readOnly: readonly,
|
|
474
466
|
allowClear: allowClear,
|
|
475
467
|
ref: inputRef
|
|
476
|
-
}, fieldProps))) : /*#__PURE__*/
|
|
477
|
-
suffix: /*#__PURE__*/
|
|
478
|
-
content: /*#__PURE__*/
|
|
468
|
+
}, fieldProps))) : /*#__PURE__*/React.createElement(_Input, _extends({
|
|
469
|
+
suffix: /*#__PURE__*/React.createElement(_Popover, {
|
|
470
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
479
471
|
style: {
|
|
480
472
|
width: tableWidth + 'px',
|
|
481
473
|
height: tableHeight + 'px',
|
|
@@ -495,7 +487,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
495
487
|
getPopupContainer: getPopupContainer,
|
|
496
488
|
placement: placement,
|
|
497
489
|
arrowPointAtCenter: arrowPointAtCenter
|
|
498
|
-
}, /*#__PURE__*/
|
|
490
|
+
}, /*#__PURE__*/React.createElement(MoreOutlined, {
|
|
499
491
|
onClick: function onClick(e) {
|
|
500
492
|
if (rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled)) return;
|
|
501
493
|
setVisible(true);
|
|
@@ -523,5 +515,4 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
523
515
|
ref: inputRef
|
|
524
516
|
}, fieldProps)));
|
|
525
517
|
});
|
|
526
|
-
|
|
527
|
-
exports.default = _default;
|
|
518
|
+
export default InputTable;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
require("antd/es/spin/style");
|
|
10
|
-
var _spin = _interopRequireDefault(require("antd/es/spin"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
require("./common.less");
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import "antd/es/spin/style";
|
|
3
|
+
import _Spin from "antd/es/spin";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
14
5
|
var _excluded = ["Text", "className"];
|
|
15
|
-
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import './common.less';
|
|
8
|
+
export default (function (props) {
|
|
16
9
|
var _props$Text = props.Text,
|
|
17
10
|
Text = _props$Text === void 0 ? '加载中...' : _props$Text,
|
|
18
11
|
className = props.className,
|
|
19
|
-
rest = (
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
20
13
|
var cls = "loading";
|
|
21
14
|
if (className) {
|
|
22
15
|
cls += " " + className;
|
|
23
16
|
}
|
|
24
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
25
18
|
className: cls
|
|
26
|
-
}, rest), " ", /*#__PURE__*/
|
|
27
|
-
};
|
|
28
|
-
exports.default = _default;
|
|
19
|
+
}, rest), " ", /*#__PURE__*/React.createElement(_Spin, null), Text);
|
|
20
|
+
});
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _usePermission2 = _interopRequireDefault(require("../hooks/usePermission"));
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
11
2
|
var _excluded = ["children", "rightValue"];
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import usePermission from "../hooks/usePermission";
|
|
12
5
|
var Permission = function Permission(_ref) {
|
|
13
6
|
var children = _ref.children,
|
|
14
7
|
rightValue = _ref.rightValue,
|
|
15
|
-
rest = (
|
|
16
|
-
var _usePermission = (
|
|
8
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
var _usePermission = usePermission(),
|
|
17
10
|
checkRight = _usePermission.checkRight;
|
|
18
|
-
return checkRight(rightValue) ? /*#__PURE__*/
|
|
11
|
+
return checkRight(rightValue) ? /*#__PURE__*/React.createElement(React.Fragment, rest, children) : null;
|
|
19
12
|
};
|
|
20
|
-
|
|
21
|
-
exports.default = _default;
|
|
13
|
+
export default Permission;
|