@bit-sun/business-component 1.0.16 → 1.0.17
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/index.esm.js
CHANGED
|
@@ -3,6 +3,7 @@ import React, { createContext, useContext, useEffect, forwardRef, createElement,
|
|
|
3
3
|
import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal } from 'antd';
|
|
4
4
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
+
import _ from 'loadsh';
|
|
6
7
|
import { useDebounceFn } from 'ahooks';
|
|
7
8
|
|
|
8
9
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -1716,14 +1717,24 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1716
1717
|
defaultRowHeight: 20,
|
|
1717
1718
|
defaultColWidth: 120,
|
|
1718
1719
|
config: {},
|
|
1719
|
-
celldata: data
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1720
|
+
celldata: data && data.length !== 0 ? data : _.flattenDeep(Array.from({
|
|
1721
|
+
length: 100
|
|
1722
|
+
}).map(function (a, b) {
|
|
1723
|
+
return Array.from({
|
|
1724
|
+
length: 100
|
|
1725
|
+
}).map(function (c, d) {
|
|
1726
|
+
return {
|
|
1727
|
+
"r": b,
|
|
1728
|
+
"c": d,
|
|
1729
|
+
"v": {
|
|
1730
|
+
"ct": {
|
|
1731
|
+
"fa": "@",
|
|
1732
|
+
"t": "s"
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
});
|
|
1737
|
+
})),
|
|
1727
1738
|
scrollLeft: 0,
|
|
1728
1739
|
// "scrollTop": 315, //上下滚动条位置
|
|
1729
1740
|
luckysheet_select_save: [],
|
|
@@ -1883,7 +1894,9 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1883
1894
|
updateData = _this$props.updateData,
|
|
1884
1895
|
columns = _this$props.columns;
|
|
1885
1896
|
|
|
1886
|
-
var resultData = _this.getData()
|
|
1897
|
+
var resultData = _this.getData().filter(function (d) {
|
|
1898
|
+
return _.compact(Object.values(d)).length;
|
|
1899
|
+
});
|
|
1887
1900
|
|
|
1888
1901
|
axios.post(validDataUrl, {
|
|
1889
1902
|
columns: columns,
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var React = require('react');
|
|
|
7
7
|
var antd = require('antd');
|
|
8
8
|
var reactBeautifulDnd = require('react-beautiful-dnd');
|
|
9
9
|
var classNames = require('classnames');
|
|
10
|
+
var _ = require('loadsh');
|
|
10
11
|
var ahooks = require('ahooks');
|
|
11
12
|
|
|
12
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -14,6 +15,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
15
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
15
16
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
17
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
18
|
+
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
17
19
|
|
|
18
20
|
function ownKeys(object, enumerableOnly) {
|
|
19
21
|
var keys = Object.keys(object);
|
|
@@ -1726,14 +1728,24 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1726
1728
|
defaultRowHeight: 20,
|
|
1727
1729
|
defaultColWidth: 120,
|
|
1728
1730
|
config: {},
|
|
1729
|
-
celldata: data
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1731
|
+
celldata: data && data.length !== 0 ? data : ___default['default'].flattenDeep(Array.from({
|
|
1732
|
+
length: 100
|
|
1733
|
+
}).map(function (a, b) {
|
|
1734
|
+
return Array.from({
|
|
1735
|
+
length: 100
|
|
1736
|
+
}).map(function (c, d) {
|
|
1737
|
+
return {
|
|
1738
|
+
"r": b,
|
|
1739
|
+
"c": d,
|
|
1740
|
+
"v": {
|
|
1741
|
+
"ct": {
|
|
1742
|
+
"fa": "@",
|
|
1743
|
+
"t": "s"
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
};
|
|
1747
|
+
});
|
|
1748
|
+
})),
|
|
1737
1749
|
scrollLeft: 0,
|
|
1738
1750
|
// "scrollTop": 315, //上下滚动条位置
|
|
1739
1751
|
luckysheet_select_save: [],
|
|
@@ -1893,7 +1905,9 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1893
1905
|
updateData = _this$props.updateData,
|
|
1894
1906
|
columns = _this$props.columns;
|
|
1895
1907
|
|
|
1896
|
-
var resultData = _this.getData()
|
|
1908
|
+
var resultData = _this.getData().filter(function (d) {
|
|
1909
|
+
return ___default['default'].compact(Object.values(d)).length;
|
|
1910
|
+
});
|
|
1897
1911
|
|
|
1898
1912
|
axios__default['default'].post(validDataUrl, {
|
|
1899
1913
|
columns: columns,
|
package/package.json
CHANGED
|
@@ -23,7 +23,9 @@ export default () => {
|
|
|
23
23
|
return (
|
|
24
24
|
<div>
|
|
25
25
|
<DataValidation
|
|
26
|
-
columns={['skuCode', 'quantity', 'price']}
|
|
26
|
+
// columns={['skuCode', 'quantity', 'price']}
|
|
27
|
+
columns={["skuCode", "quantity", "price"]} // 需要哪些列展示,以及展示的顺序
|
|
28
|
+
validDataUrl="http://test.i-baby.net/wms-ops/recordDetailImport/check" // 校验的接口url
|
|
27
29
|
onRef={(ref) => {
|
|
28
30
|
dataValidationRef = ref;
|
|
29
31
|
}}
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
} from '@ant-design/icons';
|
|
28
28
|
import axios from 'axios';
|
|
29
29
|
import './index.less';
|
|
30
|
+
import _ from "loadsh"
|
|
30
31
|
|
|
31
32
|
const luckysheet = window.luckysheet;
|
|
32
33
|
|
|
@@ -209,14 +210,13 @@ class DataValidation extends React.Component {
|
|
|
209
210
|
defaultRowHeight: 20, //自定义行高
|
|
210
211
|
defaultColWidth: 120, //自定义列宽
|
|
211
212
|
config: {},
|
|
212
|
-
celldata:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// ,
|
|
213
|
+
celldata:
|
|
214
|
+
data && data.length !== 0 ? data : _.flattenDeep(Array.from({ length: 100 }).map((a, b) => Array.from({ length: 100 }).map((c, d) => ({
|
|
215
|
+
"r": b,
|
|
216
|
+
"c": d,
|
|
217
|
+
"v": { "ct": { "fa": "@", "t": "s" }, }
|
|
218
|
+
}))))
|
|
219
|
+
,
|
|
220
220
|
scrollLeft: 0, //左右滚动条位置
|
|
221
221
|
// "scrollTop": 315, //上下滚动条位置
|
|
222
222
|
luckysheet_select_save: [], //选中的区域
|
|
@@ -343,6 +343,7 @@ class DataValidation extends React.Component {
|
|
|
343
343
|
|
|
344
344
|
getValidateData = () => {
|
|
345
345
|
const { resultData } = this.state;
|
|
346
|
+
|
|
346
347
|
return {
|
|
347
348
|
successData: resultData
|
|
348
349
|
.filter((item) => item.flag)
|
|
@@ -373,7 +374,9 @@ class DataValidation extends React.Component {
|
|
|
373
374
|
|
|
374
375
|
resetData = () => {
|
|
375
376
|
const { validDataUrl, updateData, columns } = this.props;
|
|
376
|
-
const resultData = this.getData()
|
|
377
|
+
const resultData = this.getData().filter(d => {
|
|
378
|
+
return _.compact(Object.values(d)).length
|
|
379
|
+
})
|
|
377
380
|
|
|
378
381
|
axios
|
|
379
382
|
.post(validDataUrl, {
|