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
|
@@ -15,6 +15,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
15
|
var _icons = require("@ant-design/icons");
|
|
16
16
|
require("./common.less");
|
|
17
17
|
var _usePermission2 = _interopRequireDefault(require("../hooks/usePermission"));
|
|
18
|
+
var _IconBack = _interopRequireDefault(require("./IconBack"));
|
|
18
19
|
function DtlLayout(props) {
|
|
19
20
|
var title = props.title,
|
|
20
21
|
_props$keyField = props.keyField,
|
|
@@ -64,7 +65,7 @@ function DtlLayout(props) {
|
|
|
64
65
|
onClick: function onClick() {
|
|
65
66
|
return props.onExit(false);
|
|
66
67
|
},
|
|
67
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
68
|
+
icon: /*#__PURE__*/_react.default.createElement(_IconBack.default, null)
|
|
68
69
|
}, btnExitText);
|
|
69
70
|
var btnList = [back];
|
|
70
71
|
// 有新增或更改权限且未审核,开放出保存按钮
|
|
@@ -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;
|
|
@@ -30,7 +30,7 @@ var _lsProForm = require("ls-pro-form");
|
|
|
30
30
|
var _icons = require("@ant-design/icons");
|
|
31
31
|
var _http = require("../http");
|
|
32
32
|
var _utils = require("../utils");
|
|
33
|
-
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps", "code", "isInput", "desc", "imageClass"];
|
|
33
|
+
var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps", "code", "isInput", "desc", "imageClass", "maxCount"];
|
|
34
34
|
var fileCenter = (0, _utils.getCache)('ossPath') || '/petrel/petrel-file-center-api/lesoon/oss/file/';
|
|
35
35
|
function ImageSelector(prop) {
|
|
36
36
|
var _rest$fieldProps3;
|
|
@@ -81,6 +81,8 @@ function ImageSelector(prop) {
|
|
|
81
81
|
desc = _prop$desc === void 0 ? '支持 png | jpg | gif 格式图片' : _prop$desc,
|
|
82
82
|
_prop$imageClass = prop.imageClass,
|
|
83
83
|
imageClass = _prop$imageClass === void 0 ? '' : _prop$imageClass,
|
|
84
|
+
_prop$maxCount = prop.maxCount,
|
|
85
|
+
maxCount = _prop$maxCount === void 0 ? 1 : _prop$maxCount,
|
|
84
86
|
rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
|
|
85
87
|
// 上传地址
|
|
86
88
|
var uploadImgApi = (0, _react.useMemo)(function () {
|
|
@@ -94,6 +96,10 @@ function ImageSelector(prop) {
|
|
|
94
96
|
var showImgApi = (0, _react.useMemo)(function () {
|
|
95
97
|
return fileCenter + 'show/' + code;
|
|
96
98
|
}, [code]);
|
|
99
|
+
var _useState11 = (0, _react.useState)([]),
|
|
100
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
101
|
+
selectedUrl = _useState12[0],
|
|
102
|
+
setSelectedUrl = _useState12[1];
|
|
97
103
|
var loadData = /*#__PURE__*/function () {
|
|
98
104
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(keys) {
|
|
99
105
|
var _result$data, _result$data2;
|
|
@@ -150,8 +156,14 @@ function ImageSelector(prop) {
|
|
|
150
156
|
}, [visible, searchKey]);
|
|
151
157
|
(0, _react.useEffect)(function () {
|
|
152
158
|
var val = formRef.current.getFieldsValue();
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
var url = val === null || val === void 0 ? void 0 : val[name];
|
|
160
|
+
if (!url) {
|
|
161
|
+
url = formRef.current.getFieldValue(name);
|
|
162
|
+
}
|
|
163
|
+
if (url) {
|
|
164
|
+
var urls = url.toString().split(',');
|
|
165
|
+
setImgUrl(urls[0]);
|
|
166
|
+
setSelectedUrl(urls);
|
|
155
167
|
}
|
|
156
168
|
}, []);
|
|
157
169
|
// 验证上传文件大小
|
|
@@ -215,6 +227,28 @@ function ImageSelector(prop) {
|
|
|
215
227
|
}
|
|
216
228
|
} catch (e) {}
|
|
217
229
|
}, [imgUrl]);
|
|
230
|
+
var toggleSelectImage = function toggleSelectImage(url) {
|
|
231
|
+
if (selectedUrl.includes(url)) {
|
|
232
|
+
setSelectedUrl(function (val) {
|
|
233
|
+
return val.filter(function (o) {
|
|
234
|
+
return o !== url;
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
} else if (selectedUrl.length < maxCount && maxCount > 1) {
|
|
238
|
+
setSelectedUrl([].concat((0, _toConsumableArray2.default)(selectedUrl), [url]));
|
|
239
|
+
} else if (maxCount === 1) {
|
|
240
|
+
setSelectedUrl([url]);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
var confirmImage = function confirmImage() {
|
|
244
|
+
var formVal = formRef.current.getFieldsValue();
|
|
245
|
+
var val = (0, _objectSpread2.default)({}, formVal);
|
|
246
|
+
//@ts-ignore
|
|
247
|
+
val[name] = selectedUrl.join(',');
|
|
248
|
+
formRef.current.setFieldsValue(val);
|
|
249
|
+
setImgUrl(selectedUrl.join(','));
|
|
250
|
+
setVisible(false);
|
|
251
|
+
};
|
|
218
252
|
var clearValue = function clearValue(e) {
|
|
219
253
|
if (!e || !e.target.value) {
|
|
220
254
|
var _formRef$current;
|
|
@@ -232,7 +266,7 @@ function ImageSelector(prop) {
|
|
|
232
266
|
maxWidth: 22,
|
|
233
267
|
maxHeight: 22
|
|
234
268
|
},
|
|
235
|
-
src: imgUrl,
|
|
269
|
+
src: (imgUrl || '').split(',')[0],
|
|
236
270
|
onClick: function onClick() {
|
|
237
271
|
return showSelect();
|
|
238
272
|
}
|
|
@@ -266,7 +300,7 @@ function ImageSelector(prop) {
|
|
|
266
300
|
className: "img-wrapper"
|
|
267
301
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
268
302
|
className: "img-preview ".concat(imageClass),
|
|
269
|
-
src: imgUrl
|
|
303
|
+
src: (imgUrl || '').split(',')[0]
|
|
270
304
|
}), (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.default.createElement("div", {
|
|
271
305
|
className: "clear-btn"
|
|
272
306
|
}, /*#__PURE__*/_react.default.createElement(_icons.CloseOutlined, {
|
|
@@ -337,11 +371,19 @@ function ImageSelector(prop) {
|
|
|
337
371
|
onClick: function onClick() {
|
|
338
372
|
return loadData(searchKey);
|
|
339
373
|
}
|
|
340
|
-
}, nextMarker ? '加载更多' : '刷新')
|
|
341
|
-
|
|
374
|
+
}, nextMarker ? '加载更多' : '刷新'), maxCount > 1 && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
375
|
+
onClick: confirmImage
|
|
376
|
+
}, "\u786E\u8BA4")),
|
|
377
|
+
getContainer: function getContainer() {
|
|
378
|
+
return document.body;
|
|
379
|
+
}
|
|
342
380
|
}, modalProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
343
381
|
style: {
|
|
344
|
-
minHeight: '120px'
|
|
382
|
+
minHeight: '120px',
|
|
383
|
+
display: 'flex',
|
|
384
|
+
marginLeft: 16,
|
|
385
|
+
gap: 16,
|
|
386
|
+
flexWrap: 'wrap'
|
|
345
387
|
}
|
|
346
388
|
}, list.map(function (o) {
|
|
347
389
|
return /*#__PURE__*/_react.default.createElement(_card.default, {
|
|
@@ -349,9 +391,8 @@ function ImageSelector(prop) {
|
|
|
349
391
|
style: {
|
|
350
392
|
width: '125px',
|
|
351
393
|
height: '130px',
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
verticalAlign: 'middle'
|
|
394
|
+
verticalAlign: 'middle',
|
|
395
|
+
background: selectedUrl.includes(o.url) ? '#efefef' : '#fff'
|
|
355
396
|
},
|
|
356
397
|
bodyStyle: {
|
|
357
398
|
padding: '15px 8px',
|
|
@@ -368,8 +409,12 @@ function ImageSelector(prop) {
|
|
|
368
409
|
val[name] = o.url;
|
|
369
410
|
formRef.current.setFieldsValue(val);
|
|
370
411
|
setImgUrl(o.url);
|
|
412
|
+
setSelectedUrl([o.url]);
|
|
371
413
|
setVisible(false);
|
|
372
414
|
},
|
|
415
|
+
onClick: function onClick() {
|
|
416
|
+
toggleSelectImage(o.url);
|
|
417
|
+
},
|
|
373
418
|
key: o.path
|
|
374
419
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
375
420
|
style: {
|
|
@@ -381,7 +426,7 @@ function ImageSelector(prop) {
|
|
|
381
426
|
maxWidth: '80px',
|
|
382
427
|
maxHeight: '80px'
|
|
383
428
|
},
|
|
384
|
-
src:
|
|
429
|
+
src: o.url
|
|
385
430
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
386
431
|
style: {
|
|
387
432
|
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为查询条件对象,可以通过此方法调整 */
|
|
@@ -15,6 +15,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
15
15
|
require("antd/es/button/style");
|
|
16
16
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
17
17
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
19
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
20
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
20
21
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -24,7 +25,7 @@ var _lsProForm = require("ls-pro-form");
|
|
|
24
25
|
var _icons = require("@ant-design/icons");
|
|
25
26
|
var _http = require("../http");
|
|
26
27
|
var _utils = require("../utils");
|
|
27
|
-
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"],
|
|
28
|
+
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"],
|
|
28
29
|
_excluded2 = ["current", "pageSize"];
|
|
29
30
|
var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
30
31
|
//@ts-ignore
|
|
@@ -87,6 +88,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
87
88
|
placement = _prop$placement === void 0 ? 'bottom' : _prop$placement,
|
|
88
89
|
_prop$arrowPointAtCen = prop.arrowPointAtCenter,
|
|
89
90
|
arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
|
|
91
|
+
rowKey = prop.rowKey,
|
|
90
92
|
rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
|
|
91
93
|
//显示输入框绑定的name,如果不设置textName,设置为$name__text
|
|
92
94
|
var textNameProp = (0, _react.useMemo)(function () {
|
|
@@ -164,20 +166,35 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
164
166
|
// 初始化数据
|
|
165
167
|
(0, _react.useEffect)(function () {
|
|
166
168
|
setTimeout(function () {
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
var txt = '',
|
|
170
|
+
val = '';
|
|
171
|
+
if (rowKey) {
|
|
172
|
+
try {
|
|
173
|
+
var _formRef$current, _formRef$current$getF;
|
|
174
|
+
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];
|
|
175
|
+
txt = row === null || row === void 0 ? void 0 : row[textNameProp];
|
|
176
|
+
val = row === null || row === void 0 ? void 0 : row[name];
|
|
177
|
+
} catch (_unused) {}
|
|
178
|
+
} else {
|
|
179
|
+
var _formRef$current2, _formRef$current3;
|
|
180
|
+
txt = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldValue(textNameProp);
|
|
181
|
+
val = formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.getFieldValue(name);
|
|
182
|
+
}
|
|
170
183
|
if (txt) {
|
|
171
184
|
setText(txt);
|
|
172
185
|
} else if (val) {
|
|
173
186
|
setText(val);
|
|
174
187
|
}
|
|
175
188
|
}, 0);
|
|
176
|
-
}, []);
|
|
189
|
+
}, [rowKey]);
|
|
177
190
|
// 处理返回数据
|
|
178
191
|
var handleValue = function handleValue(row) {
|
|
179
|
-
var _formRef$
|
|
180
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
192
|
+
var _formRef$current4;
|
|
193
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getFieldsValue();
|
|
194
|
+
if (rowKey) {
|
|
195
|
+
formValue = formValue[rowKey] || {};
|
|
196
|
+
}
|
|
197
|
+
if (!formValue) return;
|
|
181
198
|
var txt;
|
|
182
199
|
//支持多选
|
|
183
200
|
if (Array.isArray(row)) {
|
|
@@ -212,7 +229,12 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
212
229
|
formValue[textNameProp] = txt;
|
|
213
230
|
setText(txt);
|
|
214
231
|
setVisible(false);
|
|
215
|
-
(
|
|
232
|
+
if (rowKey) {
|
|
233
|
+
formRef.current.setFieldsValue((0, _defineProperty2.default)({}, rowKey, formValue));
|
|
234
|
+
} else {
|
|
235
|
+
var _formRef$current5;
|
|
236
|
+
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldsValue((0, _objectSpread2.default)({}, formValue));
|
|
237
|
+
}
|
|
216
238
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
217
239
|
};
|
|
218
240
|
// 可输入时,回车或失去焦点调接口查询数据
|
|
@@ -242,29 +264,39 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
242
264
|
};
|
|
243
265
|
//直接输入不回车,value 和 text 为同一个值
|
|
244
266
|
var onInput = function onInput(e) {
|
|
245
|
-
var _formRef$
|
|
246
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
267
|
+
var _formRef$current6;
|
|
268
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.getFieldsValue();
|
|
269
|
+
if (rowKey) {
|
|
270
|
+
formValue = formValue[rowKey] || {};
|
|
271
|
+
}
|
|
247
272
|
var val = e.target.value;
|
|
248
273
|
formValue[name] = val;
|
|
249
274
|
formValue[textNameProp] = val;
|
|
250
275
|
setText(val);
|
|
251
|
-
|
|
276
|
+
if (rowKey) {
|
|
277
|
+
formRef.current.setFieldsValue((0, _defineProperty2.default)({}, rowKey, formValue));
|
|
278
|
+
} else {
|
|
279
|
+
var _formRef$current7;
|
|
280
|
+
(_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : _formRef$current7.setFieldsValue((0, _objectSpread2.default)({}, formValue));
|
|
281
|
+
}
|
|
252
282
|
};
|
|
253
283
|
// 当表单重置或点clear时,处理值
|
|
254
284
|
var clearValue = function clearValue(e) {
|
|
255
285
|
if (!e.target.value) {
|
|
256
|
-
var _formRef$
|
|
286
|
+
var _formRef$current8;
|
|
257
287
|
setText('');
|
|
258
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
288
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : _formRef$current8.getFieldsValue();
|
|
289
|
+
if (rowKey) {
|
|
290
|
+
formValue = formValue[rowKey] || {};
|
|
291
|
+
}
|
|
259
292
|
formValue[name] = '';
|
|
260
293
|
formValue[textNameProp] = '';
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
formRef.current.setFieldsValue((0, _objectSpread2.default)({}, formValue));
|
|
294
|
+
if (rowKey) {
|
|
295
|
+
formRef.current.setFieldsValue((0, _defineProperty2.default)({}, rowKey, formValue));
|
|
296
|
+
} else {
|
|
297
|
+
var _formRef$current9;
|
|
298
|
+
(_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : _formRef$current9.setFieldsValue((0, _objectSpread2.default)({}, formValue));
|
|
299
|
+
}
|
|
268
300
|
}
|
|
269
301
|
};
|
|
270
302
|
(0, _react.useEffect)(function () {
|
|
@@ -275,12 +307,18 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
275
307
|
}
|
|
276
308
|
}, [text]);
|
|
277
309
|
var tableDom = /*#__PURE__*/_react.default.createElement(_lsProTable.default, (0, _extends2.default)({
|
|
310
|
+
className: "ls-input-table",
|
|
278
311
|
columns: columns,
|
|
279
312
|
request: loadData,
|
|
280
313
|
manualRequest: false,
|
|
281
314
|
actionRef: tableRef,
|
|
282
315
|
search: {
|
|
283
|
-
labelWidth: labelWidth
|
|
316
|
+
labelWidth: labelWidth,
|
|
317
|
+
optionRender: function optionRender(p, s, _dom) {
|
|
318
|
+
return _dom.filter(function (item) {
|
|
319
|
+
return item.key === 'submit';
|
|
320
|
+
});
|
|
321
|
+
}
|
|
284
322
|
},
|
|
285
323
|
options: {
|
|
286
324
|
density: false,
|
|
@@ -316,7 +354,13 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
316
354
|
}, "\u786E\u8BA4")];
|
|
317
355
|
},
|
|
318
356
|
headerTitle: "\u53CC\u51FB\u9009\u4E2D\u5F53\u524D\u884C\u6570\u636E"
|
|
319
|
-
}, tableConfig
|
|
357
|
+
}, tableConfig, {
|
|
358
|
+
cardProps: {
|
|
359
|
+
bodyStyle: {
|
|
360
|
+
padding: 0
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}));
|
|
320
364
|
// 处理有值时,可清空
|
|
321
365
|
(0, _react.useEffect)(function () {
|
|
322
366
|
if (rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled)) return;
|
|
@@ -349,6 +393,12 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
349
393
|
}
|
|
350
394
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
351
395
|
trigger: "click",
|
|
396
|
+
overlayInnerStyle: {
|
|
397
|
+
width: 'max-content'
|
|
398
|
+
},
|
|
399
|
+
overlayStyle: {
|
|
400
|
+
width: 'max-content'
|
|
401
|
+
},
|
|
352
402
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
353
403
|
onVisibleChange: setVisible,
|
|
354
404
|
getPopupContainer: getPopupContainer,
|
|
@@ -390,6 +440,12 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
390
440
|
}
|
|
391
441
|
}, loadOnShow ? visible ? tableDom : null : tableDom),
|
|
392
442
|
trigger: "click",
|
|
443
|
+
overlayInnerStyle: {
|
|
444
|
+
width: 'max-content'
|
|
445
|
+
},
|
|
446
|
+
overlayStyle: {
|
|
447
|
+
width: 'max-content'
|
|
448
|
+
},
|
|
393
449
|
visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
|
|
394
450
|
onVisibleChange: setVisible,
|
|
395
451
|
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
|
|
|
@@ -592,7 +592,6 @@ function useSingle(inParam) {
|
|
|
592
592
|
var tableTools = (0, _react.useMemo)(function () {
|
|
593
593
|
return [(toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.add) && canAdd ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
594
594
|
key: "add",
|
|
595
|
-
type: "primary",
|
|
596
595
|
onClick: function onClick() {
|
|
597
596
|
return onAdd(null);
|
|
598
597
|
},
|
package/lib/utils/index.d.ts
CHANGED