ls-pro-common 3.0.27 → 3.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/404.d.ts +1 -1
- package/es/components/404.js +4 -3
- package/es/components/IconBack.d.ts +3 -1
- package/es/components/IconBell.d.ts +3 -1
- package/es/components/IconQuestion.d.ts +3 -1
- package/es/components/IconSearch.d.ts +3 -1
- package/es/components/IconText.d.ts +3 -1
- package/es/components/InputTable.js +30 -24
- package/es/components/Loading.d.ts +1 -0
- package/es/utils/index.js +4 -1
- package/lib/components/404.d.ts +1 -1
- package/lib/components/404.js +4 -3
- package/lib/components/IconBack.d.ts +3 -1
- package/lib/components/IconBell.d.ts +3 -1
- package/lib/components/IconQuestion.d.ts +3 -1
- package/lib/components/IconSearch.d.ts +3 -1
- package/lib/components/IconText.d.ts +3 -1
- package/lib/components/InputTable.js +32 -26
- package/lib/components/Loading.d.ts +1 -0
- package/lib/utils/index.js +4 -1
- package/package.json +2 -2
package/es/components/404.d.ts
CHANGED
package/es/components/404.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import './common.less';
|
|
3
|
-
export default (function () {
|
|
4
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
4
|
+
export default (function (props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
5
6
|
className: "page404"
|
|
6
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
7
|
+
}, props), /*#__PURE__*/React.createElement("img", {
|
|
7
8
|
src: require('./404.jpg')
|
|
8
9
|
}), " \u60A8\u8BBF\u95EE\u7684\u8D44\u6E90\u4E0D\u5B58\u5728~~");
|
|
9
10
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconBack: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconBack: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconBack;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconBell: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconBell: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconBell;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconQuestion: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconQuestion: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconQuestion;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconSearch: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconSearch: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconSearch;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconText: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconText: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconText;
|
|
@@ -194,12 +194,13 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
194
194
|
setTimeout(function () {
|
|
195
195
|
var txt = '',
|
|
196
196
|
val = '';
|
|
197
|
+
var row;
|
|
197
198
|
if (rowKey) {
|
|
198
199
|
try {
|
|
199
|
-
var _formRef$current2, _formRef$current2$get, _formRef$current2$get2;
|
|
200
|
-
|
|
201
|
-
txt = row === null ||
|
|
202
|
-
val = row === null ||
|
|
200
|
+
var _formRef$current2, _formRef$current2$get, _formRef$current2$get2, _row, _row2;
|
|
201
|
+
row = 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$get2 = _formRef$current2$get.call(_formRef$current2)) === null || _formRef$current2$get2 === void 0 ? void 0 : _formRef$current2$get2[rowKey];
|
|
202
|
+
txt = (_row = row) === null || _row === void 0 ? void 0 : _row[textNameProp];
|
|
203
|
+
val = (_row2 = row) === null || _row2 === void 0 ? void 0 : _row2[name];
|
|
203
204
|
} catch (_unused) {}
|
|
204
205
|
} else {
|
|
205
206
|
var _formRef$current3, _formRef$current3$get, _formRef$current4, _formRef$current4$get;
|
|
@@ -209,16 +210,21 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
209
210
|
if (txt) {
|
|
210
211
|
setText(txt);
|
|
211
212
|
} else if (val) {
|
|
212
|
-
var _formRef$current5, _formRef$current5$set;
|
|
213
213
|
setText(val);
|
|
214
|
-
|
|
214
|
+
if (rowKey) {
|
|
215
|
+
var _formRef$current5, _formRef$current5$set;
|
|
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))));
|
|
217
|
+
} else {
|
|
218
|
+
var _formRef$current6, _formRef$current6$set;
|
|
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));
|
|
220
|
+
}
|
|
215
221
|
}
|
|
216
222
|
}, 0);
|
|
217
223
|
}, [rowKey]);
|
|
218
224
|
// 处理返回数据
|
|
219
225
|
var handleValue = function handleValue(row) {
|
|
220
|
-
var _formRef$
|
|
221
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
226
|
+
var _formRef$current7, _formRef$current7$get;
|
|
227
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$get = _formRef$current7.getFieldsValue) === null || _formRef$current7$get === void 0 ? void 0 : _formRef$current7$get.call(_formRef$current7)) || {};
|
|
222
228
|
if (rowKey) {
|
|
223
229
|
formValue = formValue[rowKey] || {};
|
|
224
230
|
}
|
|
@@ -258,11 +264,11 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
258
264
|
setText(txt);
|
|
259
265
|
setVisible(false);
|
|
260
266
|
if (rowKey) {
|
|
261
|
-
var _formRef$current7, _formRef$current7$set;
|
|
262
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$set = _formRef$current7.setFieldsValue) === null || _formRef$current7$set === void 0 ? void 0 : _formRef$current7$set.call(_formRef$current7, _defineProperty({}, rowKey, formValue));
|
|
263
|
-
} else {
|
|
264
267
|
var _formRef$current8, _formRef$current8$set;
|
|
265
|
-
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));
|
|
269
|
+
} else {
|
|
270
|
+
var _formRef$current9, _formRef$current9$set;
|
|
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));
|
|
266
272
|
}
|
|
267
273
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
268
274
|
};
|
|
@@ -293,8 +299,8 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
293
299
|
};
|
|
294
300
|
//直接输入不回车,value 和 text 为同一个值
|
|
295
301
|
var onInput = function onInput(e) {
|
|
296
|
-
var _formRef$
|
|
297
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
302
|
+
var _formRef$current10, _formRef$current10$ge;
|
|
303
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$ge = _formRef$current10.getFieldsValue) === null || _formRef$current10$ge === void 0 ? void 0 : _formRef$current10$ge.call(_formRef$current10)) || {};
|
|
298
304
|
if (rowKey) {
|
|
299
305
|
formValue = formValue[rowKey] || {};
|
|
300
306
|
}
|
|
@@ -303,30 +309,30 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
303
309
|
formValue[textNameProp] = val;
|
|
304
310
|
setText(val);
|
|
305
311
|
if (rowKey) {
|
|
306
|
-
var _formRef$current10, _formRef$current10$se;
|
|
307
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$se = _formRef$current10.setFieldsValue) === null || _formRef$current10$se === void 0 ? void 0 : _formRef$current10$se.call(_formRef$current10, _defineProperty({}, rowKey, formValue));
|
|
308
|
-
} else {
|
|
309
312
|
var _formRef$current11, _formRef$current11$se;
|
|
310
|
-
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));
|
|
314
|
+
} else {
|
|
315
|
+
var _formRef$current12, _formRef$current12$se;
|
|
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));
|
|
311
317
|
}
|
|
312
318
|
};
|
|
313
319
|
// 当表单重置或点clear时,处理值
|
|
314
320
|
var clearValue = function clearValue(e) {
|
|
315
321
|
if (!e.target.value) {
|
|
316
|
-
var _formRef$
|
|
322
|
+
var _formRef$current13, _formRef$current13$ge;
|
|
317
323
|
setText('');
|
|
318
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
324
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$ge = _formRef$current13.getFieldsValue) === null || _formRef$current13$ge === void 0 ? void 0 : _formRef$current13$ge.call(_formRef$current13)) || {};
|
|
319
325
|
if (rowKey) {
|
|
320
326
|
formValue = formValue[rowKey] || {};
|
|
321
327
|
}
|
|
322
328
|
formValue[name] = '';
|
|
323
329
|
formValue[textNameProp] = '';
|
|
324
330
|
if (rowKey) {
|
|
325
|
-
var _formRef$current13, _formRef$current13$se;
|
|
326
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$se = _formRef$current13.setFieldsValue) === null || _formRef$current13$se === void 0 ? void 0 : _formRef$current13$se.call(_formRef$current13, _defineProperty({}, rowKey, formValue));
|
|
327
|
-
} else {
|
|
328
331
|
var _formRef$current14, _formRef$current14$se;
|
|
329
|
-
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));
|
|
333
|
+
} else {
|
|
334
|
+
var _formRef$current15, _formRef$current15$se;
|
|
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));
|
|
330
336
|
}
|
|
331
337
|
}
|
|
332
338
|
};
|
package/es/utils/index.js
CHANGED
|
@@ -621,7 +621,10 @@ export var appPath = function appPath() {
|
|
|
621
621
|
// @ts-ignore
|
|
622
622
|
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
623
623
|
}
|
|
624
|
-
|
|
624
|
+
if (path) return path;
|
|
625
|
+
var p = location.pathname || '';
|
|
626
|
+
var idx = p.indexOf('/', 1);
|
|
627
|
+
return idx > 0 ? p.slice(0, idx + 1) : p.length > 1 ? p + '/' : './';
|
|
625
628
|
};
|
|
626
629
|
/**
|
|
627
630
|
* 深度复制对象
|
package/lib/components/404.d.ts
CHANGED
package/lib/components/404.js
CHANGED
|
@@ -5,12 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
require("./common.less");
|
|
10
|
-
var _default = function _default() {
|
|
11
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
11
|
+
var _default = function _default(props) {
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
12
13
|
className: "page404"
|
|
13
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
14
|
+
}, props), /*#__PURE__*/_react.default.createElement("img", {
|
|
14
15
|
src: require('./404.jpg')
|
|
15
16
|
}), " \u60A8\u8BBF\u95EE\u7684\u8D44\u6E90\u4E0D\u5B58\u5728~~");
|
|
16
17
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconBack: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconBack: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconBack;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconBell: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconBell: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconBell;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconQuestion: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconQuestion: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconQuestion;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconSearch: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconSearch: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconSearch;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
2
|
-
declare const IconText: (props: Partial<CustomIconComponentProps>
|
|
2
|
+
declare const IconText: (props: Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: ((e: any) => any) | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
3
5
|
export default IconText;
|
|
@@ -16,7 +16,7 @@ require("antd/es/button/style");
|
|
|
16
16
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
|
-
var
|
|
19
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
20
20
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
21
21
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
22
22
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -144,7 +144,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
144
144
|
if (Object.keys(rest).length && !isV2) {
|
|
145
145
|
data.where = rest;
|
|
146
146
|
} else {
|
|
147
|
-
data = (0,
|
|
147
|
+
data = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, data), rest);
|
|
148
148
|
}
|
|
149
149
|
if (!keepSelect) {
|
|
150
150
|
selectRowRef.current = [];
|
|
@@ -202,12 +202,13 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
202
202
|
setTimeout(function () {
|
|
203
203
|
var txt = '',
|
|
204
204
|
val = '';
|
|
205
|
+
var row;
|
|
205
206
|
if (rowKey) {
|
|
206
207
|
try {
|
|
207
|
-
var _formRef$current2, _formRef$current2$get, _formRef$current2$get2;
|
|
208
|
-
|
|
209
|
-
txt = row === null ||
|
|
210
|
-
val = row === null ||
|
|
208
|
+
var _formRef$current2, _formRef$current2$get, _formRef$current2$get2, _row, _row2;
|
|
209
|
+
row = 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$get2 = _formRef$current2$get.call(_formRef$current2)) === null || _formRef$current2$get2 === void 0 ? void 0 : _formRef$current2$get2[rowKey];
|
|
210
|
+
txt = (_row = row) === null || _row === void 0 ? void 0 : _row[textNameProp];
|
|
211
|
+
val = (_row2 = row) === null || _row2 === void 0 ? void 0 : _row2[name];
|
|
211
212
|
} catch (_unused) {}
|
|
212
213
|
} else {
|
|
213
214
|
var _formRef$current3, _formRef$current3$get, _formRef$current4, _formRef$current4$get;
|
|
@@ -217,16 +218,21 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
217
218
|
if (txt) {
|
|
218
219
|
setText(txt);
|
|
219
220
|
} else if (val) {
|
|
220
|
-
var _formRef$current5, _formRef$current5$set;
|
|
221
221
|
setText(val);
|
|
222
|
-
|
|
222
|
+
if (rowKey) {
|
|
223
|
+
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, (0, _defineProperty2.default)({}, rowKey, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, row), {}, (0, _defineProperty2.default)({}, textNameProp, val))));
|
|
225
|
+
} else {
|
|
226
|
+
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, (0, _defineProperty2.default)({}, textNameProp, val));
|
|
228
|
+
}
|
|
223
229
|
}
|
|
224
230
|
}, 0);
|
|
225
231
|
}, [rowKey]);
|
|
226
232
|
// 处理返回数据
|
|
227
233
|
var handleValue = function handleValue(row) {
|
|
228
|
-
var _formRef$
|
|
229
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
234
|
+
var _formRef$current7, _formRef$current7$get;
|
|
235
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$get = _formRef$current7.getFieldsValue) === null || _formRef$current7$get === void 0 ? void 0 : _formRef$current7$get.call(_formRef$current7)) || {};
|
|
230
236
|
if (rowKey) {
|
|
231
237
|
formValue = formValue[rowKey] || {};
|
|
232
238
|
}
|
|
@@ -266,11 +272,11 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
266
272
|
setText(txt);
|
|
267
273
|
setVisible(false);
|
|
268
274
|
if (rowKey) {
|
|
269
|
-
var _formRef$current7, _formRef$current7$set;
|
|
270
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$set = _formRef$current7.setFieldsValue) === null || _formRef$current7$set === void 0 ? void 0 : _formRef$current7$set.call(_formRef$current7, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
271
|
-
} else {
|
|
272
275
|
var _formRef$current8, _formRef$current8$set;
|
|
273
|
-
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, (0,
|
|
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, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
277
|
+
} else {
|
|
278
|
+
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, (0, _objectSpread3.default)({}, formValue));
|
|
274
280
|
}
|
|
275
281
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
276
282
|
};
|
|
@@ -301,8 +307,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
301
307
|
};
|
|
302
308
|
//直接输入不回车,value 和 text 为同一个值
|
|
303
309
|
var onInput = function onInput(e) {
|
|
304
|
-
var _formRef$
|
|
305
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
310
|
+
var _formRef$current10, _formRef$current10$ge;
|
|
311
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$ge = _formRef$current10.getFieldsValue) === null || _formRef$current10$ge === void 0 ? void 0 : _formRef$current10$ge.call(_formRef$current10)) || {};
|
|
306
312
|
if (rowKey) {
|
|
307
313
|
formValue = formValue[rowKey] || {};
|
|
308
314
|
}
|
|
@@ -311,30 +317,30 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
311
317
|
formValue[textNameProp] = val;
|
|
312
318
|
setText(val);
|
|
313
319
|
if (rowKey) {
|
|
314
|
-
var _formRef$current10, _formRef$current10$se;
|
|
315
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$se = _formRef$current10.setFieldsValue) === null || _formRef$current10$se === void 0 ? void 0 : _formRef$current10$se.call(_formRef$current10, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
316
|
-
} else {
|
|
317
320
|
var _formRef$current11, _formRef$current11$se;
|
|
318
|
-
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, (0,
|
|
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, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
322
|
+
} else {
|
|
323
|
+
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, (0, _objectSpread3.default)({}, formValue));
|
|
319
325
|
}
|
|
320
326
|
};
|
|
321
327
|
// 当表单重置或点clear时,处理值
|
|
322
328
|
var clearValue = function clearValue(e) {
|
|
323
329
|
if (!e.target.value) {
|
|
324
|
-
var _formRef$
|
|
330
|
+
var _formRef$current13, _formRef$current13$ge;
|
|
325
331
|
setText('');
|
|
326
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
332
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$ge = _formRef$current13.getFieldsValue) === null || _formRef$current13$ge === void 0 ? void 0 : _formRef$current13$ge.call(_formRef$current13)) || {};
|
|
327
333
|
if (rowKey) {
|
|
328
334
|
formValue = formValue[rowKey] || {};
|
|
329
335
|
}
|
|
330
336
|
formValue[name] = '';
|
|
331
337
|
formValue[textNameProp] = '';
|
|
332
338
|
if (rowKey) {
|
|
333
|
-
var _formRef$current13, _formRef$current13$se;
|
|
334
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$se = _formRef$current13.setFieldsValue) === null || _formRef$current13$se === void 0 ? void 0 : _formRef$current13$se.call(_formRef$current13, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
335
|
-
} else {
|
|
336
339
|
var _formRef$current14, _formRef$current14$se;
|
|
337
|
-
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, (0,
|
|
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, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
341
|
+
} else {
|
|
342
|
+
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, (0, _objectSpread3.default)({}, formValue));
|
|
338
344
|
}
|
|
339
345
|
}
|
|
340
346
|
};
|
package/lib/utils/index.js
CHANGED
|
@@ -712,7 +712,10 @@ var appPath = function appPath() {
|
|
|
712
712
|
// @ts-ignore
|
|
713
713
|
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
714
714
|
}
|
|
715
|
-
|
|
715
|
+
if (path) return path;
|
|
716
|
+
var p = location.pathname || '';
|
|
717
|
+
var idx = p.indexOf('/', 1);
|
|
718
|
+
return idx > 0 ? p.slice(0, idx + 1) : p.length > 1 ? p + '/' : './';
|
|
716
719
|
};
|
|
717
720
|
/**
|
|
718
721
|
* 深度复制对象
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ls-pro-common",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.29",
|
|
4
4
|
"description": "ls-pro-common",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@ant-design/icons": "^4.3.0",
|
|
24
|
-
"ls-pro-table": "^3.0.
|
|
24
|
+
"ls-pro-table": "^3.0.17",
|
|
25
25
|
"ls-pro-form": "^3.0.6",
|
|
26
26
|
"ls-pro-descriptions": "^3.0.1",
|
|
27
27
|
"ls-pro-card": "^3.0.3",
|