@bit-sun/business-component 1.0.13 → 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,7 +1717,24 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1716
1717
|
defaultRowHeight: 20,
|
|
1717
1718
|
defaultColWidth: 120,
|
|
1718
1719
|
config: {},
|
|
1719
|
-
celldata: data
|
|
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
|
+
})),
|
|
1720
1738
|
scrollLeft: 0,
|
|
1721
1739
|
// "scrollTop": 315, //上下滚动条位置
|
|
1722
1740
|
luckysheet_select_save: [],
|
|
@@ -1876,7 +1894,9 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1876
1894
|
updateData = _this$props.updateData,
|
|
1877
1895
|
columns = _this$props.columns;
|
|
1878
1896
|
|
|
1879
|
-
var resultData = _this.getData()
|
|
1897
|
+
var resultData = _this.getData().filter(function (d) {
|
|
1898
|
+
return _.compact(Object.values(d)).length;
|
|
1899
|
+
});
|
|
1880
1900
|
|
|
1881
1901
|
axios.post(validDataUrl, {
|
|
1882
1902
|
columns: columns,
|
|
@@ -2052,7 +2072,11 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2052
2072
|
id: "item-0".concat(index),
|
|
2053
2073
|
content: mapping.get(item),
|
|
2054
2074
|
code: item,
|
|
2055
|
-
|
|
2075
|
+
"ct": {
|
|
2076
|
+
"fa": "General",
|
|
2077
|
+
"t": "s" //格式类型为数字类型
|
|
2078
|
+
|
|
2079
|
+
}
|
|
2056
2080
|
};
|
|
2057
2081
|
});
|
|
2058
2082
|
_this.state = {
|
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,7 +1728,24 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1726
1728
|
defaultRowHeight: 20,
|
|
1727
1729
|
defaultColWidth: 120,
|
|
1728
1730
|
config: {},
|
|
1729
|
-
celldata: data
|
|
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
|
+
})),
|
|
1730
1749
|
scrollLeft: 0,
|
|
1731
1750
|
// "scrollTop": 315, //上下滚动条位置
|
|
1732
1751
|
luckysheet_select_save: [],
|
|
@@ -1886,7 +1905,9 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1886
1905
|
updateData = _this$props.updateData,
|
|
1887
1906
|
columns = _this$props.columns;
|
|
1888
1907
|
|
|
1889
|
-
var resultData = _this.getData()
|
|
1908
|
+
var resultData = _this.getData().filter(function (d) {
|
|
1909
|
+
return ___default['default'].compact(Object.values(d)).length;
|
|
1910
|
+
});
|
|
1890
1911
|
|
|
1891
1912
|
axios__default['default'].post(validDataUrl, {
|
|
1892
1913
|
columns: columns,
|
|
@@ -2062,7 +2083,11 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2062
2083
|
id: "item-0".concat(index),
|
|
2063
2084
|
content: mapping.get(item),
|
|
2064
2085
|
code: item,
|
|
2065
|
-
|
|
2086
|
+
"ct": {
|
|
2087
|
+
"fa": "General",
|
|
2088
|
+
"t": "s" //格式类型为数字类型
|
|
2089
|
+
|
|
2090
|
+
}
|
|
2066
2091
|
};
|
|
2067
2092
|
});
|
|
2068
2093
|
_this.state = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bit-sun/business-component",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"antd": "4.17.2",
|
|
32
32
|
"axios": "^0.24.0",
|
|
33
33
|
"classnames": "^2.3.1",
|
|
34
|
+
"loadsh": "^0.0.4",
|
|
34
35
|
"react": "^16.12.0",
|
|
35
36
|
"react-beautiful-dnd": "10.0.0"
|
|
36
37
|
},
|
|
@@ -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
|
|
|
@@ -106,7 +107,10 @@ class DataValidation extends React.Component {
|
|
|
106
107
|
id: `item-0${index}`,
|
|
107
108
|
content: mapping.get(item),
|
|
108
109
|
code: item,
|
|
109
|
-
|
|
110
|
+
"ct": { //单元格值格式
|
|
111
|
+
"fa": "General", //格式名称为自动格式
|
|
112
|
+
"t": "s" //格式类型为数字类型
|
|
113
|
+
}
|
|
110
114
|
};
|
|
111
115
|
});
|
|
112
116
|
|
|
@@ -206,7 +210,13 @@ class DataValidation extends React.Component {
|
|
|
206
210
|
defaultRowHeight: 20, //自定义行高
|
|
207
211
|
defaultColWidth: 120, //自定义列宽
|
|
208
212
|
config: {},
|
|
209
|
-
celldata:
|
|
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
|
+
,
|
|
210
220
|
scrollLeft: 0, //左右滚动条位置
|
|
211
221
|
// "scrollTop": 315, //上下滚动条位置
|
|
212
222
|
luckysheet_select_save: [], //选中的区域
|
|
@@ -333,6 +343,7 @@ class DataValidation extends React.Component {
|
|
|
333
343
|
|
|
334
344
|
getValidateData = () => {
|
|
335
345
|
const { resultData } = this.state;
|
|
346
|
+
|
|
336
347
|
return {
|
|
337
348
|
successData: resultData
|
|
338
349
|
.filter((item) => item.flag)
|
|
@@ -363,7 +374,9 @@ class DataValidation extends React.Component {
|
|
|
363
374
|
|
|
364
375
|
resetData = () => {
|
|
365
376
|
const { validDataUrl, updateData, columns } = this.props;
|
|
366
|
-
const resultData = this.getData()
|
|
377
|
+
const resultData = this.getData().filter(d => {
|
|
378
|
+
return _.compact(Object.values(d)).length
|
|
379
|
+
})
|
|
367
380
|
|
|
368
381
|
axios
|
|
369
382
|
.post(validDataUrl, {
|