ls-pro-common 3.0.3 → 3.0.5
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 +74 -24
- package/dist/common.js +1 -1
- package/dist/common.min.css +74 -24
- package/dist/common.min.js +1 -1
- package/es/components/DtlLayout.js +3 -2
- package/es/components/ImageSelector.d.ts +6 -0
- package/es/components/ImageSelector.js +57 -12
- package/es/components/InputTable.d.ts +2 -0
- package/es/components/InputTable.js +78 -22
- package/es/components/antd-custom.less +19 -8
- package/es/components/common.less +52 -86
- package/es/hooks/useSingle/index.js +0 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +6 -0
- package/lib/components/DtlLayout.js +2 -1
- package/lib/components/ImageSelector.d.ts +6 -0
- package/lib/components/ImageSelector.js +57 -12
- package/lib/components/InputTable.d.ts +2 -0
- package/lib/components/InputTable.js +78 -22
- package/lib/components/antd-custom.less +19 -8
- package/lib/components/common.less +52 -86
- package/lib/hooks/useSingle/index.js +0 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +9 -2
- package/package.json +8 -8
|
@@ -4,9 +4,10 @@ import "antd/es/button/style";
|
|
|
4
4
|
import _Button from "antd/es/button";
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import { SaveOutlined, AuditOutlined
|
|
7
|
+
import { SaveOutlined, AuditOutlined } from '@ant-design/icons';
|
|
8
8
|
import './common.less';
|
|
9
9
|
import usePermission from '../hooks/usePermission';
|
|
10
|
+
import IconBack from './IconBack';
|
|
10
11
|
function DtlLayout(props) {
|
|
11
12
|
var title = props.title,
|
|
12
13
|
_props$keyField = props.keyField,
|
|
@@ -56,7 +57,7 @@ function DtlLayout(props) {
|
|
|
56
57
|
onClick: function onClick() {
|
|
57
58
|
return props.onExit(false);
|
|
58
59
|
},
|
|
59
|
-
icon: /*#__PURE__*/React.createElement(
|
|
60
|
+
icon: /*#__PURE__*/React.createElement(IconBack, null)
|
|
60
61
|
}, btnExitText);
|
|
61
62
|
var btnList = [back];
|
|
62
63
|
// 有新增或更改权限且未审核,开放出保存按钮
|
|
@@ -16,10 +16,16 @@ export declare type ImageSelectorProps = ProFormItemProps<InputProps> & {
|
|
|
16
16
|
* @name 最大值, 默认2M
|
|
17
17
|
*/
|
|
18
18
|
maxSize?: number;
|
|
19
|
+
/**弹框的属性 */
|
|
19
20
|
modalProps?: ModalProps;
|
|
21
|
+
/**是否输入框模式 */
|
|
20
22
|
isInput?: boolean;
|
|
23
|
+
/**非输入框模式上传提示语 默认为:支持 png | jpg | gif 格式图片 */
|
|
21
24
|
desc?: string;
|
|
25
|
+
/** 非输入框模式下 展示图片class */
|
|
22
26
|
imageClass?: string;
|
|
27
|
+
/** 一次最多选择多少张图片 默认为 1 */
|
|
28
|
+
maxCount?: number;
|
|
23
29
|
};
|
|
24
30
|
declare function ImageSelector(prop: ImageSelectorProps): JSX.Element;
|
|
25
31
|
export default ImageSelector;
|
|
@@ -16,7 +16,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
16
16
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
17
17
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
18
18
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
19
|
-
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps", "code", "isInput", "desc", "imageClass"];
|
|
19
|
+
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps", "code", "isInput", "desc", "imageClass", "maxCount"];
|
|
20
20
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
21
21
|
import React from "react";
|
|
22
22
|
import { useMemo, useState, useEffect, useContext, useRef } from 'react';
|
|
@@ -74,6 +74,8 @@ function ImageSelector(prop) {
|
|
|
74
74
|
desc = _prop$desc === void 0 ? '支持 png | jpg | gif 格式图片' : _prop$desc,
|
|
75
75
|
_prop$imageClass = prop.imageClass,
|
|
76
76
|
imageClass = _prop$imageClass === void 0 ? '' : _prop$imageClass,
|
|
77
|
+
_prop$maxCount = prop.maxCount,
|
|
78
|
+
maxCount = _prop$maxCount === void 0 ? 1 : _prop$maxCount,
|
|
77
79
|
rest = _objectWithoutProperties(prop, _excluded);
|
|
78
80
|
// 上传地址
|
|
79
81
|
var uploadImgApi = useMemo(function () {
|
|
@@ -87,6 +89,10 @@ function ImageSelector(prop) {
|
|
|
87
89
|
var showImgApi = useMemo(function () {
|
|
88
90
|
return fileCenter + 'show/' + code;
|
|
89
91
|
}, [code]);
|
|
92
|
+
var _useState11 = useState([]),
|
|
93
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
94
|
+
selectedUrl = _useState12[0],
|
|
95
|
+
setSelectedUrl = _useState12[1];
|
|
90
96
|
var loadData = /*#__PURE__*/function () {
|
|
91
97
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(keys) {
|
|
92
98
|
var _result$data, _result$data2;
|
|
@@ -143,8 +149,14 @@ function ImageSelector(prop) {
|
|
|
143
149
|
}, [visible, searchKey]);
|
|
144
150
|
useEffect(function () {
|
|
145
151
|
var val = formRef.current.getFieldsValue();
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
var url = val === null || val === void 0 ? void 0 : val[name];
|
|
153
|
+
if (!url) {
|
|
154
|
+
url = formRef.current.getFieldValue(name);
|
|
155
|
+
}
|
|
156
|
+
if (url) {
|
|
157
|
+
var urls = url.toString().split(',');
|
|
158
|
+
setImgUrl(urls[0]);
|
|
159
|
+
setSelectedUrl(urls);
|
|
148
160
|
}
|
|
149
161
|
}, []);
|
|
150
162
|
// 验证上传文件大小
|
|
@@ -208,6 +220,28 @@ function ImageSelector(prop) {
|
|
|
208
220
|
}
|
|
209
221
|
} catch (e) {}
|
|
210
222
|
}, [imgUrl]);
|
|
223
|
+
var toggleSelectImage = function toggleSelectImage(url) {
|
|
224
|
+
if (selectedUrl.includes(url)) {
|
|
225
|
+
setSelectedUrl(function (val) {
|
|
226
|
+
return val.filter(function (o) {
|
|
227
|
+
return o !== url;
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
} else if (selectedUrl.length < maxCount && maxCount > 1) {
|
|
231
|
+
setSelectedUrl([].concat(_toConsumableArray(selectedUrl), [url]));
|
|
232
|
+
} else if (maxCount === 1) {
|
|
233
|
+
setSelectedUrl([url]);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
var confirmImage = function confirmImage() {
|
|
237
|
+
var formVal = formRef.current.getFieldsValue();
|
|
238
|
+
var val = _objectSpread({}, formVal);
|
|
239
|
+
//@ts-ignore
|
|
240
|
+
val[name] = selectedUrl.join(',');
|
|
241
|
+
formRef.current.setFieldsValue(val);
|
|
242
|
+
setImgUrl(selectedUrl.join(','));
|
|
243
|
+
setVisible(false);
|
|
244
|
+
};
|
|
211
245
|
var clearValue = function clearValue(e) {
|
|
212
246
|
if (!e || !e.target.value) {
|
|
213
247
|
var _formRef$current;
|
|
@@ -225,7 +259,7 @@ function ImageSelector(prop) {
|
|
|
225
259
|
maxWidth: 22,
|
|
226
260
|
maxHeight: 22
|
|
227
261
|
},
|
|
228
|
-
src: imgUrl,
|
|
262
|
+
src: (imgUrl || '').split(',')[0],
|
|
229
263
|
onClick: function onClick() {
|
|
230
264
|
return showSelect();
|
|
231
265
|
}
|
|
@@ -259,7 +293,7 @@ function ImageSelector(prop) {
|
|
|
259
293
|
className: "img-wrapper"
|
|
260
294
|
}, /*#__PURE__*/React.createElement("img", {
|
|
261
295
|
className: "img-preview ".concat(imageClass),
|
|
262
|
-
src: imgUrl
|
|
296
|
+
src: (imgUrl || '').split(',')[0]
|
|
263
297
|
}), (rest === null || rest === void 0 ? void 0 : rest.disabled) !== true && (rest === null || rest === void 0 ? void 0 : (_rest$fieldProps3 = rest.fieldProps) === null || _rest$fieldProps3 === void 0 ? void 0 : _rest$fieldProps3.disabled) !== true && /*#__PURE__*/React.createElement("div", {
|
|
264
298
|
className: "clear-btn"
|
|
265
299
|
}, /*#__PURE__*/React.createElement(CloseOutlined, {
|
|
@@ -330,11 +364,19 @@ function ImageSelector(prop) {
|
|
|
330
364
|
onClick: function onClick() {
|
|
331
365
|
return loadData(searchKey);
|
|
332
366
|
}
|
|
333
|
-
}, nextMarker ? '加载更多' : '刷新')
|
|
334
|
-
|
|
367
|
+
}, nextMarker ? '加载更多' : '刷新'), maxCount > 1 && /*#__PURE__*/React.createElement(_Button, {
|
|
368
|
+
onClick: confirmImage
|
|
369
|
+
}, "\u786E\u8BA4")),
|
|
370
|
+
getContainer: function getContainer() {
|
|
371
|
+
return document.body;
|
|
372
|
+
}
|
|
335
373
|
}, modalProps), /*#__PURE__*/React.createElement("div", {
|
|
336
374
|
style: {
|
|
337
|
-
minHeight: '120px'
|
|
375
|
+
minHeight: '120px',
|
|
376
|
+
display: 'flex',
|
|
377
|
+
marginLeft: 16,
|
|
378
|
+
gap: 16,
|
|
379
|
+
flexWrap: 'wrap'
|
|
338
380
|
}
|
|
339
381
|
}, list.map(function (o) {
|
|
340
382
|
return /*#__PURE__*/React.createElement(_Card, {
|
|
@@ -342,9 +384,8 @@ function ImageSelector(prop) {
|
|
|
342
384
|
style: {
|
|
343
385
|
width: '125px',
|
|
344
386
|
height: '130px',
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
verticalAlign: 'middle'
|
|
387
|
+
verticalAlign: 'middle',
|
|
388
|
+
background: selectedUrl.includes(o.url) ? '#efefef' : '#fff'
|
|
348
389
|
},
|
|
349
390
|
bodyStyle: {
|
|
350
391
|
padding: '15px 8px',
|
|
@@ -361,8 +402,12 @@ function ImageSelector(prop) {
|
|
|
361
402
|
val[name] = o.url;
|
|
362
403
|
formRef.current.setFieldsValue(val);
|
|
363
404
|
setImgUrl(o.url);
|
|
405
|
+
setSelectedUrl([o.url]);
|
|
364
406
|
setVisible(false);
|
|
365
407
|
},
|
|
408
|
+
onClick: function onClick() {
|
|
409
|
+
toggleSelectImage(o.url);
|
|
410
|
+
},
|
|
366
411
|
key: o.path
|
|
367
412
|
}, /*#__PURE__*/React.createElement("div", {
|
|
368
413
|
style: {
|
|
@@ -374,7 +419,7 @@ function ImageSelector(prop) {
|
|
|
374
419
|
maxWidth: '80px',
|
|
375
420
|
maxHeight: '80px'
|
|
376
421
|
},
|
|
377
|
-
src:
|
|
422
|
+
src: o.url
|
|
378
423
|
})), /*#__PURE__*/React.createElement("div", {
|
|
379
424
|
style: {
|
|
380
425
|
whiteSpace: 'nowrap',
|
|
@@ -39,6 +39,7 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
39
39
|
loadOnShow?: boolean;
|
|
40
40
|
placement?: TooltipPlacement;
|
|
41
41
|
arrowPointAtCenter?: boolean;
|
|
42
|
+
rowKey?: any;
|
|
42
43
|
/**@name 选择行事件 */
|
|
43
44
|
onSelectChange?: (item: any, formRef?: any) => void;
|
|
44
45
|
/**@name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
|
|
@@ -93,6 +94,7 @@ declare const InputTable: React.ForwardRefExoticComponent<{
|
|
|
93
94
|
loadOnShow?: boolean | undefined;
|
|
94
95
|
placement?: TooltipPlacement | undefined;
|
|
95
96
|
arrowPointAtCenter?: boolean | undefined;
|
|
97
|
+
rowKey?: any;
|
|
96
98
|
/**@name 选择行事件 */
|
|
97
99
|
onSelectChange?: ((item: any, formRef?: any) => void) | undefined;
|
|
98
100
|
/**@name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
|
|
@@ -6,10 +6,11 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
6
6
|
import "antd/es/button/style";
|
|
7
7
|
import _Button from "antd/es/button";
|
|
8
8
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
9
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
10
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
10
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
11
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
|
-
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"],
|
|
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", "placement", "arrowPointAtCenter", "rowKey"],
|
|
13
14
|
_excluded2 = ["current", "pageSize"];
|
|
14
15
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
15
16
|
import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
|
|
@@ -79,6 +80,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
79
80
|
placement = _prop$placement === void 0 ? 'bottom' : _prop$placement,
|
|
80
81
|
_prop$arrowPointAtCen = prop.arrowPointAtCenter,
|
|
81
82
|
arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
|
|
83
|
+
rowKey = prop.rowKey,
|
|
82
84
|
rest = _objectWithoutProperties(prop, _excluded);
|
|
83
85
|
//显示输入框绑定的name,如果不设置textName,设置为$name__text
|
|
84
86
|
var textNameProp = useMemo(function () {
|
|
@@ -156,20 +158,35 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
156
158
|
// 初始化数据
|
|
157
159
|
useEffect(function () {
|
|
158
160
|
setTimeout(function () {
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
var txt = '',
|
|
162
|
+
val = '';
|
|
163
|
+
if (rowKey) {
|
|
164
|
+
try {
|
|
165
|
+
var _formRef$current, _formRef$current$getF;
|
|
166
|
+
var row = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue()) === null || _formRef$current$getF === void 0 ? void 0 : _formRef$current$getF[rowKey];
|
|
167
|
+
txt = row === null || row === void 0 ? void 0 : row[textNameProp];
|
|
168
|
+
val = row === null || row === void 0 ? void 0 : row[name];
|
|
169
|
+
} catch (_unused) {}
|
|
170
|
+
} else {
|
|
171
|
+
var _formRef$current2, _formRef$current3;
|
|
172
|
+
txt = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldValue(textNameProp);
|
|
173
|
+
val = formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.getFieldValue(name);
|
|
174
|
+
}
|
|
162
175
|
if (txt) {
|
|
163
176
|
setText(txt);
|
|
164
177
|
} else if (val) {
|
|
165
178
|
setText(val);
|
|
166
179
|
}
|
|
167
180
|
}, 0);
|
|
168
|
-
}, []);
|
|
181
|
+
}, [rowKey]);
|
|
169
182
|
// 处理返回数据
|
|
170
183
|
var handleValue = function handleValue(row) {
|
|
171
|
-
var _formRef$
|
|
172
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
184
|
+
var _formRef$current4;
|
|
185
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getFieldsValue();
|
|
186
|
+
if (rowKey) {
|
|
187
|
+
formValue = formValue[rowKey] || {};
|
|
188
|
+
}
|
|
189
|
+
if (!formValue) return;
|
|
173
190
|
var txt;
|
|
174
191
|
//支持多选
|
|
175
192
|
if (Array.isArray(row)) {
|
|
@@ -204,7 +221,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
204
221
|
formValue[textNameProp] = txt;
|
|
205
222
|
setText(txt);
|
|
206
223
|
setVisible(false);
|
|
207
|
-
(
|
|
224
|
+
if (rowKey) {
|
|
225
|
+
formRef.current.setFieldsValue(_defineProperty({}, rowKey, formValue));
|
|
226
|
+
} else {
|
|
227
|
+
var _formRef$current5;
|
|
228
|
+
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldsValue(_objectSpread({}, formValue));
|
|
229
|
+
}
|
|
208
230
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
209
231
|
};
|
|
210
232
|
// 可输入时,回车或失去焦点调接口查询数据
|
|
@@ -234,29 +256,39 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
234
256
|
};
|
|
235
257
|
//直接输入不回车,value 和 text 为同一个值
|
|
236
258
|
var onInput = function onInput(e) {
|
|
237
|
-
var _formRef$
|
|
238
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
259
|
+
var _formRef$current6;
|
|
260
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.getFieldsValue();
|
|
261
|
+
if (rowKey) {
|
|
262
|
+
formValue = formValue[rowKey] || {};
|
|
263
|
+
}
|
|
239
264
|
var val = e.target.value;
|
|
240
265
|
formValue[name] = val;
|
|
241
266
|
formValue[textNameProp] = val;
|
|
242
267
|
setText(val);
|
|
243
|
-
|
|
268
|
+
if (rowKey) {
|
|
269
|
+
formRef.current.setFieldsValue(_defineProperty({}, rowKey, formValue));
|
|
270
|
+
} else {
|
|
271
|
+
var _formRef$current7;
|
|
272
|
+
(_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : _formRef$current7.setFieldsValue(_objectSpread({}, formValue));
|
|
273
|
+
}
|
|
244
274
|
};
|
|
245
275
|
// 当表单重置或点clear时,处理值
|
|
246
276
|
var clearValue = function clearValue(e) {
|
|
247
277
|
if (!e.target.value) {
|
|
248
|
-
var _formRef$
|
|
278
|
+
var _formRef$current8;
|
|
249
279
|
setText('');
|
|
250
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
280
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : _formRef$current8.getFieldsValue();
|
|
281
|
+
if (rowKey) {
|
|
282
|
+
formValue = formValue[rowKey] || {};
|
|
283
|
+
}
|
|
251
284
|
formValue[name] = '';
|
|
252
285
|
formValue[textNameProp] = '';
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
formRef.current.setFieldsValue(_objectSpread({}, formValue));
|
|
286
|
+
if (rowKey) {
|
|
287
|
+
formRef.current.setFieldsValue(_defineProperty({}, rowKey, formValue));
|
|
288
|
+
} else {
|
|
289
|
+
var _formRef$current9;
|
|
290
|
+
(_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : _formRef$current9.setFieldsValue(_objectSpread({}, formValue));
|
|
291
|
+
}
|
|
260
292
|
}
|
|
261
293
|
};
|
|
262
294
|
useEffect(function () {
|
|
@@ -267,12 +299,18 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
267
299
|
}
|
|
268
300
|
}, [text]);
|
|
269
301
|
var tableDom = /*#__PURE__*/React.createElement(ProTable, _extends({
|
|
302
|
+
className: "ls-input-table",
|
|
270
303
|
columns: columns,
|
|
271
304
|
request: loadData,
|
|
272
305
|
manualRequest: false,
|
|
273
306
|
actionRef: tableRef,
|
|
274
307
|
search: {
|
|
275
|
-
labelWidth: labelWidth
|
|
308
|
+
labelWidth: labelWidth,
|
|
309
|
+
optionRender: function optionRender(p, s, _dom) {
|
|
310
|
+
return _dom.filter(function (item) {
|
|
311
|
+
return item.key === 'submit';
|
|
312
|
+
});
|
|
313
|
+
}
|
|
276
314
|
},
|
|
277
315
|
options: {
|
|
278
316
|
density: false,
|
|
@@ -308,7 +346,13 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
308
346
|
}, "\u786E\u8BA4")];
|
|
309
347
|
},
|
|
310
348
|
headerTitle: "\u53CC\u51FB\u9009\u4E2D\u5F53\u524D\u884C\u6570\u636E"
|
|
311
|
-
}, tableConfig
|
|
349
|
+
}, tableConfig, {
|
|
350
|
+
cardProps: {
|
|
351
|
+
bodyStyle: {
|
|
352
|
+
padding: 0
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}));
|
|
312
356
|
// 处理有值时,可清空
|
|
313
357
|
useEffect(function () {
|
|
314
358
|
if (rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled)) return;
|
|
@@ -341,6 +385,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
341
385
|
}
|
|
342
386
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
343
387
|
trigger: "click",
|
|
388
|
+
overlayInnerStyle: {
|
|
389
|
+
width: 'max-content'
|
|
390
|
+
},
|
|
391
|
+
overlayStyle: {
|
|
392
|
+
width: 'max-content'
|
|
393
|
+
},
|
|
344
394
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
345
395
|
onVisibleChange: setVisible,
|
|
346
396
|
getPopupContainer: getPopupContainer,
|
|
@@ -382,6 +432,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
382
432
|
}
|
|
383
433
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
384
434
|
trigger: "click",
|
|
435
|
+
overlayInnerStyle: {
|
|
436
|
+
width: 'max-content'
|
|
437
|
+
},
|
|
438
|
+
overlayStyle: {
|
|
439
|
+
width: 'max-content'
|
|
440
|
+
},
|
|
385
441
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
386
442
|
onVisibleChange: setVisible,
|
|
387
443
|
getPopupContainer: getPopupContainer,
|
|
@@ -34,8 +34,11 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.ant-modal-content {
|
|
37
|
-
border-radius
|
|
38
|
-
|
|
37
|
+
border-radius: 8px !important;
|
|
38
|
+
|
|
39
|
+
.ant-modal-header {
|
|
40
|
+
border-radius: 8px 8px 0 0 !important;
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
.ant-input-number,
|
|
@@ -45,6 +48,11 @@
|
|
|
45
48
|
border-radius: 4px !important;
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
.ant-input-group .ant-input-affix-wrapper:not(:last-child) {
|
|
52
|
+
border-top-right-radius : 0 !important;
|
|
53
|
+
border-bottom-right-radius: 0 !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
.ant-picker-range-separator {
|
|
49
57
|
padding: 0 2px !important;
|
|
50
58
|
|
|
@@ -58,7 +66,7 @@
|
|
|
58
66
|
height : 32px;
|
|
59
67
|
background-color: #E6F4FF;
|
|
60
68
|
border-color : transparent;
|
|
61
|
-
color :
|
|
69
|
+
color : var(--ant-primary-color);
|
|
62
70
|
border-radius : 4px;
|
|
63
71
|
|
|
64
72
|
&.ant-btn-lg {
|
|
@@ -67,15 +75,15 @@
|
|
|
67
75
|
|
|
68
76
|
&:hover,
|
|
69
77
|
&:focus {
|
|
70
|
-
background-color: #
|
|
78
|
+
background-color: #B5DBFF;
|
|
71
79
|
border-color : transparent;
|
|
72
|
-
color :
|
|
80
|
+
color : var(--ant-primary-color);
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
&:active {
|
|
76
84
|
background-color: #BDDFFF;
|
|
77
85
|
border-color : transparent;
|
|
78
|
-
color :
|
|
86
|
+
color : var(--ant-primary-color);
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
&[disabled],
|
|
@@ -88,8 +96,6 @@
|
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
98
|
|
|
91
|
-
|
|
92
|
-
|
|
93
99
|
.ant-btn-primary {
|
|
94
100
|
background-color: var(--ant-primary-color);
|
|
95
101
|
border-color : transparent;
|
|
@@ -210,4 +216,9 @@
|
|
|
210
216
|
&[disabled]:active {
|
|
211
217
|
color: #d9d9d9;
|
|
212
218
|
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ant-checkbox-checked::after {
|
|
222
|
+
animation : none !important;
|
|
223
|
+
animation-fill-mode: none !important;
|
|
213
224
|
}
|
|
@@ -1,98 +1,57 @@
|
|
|
1
1
|
body {
|
|
2
2
|
|
|
3
|
-
--bg-color
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
--ant-primary-color
|
|
7
|
-
--ant-primary-color-hover
|
|
8
|
-
--ant-primary-color-active
|
|
9
|
-
--ant-primary-color-outline
|
|
10
|
-
--ant-primary-1
|
|
11
|
-
--ant-primary-2
|
|
12
|
-
--ant-primary-3
|
|
13
|
-
--ant-primary-4
|
|
14
|
-
--ant-primary-5
|
|
15
|
-
--ant-primary-6
|
|
16
|
-
--ant-primary-7
|
|
17
|
-
--ant-primary-color-deprecated-pure
|
|
18
|
-
--ant-primary-color-deprecated-l-35
|
|
19
|
-
--ant-primary-color-deprecated-l-20
|
|
20
|
-
--ant-primary-color-deprecated-t-20
|
|
21
|
-
--ant-primary-color-deprecated-t-50
|
|
22
|
-
--ant-primary-color-deprecated-f-12
|
|
3
|
+
--bg-color: #F9FAFB;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
--ant-primary-color: #1869ED;
|
|
7
|
+
--ant-primary-color-hover: #418efa;
|
|
8
|
+
--ant-primary-color-active: #0a4cc7;
|
|
9
|
+
--ant-primary-color-outline: rgba(24, 105, 237, 0.2);
|
|
10
|
+
--ant-primary-1: #e6f4ff;
|
|
11
|
+
--ant-primary-2: #bddfff;
|
|
12
|
+
--ant-primary-3: #94c8ff;
|
|
13
|
+
--ant-primary-4: #6baeff;
|
|
14
|
+
--ant-primary-5: #418efa;
|
|
15
|
+
--ant-primary-6: #1869ED;
|
|
16
|
+
--ant-primary-7: #0a4cc7;
|
|
17
|
+
--ant-primary-color-deprecated-pure: #bed5fa;
|
|
18
|
+
--ant-primary-color-deprecated-l-35: #bed5fa;
|
|
19
|
+
--ant-primary-color-deprecated-l-20: #77a6f4;
|
|
20
|
+
--ant-primary-color-deprecated-t-20: #4687f1;
|
|
21
|
+
--ant-primary-color-deprecated-t-50: #8cb4f6;
|
|
22
|
+
--ant-primary-color-deprecated-f-12: rgba(24, 105, 237, 0.12);
|
|
23
23
|
--ant-primary-color-active-deprecated-f-30: rgba(230, 244, 255, 0.3);
|
|
24
24
|
--ant-primary-color-active-deprecated-d-02: #dcf0ff;
|
|
25
|
-
--ant-success-color
|
|
26
|
-
--ant-success-color-hover
|
|
27
|
-
--ant-success-color-active
|
|
28
|
-
--ant-success-color-outline
|
|
29
|
-
--ant-success-color-deprecated-bg
|
|
30
|
-
--ant-success-color-deprecated-border
|
|
31
|
-
--ant-error-color
|
|
32
|
-
--ant-error-color-hover
|
|
33
|
-
--ant-error-color-active
|
|
34
|
-
--ant-error-color-outline
|
|
35
|
-
--ant-error-color-deprecated-bg
|
|
36
|
-
--ant-error-color-deprecated-border
|
|
37
|
-
--ant-warning-color
|
|
38
|
-
--ant-warning-color-hover
|
|
39
|
-
--ant-warning-color-active
|
|
40
|
-
--ant-warning-color-outline
|
|
41
|
-
--ant-warning-color-deprecated-bg
|
|
42
|
-
--ant-warning-color-deprecated-border
|
|
43
|
-
--ant-info-color
|
|
44
|
-
--ant-info-color-deprecated-bg
|
|
45
|
-
--ant-info-color-deprecated-border
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// --ant-primary-color : #4997E6;
|
|
49
|
-
// --ant-primary-color-hover : #74b7f2;
|
|
50
|
-
// --ant-primary-color-active : #3475bf;
|
|
51
|
-
// --ant-primary-color-outline : rgba(73, 151, 230, 0.2);
|
|
52
|
-
// --ant-primary-1 : #f0faff;
|
|
53
|
-
// --ant-primary-2 : #f0f9ff;
|
|
54
|
-
// --ant-primary-3 : #ccebff;
|
|
55
|
-
// --ant-primary-4 : #a3d7ff;
|
|
56
|
-
// --ant-primary-5 : #74b7f2;
|
|
57
|
-
// --ant-primary-6 : #4997E6;
|
|
58
|
-
// --ant-primary-7 : #3475bf;
|
|
59
|
-
// --ant-primary-color-deprecated-pure : #e6f1fc;
|
|
60
|
-
// --ant-primary-color-deprecated-l-35 : #e6f1fc;
|
|
61
|
-
// --ant-primary-color-deprecated-l-20 : #a3caf2;
|
|
62
|
-
// --ant-primary-color-deprecated-t-20 : #6daceb;
|
|
63
|
-
// --ant-primary-color-deprecated-t-50 : #a4cbf3;
|
|
64
|
-
// --ant-primary-color-deprecated-f-12 : rgba(73, 151, 230, 0.12);
|
|
65
|
-
// --ant-primary-color-active-deprecated-f-30: rgba(240, 250, 255, 0.3);
|
|
66
|
-
// --ant-primary-color-active-deprecated-d-02: #e6f7ff;
|
|
67
|
-
// --ant-success-color : #52c41a;
|
|
68
|
-
// --ant-success-color-hover : #73d13d;
|
|
69
|
-
// --ant-success-color-active : #389e0d;
|
|
70
|
-
// --ant-success-color-outline : rgba(82, 196, 26, 0.2);
|
|
71
|
-
// --ant-success-color-deprecated-bg : #f6ffed;
|
|
72
|
-
// --ant-success-color-deprecated-border : #b7eb8f;
|
|
73
|
-
// --ant-error-color : #ff4d4f;
|
|
74
|
-
// --ant-error-color-hover : #ff7875;
|
|
75
|
-
// --ant-error-color-active : #d9363e;
|
|
76
|
-
// --ant-error-color-outline : rgba(255, 77, 79, 0.2);
|
|
77
|
-
// --ant-error-color-deprecated-bg : #fff2f0;
|
|
78
|
-
// --ant-error-color-deprecated-border : #ffccc7;
|
|
79
|
-
// --ant-warning-color : #faad14;
|
|
80
|
-
// --ant-warning-color-hover : #ffc53d;
|
|
81
|
-
// --ant-warning-color-active : #d48806;
|
|
82
|
-
// --ant-warning-color-outline : rgba(250, 173, 20, 0.2);
|
|
83
|
-
// --ant-warning-color-deprecated-bg : #fffbe6;
|
|
84
|
-
// --ant-warning-color-deprecated-border : #ffe58f;
|
|
85
|
-
// --ant-info-color : #4997E6;
|
|
86
|
-
// --ant-info-color-deprecated-bg : #f0faff;
|
|
87
|
-
// --ant-info-color-deprecated-border : #ccebff;
|
|
25
|
+
--ant-success-color: #52c41a;
|
|
26
|
+
--ant-success-color-hover: #73d13d;
|
|
27
|
+
--ant-success-color-active: #389e0d;
|
|
28
|
+
--ant-success-color-outline: rgba(82, 196, 26, 0.2);
|
|
29
|
+
--ant-success-color-deprecated-bg: #f6ffed;
|
|
30
|
+
--ant-success-color-deprecated-border: #b7eb8f;
|
|
31
|
+
--ant-error-color: #ff4d4f;
|
|
32
|
+
--ant-error-color-hover: #ff7875;
|
|
33
|
+
--ant-error-color-active: #d9363e;
|
|
34
|
+
--ant-error-color-outline: rgba(255, 77, 79, 0.2);
|
|
35
|
+
--ant-error-color-deprecated-bg: #fff2f0;
|
|
36
|
+
--ant-error-color-deprecated-border: #ffccc7;
|
|
37
|
+
--ant-warning-color: #faad14;
|
|
38
|
+
--ant-warning-color-hover: #ffc53d;
|
|
39
|
+
--ant-warning-color-active: #d48806;
|
|
40
|
+
--ant-warning-color-outline: rgba(250, 173, 20, 0.2);
|
|
41
|
+
--ant-warning-color-deprecated-bg: #fffbe6;
|
|
42
|
+
--ant-warning-color-deprecated-border: #ffe58f;
|
|
43
|
+
--ant-info-color: #1869ED;
|
|
44
|
+
--ant-info-color-deprecated-bg: #e6f4ff;
|
|
45
|
+
--ant-info-color-deprecated-border: #94c8ff;
|
|
46
|
+
|
|
88
47
|
}
|
|
89
48
|
|
|
90
49
|
* ::-webkit-scrollbar-thumb {
|
|
91
|
-
background-color:
|
|
50
|
+
background-color: #EFF2F4;
|
|
92
51
|
border-radius : 6px;
|
|
93
52
|
|
|
94
53
|
&:hover {
|
|
95
|
-
background-color:
|
|
54
|
+
background-color: #E4E7EA;
|
|
96
55
|
border-radius : 6px;
|
|
97
56
|
}
|
|
98
57
|
}
|
|
@@ -176,7 +135,7 @@ body.theme-yellow {
|
|
|
176
135
|
left : 0;
|
|
177
136
|
right : 0;
|
|
178
137
|
bottom : 0;
|
|
179
|
-
background : var(--bg-color
|
|
138
|
+
background : var(--bg-color, #f9fafb);
|
|
180
139
|
display : flex;
|
|
181
140
|
flex-direction: column;
|
|
182
141
|
z-index : 50;
|
|
@@ -400,6 +359,7 @@ a:hover {
|
|
|
400
359
|
align-items : center;
|
|
401
360
|
background : #fff;
|
|
402
361
|
padding-bottom: 12px;
|
|
362
|
+
|
|
403
363
|
.ls-group-divider {
|
|
404
364
|
height : 14px;
|
|
405
365
|
border-right: 2px solid var(--ant-primary-color);
|
|
@@ -503,6 +463,12 @@ a:hover {
|
|
|
503
463
|
}
|
|
504
464
|
}
|
|
505
465
|
|
|
466
|
+
.ls-input-table {
|
|
467
|
+
.ant-pro-table-list-toolbar {
|
|
468
|
+
padding-top: 0px;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
506
472
|
|
|
507
473
|
@import url('./antd-custom.less');
|
|
508
474
|
|
|
@@ -585,7 +585,6 @@ function useSingle(inParam) {
|
|
|
585
585
|
var tableTools = useMemo(function () {
|
|
586
586
|
return [(toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.add) && canAdd ? /*#__PURE__*/React.createElement(_Button, {
|
|
587
587
|
key: "add",
|
|
588
|
-
type: "primary",
|
|
589
588
|
onClick: function onClick() {
|
|
590
589
|
return onAdd(null);
|
|
591
590
|
},
|
package/es/utils/index.d.ts
CHANGED
package/es/utils/index.js
CHANGED
|
@@ -662,4 +662,10 @@ export var exitLoading = function exitLoading() {
|
|
|
662
662
|
var _loading$parentNode;
|
|
663
663
|
(_loading$parentNode = loading.parentNode) === null || _loading$parentNode === void 0 ? void 0 : _loading$parentNode.removeChild(loading);
|
|
664
664
|
}
|
|
665
|
+
};
|
|
666
|
+
export var handleTheme = function handleTheme() {
|
|
667
|
+
var theme = getCache('theme');
|
|
668
|
+
if (theme) {
|
|
669
|
+
document.body.classList.add('theme-' + theme);
|
|
670
|
+
}
|
|
665
671
|
};
|