@bit-sun/business-component 3.1.0-alpha.10 → 3.1.0-alpha.12
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 +54 -37
- package/dist/index.js +54 -36
- package/dist/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Business/BsSulaQueryTable/index.tsx +5 -11
- package/src/components/Business/DetailPageWrapper/index.less +1 -1
- package/src/components/Business/DetailPageWrapper/index.tsx +1 -1
- package/src/components/Business/DetailPageWrapper/utils.tsx +1 -1
- package/src/components/Business/columnSettingTable/index.md +15 -0
- package/src/components/Business/columnSettingTable/index.tsx +4 -5
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +4 -5
- package/src/components/Functional/AddSelect/index.tsx +4 -5
- package/src/components/Functional/BillEntry/index.tsx +4 -5
- package/src/components/Functional/DataImport/index.tsx +1 -2
- package/src/components/Functional/DataValidation/index.tsx +3 -3
- package/src/components/Functional/SearchSelect/index.tsx +10 -3
- package/src/utils/utils.ts +9 -2
- package/src/utils/xlsxUtil.tsx +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1228,6 +1228,10 @@ var go2BackAndClose = function go2BackAndClose(backHistoryPath) {
|
|
|
1228
1228
|
history.goBack();
|
|
1229
1229
|
}
|
|
1230
1230
|
};
|
|
1231
|
+
var parseWidth = function parseWidth(widthStr) {
|
|
1232
|
+
var parsedWidth = parseInt(widthStr.replace('px', ''));
|
|
1233
|
+
return isNaN(parsedWidth) ? 0 : parsedWidth;
|
|
1234
|
+
};
|
|
1231
1235
|
/**
|
|
1232
1236
|
* 处理bssulaTable的公共回显样式
|
|
1233
1237
|
* @param col 每一具体行
|
|
@@ -1246,9 +1250,10 @@ var handleBssulaColumnsSpecialParams = function handleBssulaColumnsSpecialParams
|
|
|
1246
1250
|
};
|
|
1247
1251
|
} else if (col.textOverflow) {
|
|
1248
1252
|
// 处理文字太长
|
|
1253
|
+
var colWidth = typeof (col === null || col === void 0 ? void 0 : col.width) === 'number' ? col.width : col.width && parseWidth(col.width);
|
|
1249
1254
|
col.render = function (_ref3) {
|
|
1250
1255
|
var text = _ref3.text;
|
|
1251
|
-
return handleTextOverflow(text,
|
|
1256
|
+
return handleTextOverflow(text, colWidth);
|
|
1252
1257
|
};
|
|
1253
1258
|
} else if (col.images) {
|
|
1254
1259
|
col.render = function (_ref4) {
|
|
@@ -1302,8 +1307,9 @@ var handleAntdColumnsSpecialParams = function handleAntdColumnsSpecialParams(col
|
|
|
1302
1307
|
}
|
|
1303
1308
|
// 处理文字太长
|
|
1304
1309
|
if (col.textOverflow) {
|
|
1310
|
+
var colWidth = typeof (col === null || col === void 0 ? void 0 : col.width) === 'number' ? col.width : col.width && parseWidth(col.width);
|
|
1305
1311
|
col.render = function (text) {
|
|
1306
|
-
return handleTextOverflow(text);
|
|
1312
|
+
return handleTextOverflow(text, colWidth);
|
|
1307
1313
|
};
|
|
1308
1314
|
}
|
|
1309
1315
|
if (col.images) {
|
|
@@ -1544,37 +1550,38 @@ var resolveFile = /*#__PURE__*/function () {
|
|
|
1544
1550
|
//读取文件
|
|
1545
1551
|
var readerXlsxToList = /*#__PURE__*/function () {
|
|
1546
1552
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file, fileList, uploadRef, done, otherInfo) {
|
|
1547
|
-
var _ref5, callback, sheetMap, data2, data;
|
|
1553
|
+
var _ref5, callback, sheetMap, nowFile, data2, data;
|
|
1548
1554
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1549
1555
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1550
1556
|
case 0:
|
|
1551
1557
|
_ref5 = otherInfo || {}, callback = _ref5.callback, sheetMap = _ref5.sheetMap;
|
|
1552
1558
|
if (!(Array.isArray(fileList) && fileList.length > 0)) {
|
|
1553
|
-
_context2.next =
|
|
1559
|
+
_context2.next = 15;
|
|
1554
1560
|
break;
|
|
1555
1561
|
}
|
|
1556
|
-
|
|
1557
|
-
|
|
1562
|
+
nowFile = fileList[fileList.length - 1]; // 阻止了默认上传file没有originFileObj了 得从fileList中去取
|
|
1563
|
+
_context2.next = 5;
|
|
1564
|
+
return resolveFile(nowFile.originFileObj, {
|
|
1558
1565
|
sheetMap: fieldMappingReverse(sheetMap),
|
|
1559
1566
|
sheetCount: 1
|
|
1560
1567
|
});
|
|
1561
|
-
case
|
|
1568
|
+
case 5:
|
|
1562
1569
|
data2 = _context2.sent;
|
|
1563
1570
|
data = data2[0];
|
|
1564
1571
|
if (data.length) {
|
|
1565
|
-
_context2.next =
|
|
1572
|
+
_context2.next = 10;
|
|
1566
1573
|
break;
|
|
1567
1574
|
}
|
|
1568
1575
|
message$1.error("\u8BF7\u5148\u5F55\u5165\u6570\u636E\u518D\u5BFC\u5165");
|
|
1569
1576
|
return _context2.abrupt("return");
|
|
1570
|
-
case
|
|
1577
|
+
case 10:
|
|
1571
1578
|
if (callback) callback(data);
|
|
1572
1579
|
!callback && message$1.success("\u5BFC\u5165\u6210\u529F");
|
|
1573
1580
|
return _context2.abrupt("return", data);
|
|
1574
|
-
case
|
|
1581
|
+
case 15:
|
|
1575
1582
|
message$1.error("\u8BF7\u9009\u62E9\u6587\u4EF6");
|
|
1576
1583
|
return _context2.abrupt("return");
|
|
1577
|
-
case
|
|
1584
|
+
case 17:
|
|
1578
1585
|
case "end":
|
|
1579
1586
|
return _context2.stop();
|
|
1580
1587
|
}
|
|
@@ -2861,7 +2868,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2861
2868
|
return _.compact(Object.values(d)).length;
|
|
2862
2869
|
});
|
|
2863
2870
|
var resultColumns = (customerColumnsMapping === null || customerColumnsMapping === void 0 ? void 0 : customerColumnsMapping.length) ? customerColumnsMapping === null || customerColumnsMapping === void 0 ? void 0 : (_customerColumnsMappi = customerColumnsMapping.filter(function (c) {
|
|
2864
|
-
return
|
|
2871
|
+
return !!(c === null || c === void 0 ? void 0 : c.name);
|
|
2865
2872
|
})) === null || _customerColumnsMappi === void 0 ? void 0 : _customerColumnsMappi.map(function (c) {
|
|
2866
2873
|
return c.name;
|
|
2867
2874
|
}) : columns;
|
|
@@ -3136,7 +3143,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
3136
3143
|
var callBackFun = this.importExcelToLuckySheet;
|
|
3137
3144
|
var uploadProps = {
|
|
3138
3145
|
name: 'file',
|
|
3139
|
-
action: '',
|
|
3140
3146
|
headers: {},
|
|
3141
3147
|
accept: accept || ['.xlsx', '.xls'],
|
|
3142
3148
|
showUploadList: false,
|
|
@@ -3151,7 +3157,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
3151
3157
|
message$1.error("\u8BF7\u4E0A\u4F20".concat(suffixRule.toString(), "\u7B49\u683C\u5F0F\u7684\u6587\u4EF6!"));
|
|
3152
3158
|
return Upload.LIST_IGNORE;
|
|
3153
3159
|
}
|
|
3154
|
-
return
|
|
3160
|
+
return false; // 阻止默认上传
|
|
3155
3161
|
},
|
|
3156
3162
|
onChange: function onChange(info) {
|
|
3157
3163
|
var _Object$keys;
|
|
@@ -3812,7 +3818,6 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3812
3818
|
var callBackFun = this.importExcelToLuckySheet;
|
|
3813
3819
|
var uploadProps = {
|
|
3814
3820
|
name: 'file',
|
|
3815
|
-
action: '',
|
|
3816
3821
|
headers: {},
|
|
3817
3822
|
accept: accept || ['.xlsx', '.xls'],
|
|
3818
3823
|
showUploadList: false,
|
|
@@ -3827,7 +3832,7 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3827
3832
|
message$1.error("\u8BF7\u4E0A\u4F20".concat(suffixRule.toString(), "\u7B49\u683C\u5F0F\u7684\u6587\u4EF6!"));
|
|
3828
3833
|
return Upload.LIST_IGNORE;
|
|
3829
3834
|
}
|
|
3830
|
-
return
|
|
3835
|
+
return false; // 阻止默认上传
|
|
3831
3836
|
},
|
|
3832
3837
|
onChange: function onChange(info) {
|
|
3833
3838
|
var _Object$keys;
|
|
@@ -4650,11 +4655,27 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4650
4655
|
});
|
|
4651
4656
|
};
|
|
4652
4657
|
var onChangeCheckAll = function onChangeCheckAll(e) {
|
|
4658
|
+
// 允许用户自定义 全选操作逻辑
|
|
4659
|
+
if (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.onCheckAll) {
|
|
4660
|
+
modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.onCheckAll(e, {
|
|
4661
|
+
items: items,
|
|
4662
|
+
itemsTotal: itemsTotal,
|
|
4663
|
+
tablePagination: tablePagination,
|
|
4664
|
+
onCheckAllData: onCheckAllData,
|
|
4665
|
+
setSelectedRowKeys: setSelectedRowKeys,
|
|
4666
|
+
setPopValue: setPopValue,
|
|
4667
|
+
setSelectedRows: setSelectedRows,
|
|
4668
|
+
setIndeterminate: setIndeterminate,
|
|
4669
|
+
setCheckedAll: setCheckedAll
|
|
4670
|
+
});
|
|
4671
|
+
return;
|
|
4672
|
+
}
|
|
4653
4673
|
if (e.target.checked) {
|
|
4654
4674
|
// 如果下拉框有所有数据就处理选中所有【items.length === itemsTotal】(最多可选100条)
|
|
4655
4675
|
// 如果超过100条 就默认查出所有数据
|
|
4656
|
-
if (items.length < itemsTotal) {
|
|
4657
|
-
var
|
|
4676
|
+
if (items.length < itemsTotal || items.length === itemsTotal && itemsTotal == 0) {
|
|
4677
|
+
var totalCount = (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || itemsTotal; // 兼容有查询条件的情况 首次加载是没有所有数据的,默认给加载后端返回的总条数
|
|
4678
|
+
var totalPage = Math.ceil(totalCount / (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize));
|
|
4658
4679
|
var allPageSize = totalPage * (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize);
|
|
4659
4680
|
onCheckAllData(allPageSize);
|
|
4660
4681
|
} else {
|
|
@@ -5080,7 +5101,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5080
5101
|
}
|
|
5081
5102
|
};
|
|
5082
5103
|
}
|
|
5083
|
-
}), selectMode ? ( /*#__PURE__*/React$1.createElement("div", {
|
|
5104
|
+
}), selectMode && !(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.isHiddenCheckAll) ? ( /*#__PURE__*/React$1.createElement("div", {
|
|
5084
5105
|
className: 'select_list_selectAll'
|
|
5085
5106
|
}, /*#__PURE__*/React$1.createElement(Checkbox, {
|
|
5086
5107
|
indeterminate: indeterminate,
|
|
@@ -6922,7 +6943,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
6922
6943
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
6923
6944
|
item.onHeaderCell = function (column) {
|
|
6924
6945
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
6925
|
-
width: typeof column.width === 'number' ? column.width :
|
|
6946
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
6926
6947
|
onResize: handleResize(arr, indexArrInside, callback)
|
|
6927
6948
|
});
|
|
6928
6949
|
};
|
|
@@ -7974,7 +7995,7 @@ var BillEntry = function BillEntry(_ref3) {
|
|
|
7974
7995
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
7975
7996
|
item.onHeaderCell = function (column) {
|
|
7976
7997
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
7977
|
-
width: typeof column.width === 'number' ? column.width :
|
|
7998
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
7978
7999
|
onResize: handleResize(arr, indexArrInside, callback)
|
|
7979
8000
|
});
|
|
7980
8001
|
};
|
|
@@ -13410,7 +13431,7 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
|
|
|
13410
13431
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
13411
13432
|
item.onHeaderCell = function (column) {
|
|
13412
13433
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13413
|
-
width: typeof column.width === 'number' ? column.width :
|
|
13434
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
13414
13435
|
onResize: _this2.handleResize(indexArrInside)
|
|
13415
13436
|
});
|
|
13416
13437
|
};
|
|
@@ -13644,7 +13665,7 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
|
|
|
13644
13665
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
13645
13666
|
item.onHeaderCell = function (column) {
|
|
13646
13667
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13647
|
-
width: typeof column.width === 'number' ? column.width :
|
|
13668
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
13648
13669
|
onResize: _this2.handleResize(indexArrInside)
|
|
13649
13670
|
});
|
|
13650
13671
|
};
|
|
@@ -13804,9 +13825,9 @@ function matchRoute(path, routeObj, hideRouteObj) {
|
|
|
13804
13825
|
var getDetailMatchRoute = function getDetailMatchRoute(path, routeObj, hideRouteArray, _ref) {
|
|
13805
13826
|
var pathToRegexp = _ref.pathToRegexp;
|
|
13806
13827
|
var newPath = path.split('?')[0];
|
|
13807
|
-
var hideRouteObj = _defineProperty({}, newPath, hideRouteArray.find(function (itemRoute) {
|
|
13828
|
+
var hideRouteObj = _defineProperty({}, newPath, Array.isArray(hideRouteArray) && (hideRouteArray === null || hideRouteArray === void 0 ? void 0 : hideRouteArray.find(function (itemRoute) {
|
|
13808
13829
|
return pathToRegexp(itemRoute.path).test(newPath);
|
|
13809
|
-
}));
|
|
13830
|
+
})));
|
|
13810
13831
|
var matchedRoute = matchRoute(newPath, routeObj, hideRouteObj);
|
|
13811
13832
|
if (matchedRoute) {
|
|
13812
13833
|
var modeTypeText = path.match(/.*\/action\/.*/) ? '' : getModeTypeText(path);
|
|
@@ -13822,7 +13843,7 @@ var getDetailMatchRoute = function getDetailMatchRoute(path, routeObj, hideRoute
|
|
|
13822
13843
|
return undefined;
|
|
13823
13844
|
};
|
|
13824
13845
|
|
|
13825
|
-
var css_248z$c = ".detail_page_head {\n height: 54px;\n z-index: 5;\n display: flex;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n}\n.detail_page_head .ant-breadcrumb {\n display: block !important;\n}\n.detail_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.detail_page_head .ant-breadcrumb li .bread_name {\n color: #8A8F8D;\n font-size: 12px;\n cursor: pointer;\n}\n.detail_page_head .ant-breadcrumb li .bread_name:hover {\n color: #000000d9;\n}\n.detail_page_wrapper {\n height: calc(100vh - 80px);\n background-color: #FFF;\n}\n.back_home_img_content {\n display: inline-block;\n height: 28px;\n width: 28px;\n border: 1px solid #BABABA;\n margin: 0 12px 0 20px;\n border-radius: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.back_home_img_content .anticon-arrow-left {\n color: #BABABA;\n}\n.back_home_img_content:hover {\n background-color: #00A94E;\n border: 1px solid #00A94E;\n}\n.back_home_img_content:hover .anticon-arrow-left {\n color: #FFFFFF;\n}\n.detail_page_title_box {\n flex-grow: 1;\n}\n.detail_page_title {\n height: 20px;\n font-family: PingFangSC;\n font-weight: 600;\n font-size: 16px;\n margin-top: 2px;\n color: #000000;\n letter-spacing: 0;\n line-height: 20px;\n}\n.detail_page_btns {\n display: flex;\n gap: 8px;\n margin-right: 20px;\n}\n.detail_page_btns button {\n height: 32px !important;\n display: flex;\n align-items: center;\n gap: 2px;\n border-radius: 3px;\n padding: 0 10px;\n}\n.detail_page_btns .ant-btn-dangerous {\n background-color: #EC5246 !important;\n}\n";
|
|
13846
|
+
var css_248z$c = ".detail_page_head {\n height: 54px;\n z-index: 5;\n display: flex;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n}\n.detail_page_head .ant-breadcrumb {\n display: block !important;\n}\n.detail_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.detail_page_head .ant-breadcrumb li .bread_name {\n color: #8A8F8D;\n font-size: 12px;\n cursor: pointer;\n}\n.detail_page_head .ant-breadcrumb li .bread_name:hover {\n color: #000000d9;\n}\n.detail_page_wrapper {\n min-height: calc(100vh - 80px);\n background-color: #FFF;\n}\n.back_home_img_content {\n display: inline-block;\n height: 28px;\n width: 28px;\n border: 1px solid #BABABA;\n margin: 0 12px 0 20px;\n border-radius: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.back_home_img_content .anticon-arrow-left {\n color: #BABABA;\n}\n.back_home_img_content:hover {\n background-color: #00A94E;\n border: 1px solid #00A94E;\n}\n.back_home_img_content:hover .anticon-arrow-left {\n color: #FFFFFF;\n}\n.detail_page_title_box {\n flex-grow: 1;\n}\n.detail_page_title {\n height: 20px;\n font-family: PingFangSC;\n font-weight: 600;\n font-size: 16px;\n margin-top: 2px;\n color: #000000;\n letter-spacing: 0;\n line-height: 20px;\n}\n.detail_page_btns {\n display: flex;\n gap: 8px;\n margin-right: 20px;\n}\n.detail_page_btns button {\n height: 32px !important;\n display: flex;\n align-items: center;\n gap: 2px;\n border-radius: 3px;\n padding: 0 10px;\n}\n.detail_page_btns .ant-btn-dangerous {\n background-color: #EC5246 !important;\n}\n";
|
|
13826
13847
|
styleInject(css_248z$c);
|
|
13827
13848
|
|
|
13828
13849
|
var quanping = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2234px%22%20height%3D%2234px%22%20viewBox%3D%220%200%2034%2034%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3E%E7%9F%A9%E5%BD%A2%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22%E5%88%97%E8%A1%A8%E5%8A%9F%E8%83%BD%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22%E6%98%9F%E6%BE%9C-%E6%90%9C%E7%B4%A2-%E6%90%9C%E7%B4%A2%E5%8A%9F%E8%83%BD%22%20transform%3D%22translate%28-1823.000000%2C%20-297.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22%E6%90%9C%E7%B4%A2%E7%BB%84%E4%BB%B6-%E6%A0%B7%E5%BC%8F%E4%B8%80%22%20transform%3D%22translate%28230.000000%2C%20284.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22%E7%A1%AE%E5%AE%9A%E5%A4%87%E4%BB%BD-2%22%20transform%3D%22translate%281593.000000%2C%2013.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M5.55801813%2C1%20L28.4419819%2C1%20C30.0269041%2C1%2030.6016352%2C1.16502331%2031.181059%2C1.47490258%20C31.7604829%2C1.78478186%2032.2152181%2C2.2395171%2032.5250974%2C2.81894097%20C32.8349767%2C3.39836484%2033%2C3.97309593%2033%2C5.55801813%20L33%2C28.4419819%20C33%2C30.0269041%2032.8349767%2C30.6016352%2032.5250974%2C31.181059%20C32.2152181%2C31.7604829%2031.7604829%2C32.2152181%2031.181059%2C32.5250974%20C30.6016352%2C32.8349767%2030.0269041%2C33%2028.4419819%2C33%20L5.55801813%2C33%20C3.97309593%2C33%203.39836484%2C32.8349767%202.81894097%2C32.5250974%20C2.2395171%2C32.2152181%201.78478186%2C31.7604829%201.47490258%2C31.181059%20C1.16502331%2C30.6016352%201%2C30.0269041%201%2C28.4419819%20L1%2C5.55801813%20C1%2C3.97309593%201.16502331%2C3.39836484%201.47490258%2C2.81894097%20C1.78478186%2C2.2395171%202.2395171%2C1.78478186%202.81894097%2C1.47490258%20C3.39836484%2C1.16502331%203.97309593%2C1%205.55801813%2C1%20Z%22%20id%3D%22%E7%9F%A9%E5%BD%A2%22%20stroke%3D%22%23D9D9D9%22%20stroke-width%3D%220.888888889%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22scanning%22%20transform%3D%22translate%289.000000%2C%209.000000%29%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M5.21873562%2C9.69278114%20L6.28954184%2C10.7432953%20L2.532%2C14.5%20L5.24949999%2C14.5%20L5.24949999%2C16%20L1.5%2C16%20C0.671572876%2C16%200%2C15.3284271%200%2C14.5%20L0%2C11%20L1.5%2C11%20L1.5%2C13.41%20L5.21873562%2C9.69278114%20Z%20M10.7898541%2C9.72266777%20L14.499%2C13.431%20L14.5%2C11%20L16%2C11%20L16%2C14.5%20C16%2C15.3284271%2015.3284271%2C16%2014.5%2C16%20L10.7495%2C16%20L10.7495%2C14.5%20L13.446%2C14.5%20L9.71904783%2C10.7731819%20L10.7898541%2C9.72266777%20Z%20M14.5%2C0%20C15.3284271%2C0%2016%2C0.671572876%2016%2C1.5%20L16%2C5%20L14.5%2C5%20L14.499%2C2.588%20L10.779708%2C6.3074783%20L9.71904783%2C5.24681813%20L13.465%2C1.5%20L10.75%2C1.5%20L10.75%2C0%20L14.5%2C0%20Z%20M5.25000001%2C0%20L5.25000001%2C1.5%20L2.567%2C1.5%20L6.31400442%2C5.24681813%20L5.25334424%2C6.3074783%20L1.5%2C2.554%20L1.5%2C5%20L0%2C5%20L0%2C1.5%20C0%2C0.671572876%200.671572876%2C0%201.5%2C0%20L5.25000001%2C0%20Z%22%20id%3D%22%E5%BD%A2%E7%8A%B6%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
|
|
@@ -13934,7 +13955,7 @@ var DetailWrapper = /*#__PURE__*/React$1.memo(function (_ref) {
|
|
|
13934
13955
|
return pathKey ? breadcrumbNameMap[pathKey] : undefined;
|
|
13935
13956
|
};
|
|
13936
13957
|
var getPageTitle = function getPageTitle(pathname) {
|
|
13937
|
-
var _ref3 = localStorage.getItem(getCommonInfoKey()) && JSON.parse(localStorage.getItem(
|
|
13958
|
+
var _ref3 = localStorage.getItem(getCommonInfoKey()) && JSON.parse(localStorage.getItem(getCommonInfoKey())) || {},
|
|
13938
13959
|
_ref3$hideRouteArray = _ref3.hideRouteArray,
|
|
13939
13960
|
hideRouteArray = _ref3$hideRouteArray === void 0 ? [] : _ref3$hideRouteArray;
|
|
13940
13961
|
var currRouterData = matchParamsPath("".concat(basePath).concat(pathname), breadcrumbNameMap) || getDetailMatchRoute("".concat(basePath).concat(pathname), breadcrumbNameMap, hideRouteArray, {
|
|
@@ -15703,10 +15724,6 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15703
15724
|
}
|
|
15704
15725
|
var columns = props.columns;
|
|
15705
15726
|
var columnConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.COLUMN_CONDITION);
|
|
15706
|
-
var parseWidth = function parseWidth(widthStr) {
|
|
15707
|
-
var parsedWidth = parseInt(widthStr.replace('px', ''));
|
|
15708
|
-
return isNaN(parsedWidth) ? 0 : parsedWidth;
|
|
15709
|
-
};
|
|
15710
15727
|
var showColumns = getSettingFieldOrColumn(columnConfig, columns, 'columns');
|
|
15711
15728
|
showColumns.forEach(function (item, index) {
|
|
15712
15729
|
item.width = item.width || getItemDefaultWidth(item);
|
|
@@ -15726,7 +15743,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15726
15743
|
handleBssulaColumnsSpecialParams(item);
|
|
15727
15744
|
item.onHeaderCell = function (column) {
|
|
15728
15745
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15729
|
-
width: typeof column.width === 'number' ? column.width :
|
|
15746
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
15730
15747
|
onResize: handleResize(index)
|
|
15731
15748
|
});
|
|
15732
15749
|
};
|
|
@@ -15804,7 +15821,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15804
15821
|
};
|
|
15805
15822
|
// 处理 table 基本参数
|
|
15806
15823
|
var setTableProps = function setTableProps() {
|
|
15807
|
-
var _tableProps, _tableProps$initialPa, _tableProps2,
|
|
15824
|
+
var _tableProps, _tableProps$initialPa, _tableProps2, _tableProps3, _tableProps3$initialP;
|
|
15808
15825
|
var tableProps = value.tableProps || {};
|
|
15809
15826
|
tableProps = _objectSpread2(_objectSpread2({}, tableProps), {}, {
|
|
15810
15827
|
size: value.size || 'middle',
|
|
@@ -15832,14 +15849,14 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15832
15849
|
rowClassName: function rowClassName(record, index) {
|
|
15833
15850
|
return index % 2 === 0 ? 'table_base' : 'table_odd';
|
|
15834
15851
|
},
|
|
15835
|
-
components: {
|
|
15852
|
+
components: _objectSpread2({
|
|
15836
15853
|
header: {
|
|
15837
15854
|
cell: ResizeableTitle$2
|
|
15838
15855
|
}
|
|
15839
|
-
}
|
|
15856
|
+
}, (_tableProps2 = tableProps) === null || _tableProps2 === void 0 ? void 0 : _tableProps2.components)
|
|
15840
15857
|
});
|
|
15841
15858
|
// @ts-ignore
|
|
15842
|
-
if ((
|
|
15859
|
+
if ((_tableProps3 = tableProps) === null || _tableProps3 === void 0 ? void 0 : (_tableProps3$initialP = _tableProps3.initialPaging) === null || _tableProps3$initialP === void 0 ? void 0 : _tableProps3$initialP.pagination) {
|
|
15843
15860
|
// @ts-ignore
|
|
15844
15861
|
tableProps.initialPaging.pagination.showSizeChanger = true;
|
|
15845
15862
|
}
|
|
@@ -35103,4 +35120,4 @@ var index$7 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
35103
35120
|
})));
|
|
35104
35121
|
});
|
|
35105
35122
|
|
|
35106
|
-
export { AddSelect, AddSkcSelect, AddSkuSelect, AddSpuSelect, AuthButton, BillEntry, BsCascader, index$5 as BsLayout, BsSulaQueryTable, BusinessSearchSelect$1 as BusinessSearchSelect, BusinessTreeSearchSelect$1 as BusinessTreeSearchSelect, index$1 as CheckOneUser, ColumnSettingTable, ColumnsEdit, CommodityEntry, DataImport, DataValidation, index$3 as DetailPageWrapper, EllipsisTooltip, ExportIcon, GuideWrapper, HandleTotalCount, index$4 as HomePageWrapper, JsonQueryTable, index$6 as MoreTreeTable, QueryMutipleInput, RuleObjectComponent as RuleComponent, index$7 as RuleSetter, SearchSelect, index$2 as StateFlow, ColumnSettingSulaTable as SulaColumnSettingTable, TableColumnSetting, TreeSearchSelect, authFunc, calculateValidPeriod, checkQuantityAccuracy, createUniqID, downloadExcel, ergodicMenuRoutes, formatter, getAccountID, getAccountId, getBreadcrumbNameMap, getCommonInfoKey, getConfigTableColumns, getCurrentTargetBgId, getCurrentTenantId, getDictionarySource, getDictionaryTextByValue, getEmployeeCode, getEmployeeId, getItemDefaultWidth$1 as getItemDefaultWidth, getJoinDictionaryText, getLastKey, getLimitMenuDataKey, getLocalStorageSaveKey, getMenuAuthDataKey, getSessionId, getSkuImg, getTenantList, getUserId, getUserName, go2BackAndClose, handleAntdColumnsSpecialParams, handleBaseUrlPre, handleBeforeUpload, handleBssulaColumnsSpecialParams, handleCommonTimeRender$1 as handleCommonTimeRender, handleError, handleExport, handleExportBarCode, handleJudgeAuthButtons, handleOssUrl, handleRequestAuthHeader, handleRequestUrl, handleStatusBadge, handleTextBreakSpaces, handleTextDouble$1 as handleTextDouble, handleTextDoubleOrId, handleTextLineFeed$1 as handleTextLineFeed, handleTextOverflow$1 as handleTextOverflow, handleTextTooltip, handleTextWarp, handleTextWarpCustom, handleTooltip$1 as handleTooltip, handleTooltipHours$1 as handleTooltipHours, handleUserPhone, judgeIsEmpty, judgeIsRequestError, judgeIsRequestSuccess, keyToWord, memoizeOneFormatter, noEmptyArr, paramsControl, precisionQuantity, randomString, readerXlsxToList, removeCurrentTenantId, removeTenantList, renderFixed2, renderNumberText, saveCurrentTenantId, saveTenantList, setConfigTableColumns, shouldUseAuth, socketFunctions, sulaTableRenderTooltip, tableColumnsImage$1 as tableColumnsImage, textIcon, updateGuanDate, userColumns$1 as userColumns, userInfoCard$1 as userInfoCard, uuid, writeListToXlsx };
|
|
35123
|
+
export { AddSelect, AddSkcSelect, AddSkuSelect, AddSpuSelect, AuthButton, BillEntry, BsCascader, index$5 as BsLayout, BsSulaQueryTable, BusinessSearchSelect$1 as BusinessSearchSelect, BusinessTreeSearchSelect$1 as BusinessTreeSearchSelect, index$1 as CheckOneUser, ColumnSettingTable, ColumnsEdit, CommodityEntry, DataImport, DataValidation, index$3 as DetailPageWrapper, EllipsisTooltip, ExportIcon, GuideWrapper, HandleTotalCount, index$4 as HomePageWrapper, JsonQueryTable, index$6 as MoreTreeTable, QueryMutipleInput, RuleObjectComponent as RuleComponent, index$7 as RuleSetter, SearchSelect, index$2 as StateFlow, ColumnSettingSulaTable as SulaColumnSettingTable, TableColumnSetting, TreeSearchSelect, authFunc, calculateValidPeriod, checkQuantityAccuracy, createUniqID, downloadExcel, ergodicMenuRoutes, formatter, getAccountID, getAccountId, getBreadcrumbNameMap, getCommonInfoKey, getConfigTableColumns, getCurrentTargetBgId, getCurrentTenantId, getDictionarySource, getDictionaryTextByValue, getEmployeeCode, getEmployeeId, getItemDefaultWidth$1 as getItemDefaultWidth, getJoinDictionaryText, getLastKey, getLimitMenuDataKey, getLocalStorageSaveKey, getMenuAuthDataKey, getSessionId, getSkuImg, getTenantList, getUserId, getUserName, go2BackAndClose, handleAntdColumnsSpecialParams, handleBaseUrlPre, handleBeforeUpload, handleBssulaColumnsSpecialParams, handleCommonTimeRender$1 as handleCommonTimeRender, handleError, handleExport, handleExportBarCode, handleJudgeAuthButtons, handleOssUrl, handleRequestAuthHeader, handleRequestUrl, handleStatusBadge, handleTextBreakSpaces, handleTextDouble$1 as handleTextDouble, handleTextDoubleOrId, handleTextLineFeed$1 as handleTextLineFeed, handleTextOverflow$1 as handleTextOverflow, handleTextTooltip, handleTextWarp, handleTextWarpCustom, handleTooltip$1 as handleTooltip, handleTooltipHours$1 as handleTooltipHours, handleUserPhone, judgeIsEmpty, judgeIsRequestError, judgeIsRequestSuccess, keyToWord, memoizeOneFormatter, noEmptyArr, paramsControl, parseWidth, precisionQuantity, randomString, readerXlsxToList, removeCurrentTenantId, removeTenantList, renderFixed2, renderNumberText, saveCurrentTenantId, saveTenantList, setConfigTableColumns, shouldUseAuth, socketFunctions, sulaTableRenderTooltip, tableColumnsImage$1 as tableColumnsImage, textIcon, updateGuanDate, userColumns$1 as userColumns, userInfoCard$1 as userInfoCard, uuid, writeListToXlsx };
|
package/dist/index.js
CHANGED
|
@@ -1251,6 +1251,10 @@ var go2BackAndClose = function go2BackAndClose(backHistoryPath) {
|
|
|
1251
1251
|
umi.history.goBack();
|
|
1252
1252
|
}
|
|
1253
1253
|
};
|
|
1254
|
+
var parseWidth = function parseWidth(widthStr) {
|
|
1255
|
+
var parsedWidth = parseInt(widthStr.replace('px', ''));
|
|
1256
|
+
return isNaN(parsedWidth) ? 0 : parsedWidth;
|
|
1257
|
+
};
|
|
1254
1258
|
/**
|
|
1255
1259
|
* 处理bssulaTable的公共回显样式
|
|
1256
1260
|
* @param col 每一具体行
|
|
@@ -1269,9 +1273,10 @@ var handleBssulaColumnsSpecialParams = function handleBssulaColumnsSpecialParams
|
|
|
1269
1273
|
};
|
|
1270
1274
|
} else if (col.textOverflow) {
|
|
1271
1275
|
// 处理文字太长
|
|
1276
|
+
var colWidth = typeof (col === null || col === void 0 ? void 0 : col.width) === 'number' ? col.width : col.width && parseWidth(col.width);
|
|
1272
1277
|
col.render = function (_ref3) {
|
|
1273
1278
|
var text = _ref3.text;
|
|
1274
|
-
return handleTextOverflow(text,
|
|
1279
|
+
return handleTextOverflow(text, colWidth);
|
|
1275
1280
|
};
|
|
1276
1281
|
} else if (col.images) {
|
|
1277
1282
|
col.render = function (_ref4) {
|
|
@@ -1325,8 +1330,9 @@ var handleAntdColumnsSpecialParams = function handleAntdColumnsSpecialParams(col
|
|
|
1325
1330
|
}
|
|
1326
1331
|
// 处理文字太长
|
|
1327
1332
|
if (col.textOverflow) {
|
|
1333
|
+
var colWidth = typeof (col === null || col === void 0 ? void 0 : col.width) === 'number' ? col.width : col.width && parseWidth(col.width);
|
|
1328
1334
|
col.render = function (text) {
|
|
1329
|
-
return handleTextOverflow(text);
|
|
1335
|
+
return handleTextOverflow(text, colWidth);
|
|
1330
1336
|
};
|
|
1331
1337
|
}
|
|
1332
1338
|
if (col.images) {
|
|
@@ -1567,37 +1573,38 @@ var resolveFile = /*#__PURE__*/function () {
|
|
|
1567
1573
|
//读取文件
|
|
1568
1574
|
var readerXlsxToList = /*#__PURE__*/function () {
|
|
1569
1575
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file, fileList, uploadRef, done, otherInfo) {
|
|
1570
|
-
var _ref5, callback, sheetMap, data2, data;
|
|
1576
|
+
var _ref5, callback, sheetMap, nowFile, data2, data;
|
|
1571
1577
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1572
1578
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1573
1579
|
case 0:
|
|
1574
1580
|
_ref5 = otherInfo || {}, callback = _ref5.callback, sheetMap = _ref5.sheetMap;
|
|
1575
1581
|
if (!(Array.isArray(fileList) && fileList.length > 0)) {
|
|
1576
|
-
_context2.next =
|
|
1582
|
+
_context2.next = 15;
|
|
1577
1583
|
break;
|
|
1578
1584
|
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1585
|
+
nowFile = fileList[fileList.length - 1]; // 阻止了默认上传file没有originFileObj了 得从fileList中去取
|
|
1586
|
+
_context2.next = 5;
|
|
1587
|
+
return resolveFile(nowFile.originFileObj, {
|
|
1581
1588
|
sheetMap: fieldMappingReverse(sheetMap),
|
|
1582
1589
|
sheetCount: 1
|
|
1583
1590
|
});
|
|
1584
|
-
case
|
|
1591
|
+
case 5:
|
|
1585
1592
|
data2 = _context2.sent;
|
|
1586
1593
|
data = data2[0];
|
|
1587
1594
|
if (data.length) {
|
|
1588
|
-
_context2.next =
|
|
1595
|
+
_context2.next = 10;
|
|
1589
1596
|
break;
|
|
1590
1597
|
}
|
|
1591
1598
|
antd.message.error("\u8BF7\u5148\u5F55\u5165\u6570\u636E\u518D\u5BFC\u5165");
|
|
1592
1599
|
return _context2.abrupt("return");
|
|
1593
|
-
case
|
|
1600
|
+
case 10:
|
|
1594
1601
|
if (callback) callback(data);
|
|
1595
1602
|
!callback && antd.message.success("\u5BFC\u5165\u6210\u529F");
|
|
1596
1603
|
return _context2.abrupt("return", data);
|
|
1597
|
-
case
|
|
1604
|
+
case 15:
|
|
1598
1605
|
antd.message.error("\u8BF7\u9009\u62E9\u6587\u4EF6");
|
|
1599
1606
|
return _context2.abrupt("return");
|
|
1600
|
-
case
|
|
1607
|
+
case 17:
|
|
1601
1608
|
case "end":
|
|
1602
1609
|
return _context2.stop();
|
|
1603
1610
|
}
|
|
@@ -2884,7 +2891,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2884
2891
|
return ___default['default'].compact(Object.values(d)).length;
|
|
2885
2892
|
});
|
|
2886
2893
|
var resultColumns = (customerColumnsMapping === null || customerColumnsMapping === void 0 ? void 0 : customerColumnsMapping.length) ? customerColumnsMapping === null || customerColumnsMapping === void 0 ? void 0 : (_customerColumnsMappi = customerColumnsMapping.filter(function (c) {
|
|
2887
|
-
return
|
|
2894
|
+
return !!(c === null || c === void 0 ? void 0 : c.name);
|
|
2888
2895
|
})) === null || _customerColumnsMappi === void 0 ? void 0 : _customerColumnsMappi.map(function (c) {
|
|
2889
2896
|
return c.name;
|
|
2890
2897
|
}) : columns;
|
|
@@ -3159,7 +3166,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
3159
3166
|
var callBackFun = this.importExcelToLuckySheet;
|
|
3160
3167
|
var uploadProps = {
|
|
3161
3168
|
name: 'file',
|
|
3162
|
-
action: '',
|
|
3163
3169
|
headers: {},
|
|
3164
3170
|
accept: accept || ['.xlsx', '.xls'],
|
|
3165
3171
|
showUploadList: false,
|
|
@@ -3174,7 +3180,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
3174
3180
|
antd.message.error("\u8BF7\u4E0A\u4F20".concat(suffixRule.toString(), "\u7B49\u683C\u5F0F\u7684\u6587\u4EF6!"));
|
|
3175
3181
|
return antd.Upload.LIST_IGNORE;
|
|
3176
3182
|
}
|
|
3177
|
-
return
|
|
3183
|
+
return false; // 阻止默认上传
|
|
3178
3184
|
},
|
|
3179
3185
|
onChange: function onChange(info) {
|
|
3180
3186
|
var _Object$keys;
|
|
@@ -3835,7 +3841,6 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3835
3841
|
var callBackFun = this.importExcelToLuckySheet;
|
|
3836
3842
|
var uploadProps = {
|
|
3837
3843
|
name: 'file',
|
|
3838
|
-
action: '',
|
|
3839
3844
|
headers: {},
|
|
3840
3845
|
accept: accept || ['.xlsx', '.xls'],
|
|
3841
3846
|
showUploadList: false,
|
|
@@ -3850,7 +3855,7 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3850
3855
|
antd.message.error("\u8BF7\u4E0A\u4F20".concat(suffixRule.toString(), "\u7B49\u683C\u5F0F\u7684\u6587\u4EF6!"));
|
|
3851
3856
|
return antd.Upload.LIST_IGNORE;
|
|
3852
3857
|
}
|
|
3853
|
-
return
|
|
3858
|
+
return false; // 阻止默认上传
|
|
3854
3859
|
},
|
|
3855
3860
|
onChange: function onChange(info) {
|
|
3856
3861
|
var _Object$keys;
|
|
@@ -4673,11 +4678,27 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4673
4678
|
});
|
|
4674
4679
|
};
|
|
4675
4680
|
var onChangeCheckAll = function onChangeCheckAll(e) {
|
|
4681
|
+
// 允许用户自定义 全选操作逻辑
|
|
4682
|
+
if (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.onCheckAll) {
|
|
4683
|
+
modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.onCheckAll(e, {
|
|
4684
|
+
items: items,
|
|
4685
|
+
itemsTotal: itemsTotal,
|
|
4686
|
+
tablePagination: tablePagination,
|
|
4687
|
+
onCheckAllData: onCheckAllData,
|
|
4688
|
+
setSelectedRowKeys: setSelectedRowKeys,
|
|
4689
|
+
setPopValue: setPopValue,
|
|
4690
|
+
setSelectedRows: setSelectedRows,
|
|
4691
|
+
setIndeterminate: setIndeterminate,
|
|
4692
|
+
setCheckedAll: setCheckedAll
|
|
4693
|
+
});
|
|
4694
|
+
return;
|
|
4695
|
+
}
|
|
4676
4696
|
if (e.target.checked) {
|
|
4677
4697
|
// 如果下拉框有所有数据就处理选中所有【items.length === itemsTotal】(最多可选100条)
|
|
4678
4698
|
// 如果超过100条 就默认查出所有数据
|
|
4679
|
-
if (items.length < itemsTotal) {
|
|
4680
|
-
var
|
|
4699
|
+
if (items.length < itemsTotal || items.length === itemsTotal && itemsTotal == 0) {
|
|
4700
|
+
var totalCount = (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || itemsTotal; // 兼容有查询条件的情况 首次加载是没有所有数据的,默认给加载后端返回的总条数
|
|
4701
|
+
var totalPage = Math.ceil(totalCount / (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize));
|
|
4681
4702
|
var allPageSize = totalPage * (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize);
|
|
4682
4703
|
onCheckAllData(allPageSize);
|
|
4683
4704
|
} else {
|
|
@@ -5103,7 +5124,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5103
5124
|
}
|
|
5104
5125
|
};
|
|
5105
5126
|
}
|
|
5106
|
-
}), selectMode ? ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5127
|
+
}), selectMode && !(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.isHiddenCheckAll) ? ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5107
5128
|
className: 'select_list_selectAll'
|
|
5108
5129
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
5109
5130
|
indeterminate: indeterminate,
|
|
@@ -6945,7 +6966,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
6945
6966
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
6946
6967
|
item.onHeaderCell = function (column) {
|
|
6947
6968
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
6948
|
-
width: typeof column.width === 'number' ? column.width :
|
|
6969
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
6949
6970
|
onResize: handleResize(arr, indexArrInside, callback)
|
|
6950
6971
|
});
|
|
6951
6972
|
};
|
|
@@ -7997,7 +8018,7 @@ var BillEntry = function BillEntry(_ref3) {
|
|
|
7997
8018
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
7998
8019
|
item.onHeaderCell = function (column) {
|
|
7999
8020
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
8000
|
-
width: typeof column.width === 'number' ? column.width :
|
|
8021
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
8001
8022
|
onResize: handleResize(arr, indexArrInside, callback)
|
|
8002
8023
|
});
|
|
8003
8024
|
};
|
|
@@ -13433,7 +13454,7 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
|
|
|
13433
13454
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
13434
13455
|
item.onHeaderCell = function (column) {
|
|
13435
13456
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13436
|
-
width: typeof column.width === 'number' ? column.width :
|
|
13457
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
13437
13458
|
onResize: _this2.handleResize(indexArrInside)
|
|
13438
13459
|
});
|
|
13439
13460
|
};
|
|
@@ -13667,7 +13688,7 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
|
|
|
13667
13688
|
item.width = item.width || getItemDefaultWidth$2(item);
|
|
13668
13689
|
item.onHeaderCell = function (column) {
|
|
13669
13690
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13670
|
-
width: typeof column.width === 'number' ? column.width :
|
|
13691
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
13671
13692
|
onResize: _this2.handleResize(indexArrInside)
|
|
13672
13693
|
});
|
|
13673
13694
|
};
|
|
@@ -13827,9 +13848,9 @@ function matchRoute(path, routeObj, hideRouteObj) {
|
|
|
13827
13848
|
var getDetailMatchRoute = function getDetailMatchRoute(path, routeObj, hideRouteArray, _ref) {
|
|
13828
13849
|
var pathToRegexp = _ref.pathToRegexp;
|
|
13829
13850
|
var newPath = path.split('?')[0];
|
|
13830
|
-
var hideRouteObj = _defineProperty({}, newPath, hideRouteArray.find(function (itemRoute) {
|
|
13851
|
+
var hideRouteObj = _defineProperty({}, newPath, Array.isArray(hideRouteArray) && (hideRouteArray === null || hideRouteArray === void 0 ? void 0 : hideRouteArray.find(function (itemRoute) {
|
|
13831
13852
|
return pathToRegexp(itemRoute.path).test(newPath);
|
|
13832
|
-
}));
|
|
13853
|
+
})));
|
|
13833
13854
|
var matchedRoute = matchRoute(newPath, routeObj, hideRouteObj);
|
|
13834
13855
|
if (matchedRoute) {
|
|
13835
13856
|
var modeTypeText = path.match(/.*\/action\/.*/) ? '' : getModeTypeText(path);
|
|
@@ -13845,7 +13866,7 @@ var getDetailMatchRoute = function getDetailMatchRoute(path, routeObj, hideRoute
|
|
|
13845
13866
|
return undefined;
|
|
13846
13867
|
};
|
|
13847
13868
|
|
|
13848
|
-
var css_248z$c = ".detail_page_head {\n height: 54px;\n z-index: 5;\n display: flex;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n}\n.detail_page_head .ant-breadcrumb {\n display: block !important;\n}\n.detail_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.detail_page_head .ant-breadcrumb li .bread_name {\n color: #8A8F8D;\n font-size: 12px;\n cursor: pointer;\n}\n.detail_page_head .ant-breadcrumb li .bread_name:hover {\n color: #000000d9;\n}\n.detail_page_wrapper {\n height: calc(100vh - 80px);\n background-color: #FFF;\n}\n.back_home_img_content {\n display: inline-block;\n height: 28px;\n width: 28px;\n border: 1px solid #BABABA;\n margin: 0 12px 0 20px;\n border-radius: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.back_home_img_content .anticon-arrow-left {\n color: #BABABA;\n}\n.back_home_img_content:hover {\n background-color: #00A94E;\n border: 1px solid #00A94E;\n}\n.back_home_img_content:hover .anticon-arrow-left {\n color: #FFFFFF;\n}\n.detail_page_title_box {\n flex-grow: 1;\n}\n.detail_page_title {\n height: 20px;\n font-family: PingFangSC;\n font-weight: 600;\n font-size: 16px;\n margin-top: 2px;\n color: #000000;\n letter-spacing: 0;\n line-height: 20px;\n}\n.detail_page_btns {\n display: flex;\n gap: 8px;\n margin-right: 20px;\n}\n.detail_page_btns button {\n height: 32px !important;\n display: flex;\n align-items: center;\n gap: 2px;\n border-radius: 3px;\n padding: 0 10px;\n}\n.detail_page_btns .ant-btn-dangerous {\n background-color: #EC5246 !important;\n}\n";
|
|
13869
|
+
var css_248z$c = ".detail_page_head {\n height: 54px;\n z-index: 5;\n display: flex;\n align-items: center;\n background-color: #FFFFFF;\n border-bottom: 1px solid #f0f0f0;\n}\n.detail_page_head .ant-breadcrumb {\n display: block !important;\n}\n.detail_page_head .ant-breadcrumb .ant-breadcrumb-separator {\n margin: 0 2px;\n}\n.detail_page_head .ant-breadcrumb li .bread_name {\n color: #8A8F8D;\n font-size: 12px;\n cursor: pointer;\n}\n.detail_page_head .ant-breadcrumb li .bread_name:hover {\n color: #000000d9;\n}\n.detail_page_wrapper {\n min-height: calc(100vh - 80px);\n background-color: #FFF;\n}\n.back_home_img_content {\n display: inline-block;\n height: 28px;\n width: 28px;\n border: 1px solid #BABABA;\n margin: 0 12px 0 20px;\n border-radius: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.back_home_img_content .anticon-arrow-left {\n color: #BABABA;\n}\n.back_home_img_content:hover {\n background-color: #00A94E;\n border: 1px solid #00A94E;\n}\n.back_home_img_content:hover .anticon-arrow-left {\n color: #FFFFFF;\n}\n.detail_page_title_box {\n flex-grow: 1;\n}\n.detail_page_title {\n height: 20px;\n font-family: PingFangSC;\n font-weight: 600;\n font-size: 16px;\n margin-top: 2px;\n color: #000000;\n letter-spacing: 0;\n line-height: 20px;\n}\n.detail_page_btns {\n display: flex;\n gap: 8px;\n margin-right: 20px;\n}\n.detail_page_btns button {\n height: 32px !important;\n display: flex;\n align-items: center;\n gap: 2px;\n border-radius: 3px;\n padding: 0 10px;\n}\n.detail_page_btns .ant-btn-dangerous {\n background-color: #EC5246 !important;\n}\n";
|
|
13849
13870
|
styleInject(css_248z$c);
|
|
13850
13871
|
|
|
13851
13872
|
var quanping = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2234px%22%20height%3D%2234px%22%20viewBox%3D%220%200%2034%2034%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3E%E7%9F%A9%E5%BD%A2%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22%E5%88%97%E8%A1%A8%E5%8A%9F%E8%83%BD%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22%E6%98%9F%E6%BE%9C-%E6%90%9C%E7%B4%A2-%E6%90%9C%E7%B4%A2%E5%8A%9F%E8%83%BD%22%20transform%3D%22translate%28-1823.000000%2C%20-297.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22%E6%90%9C%E7%B4%A2%E7%BB%84%E4%BB%B6-%E6%A0%B7%E5%BC%8F%E4%B8%80%22%20transform%3D%22translate%28230.000000%2C%20284.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22%E7%A1%AE%E5%AE%9A%E5%A4%87%E4%BB%BD-2%22%20transform%3D%22translate%281593.000000%2C%2013.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M5.55801813%2C1%20L28.4419819%2C1%20C30.0269041%2C1%2030.6016352%2C1.16502331%2031.181059%2C1.47490258%20C31.7604829%2C1.78478186%2032.2152181%2C2.2395171%2032.5250974%2C2.81894097%20C32.8349767%2C3.39836484%2033%2C3.97309593%2033%2C5.55801813%20L33%2C28.4419819%20C33%2C30.0269041%2032.8349767%2C30.6016352%2032.5250974%2C31.181059%20C32.2152181%2C31.7604829%2031.7604829%2C32.2152181%2031.181059%2C32.5250974%20C30.6016352%2C32.8349767%2030.0269041%2C33%2028.4419819%2C33%20L5.55801813%2C33%20C3.97309593%2C33%203.39836484%2C32.8349767%202.81894097%2C32.5250974%20C2.2395171%2C32.2152181%201.78478186%2C31.7604829%201.47490258%2C31.181059%20C1.16502331%2C30.6016352%201%2C30.0269041%201%2C28.4419819%20L1%2C5.55801813%20C1%2C3.97309593%201.16502331%2C3.39836484%201.47490258%2C2.81894097%20C1.78478186%2C2.2395171%202.2395171%2C1.78478186%202.81894097%2C1.47490258%20C3.39836484%2C1.16502331%203.97309593%2C1%205.55801813%2C1%20Z%22%20id%3D%22%E7%9F%A9%E5%BD%A2%22%20stroke%3D%22%23D9D9D9%22%20stroke-width%3D%220.888888889%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22scanning%22%20transform%3D%22translate%289.000000%2C%209.000000%29%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M5.21873562%2C9.69278114%20L6.28954184%2C10.7432953%20L2.532%2C14.5%20L5.24949999%2C14.5%20L5.24949999%2C16%20L1.5%2C16%20C0.671572876%2C16%200%2C15.3284271%200%2C14.5%20L0%2C11%20L1.5%2C11%20L1.5%2C13.41%20L5.21873562%2C9.69278114%20Z%20M10.7898541%2C9.72266777%20L14.499%2C13.431%20L14.5%2C11%20L16%2C11%20L16%2C14.5%20C16%2C15.3284271%2015.3284271%2C16%2014.5%2C16%20L10.7495%2C16%20L10.7495%2C14.5%20L13.446%2C14.5%20L9.71904783%2C10.7731819%20L10.7898541%2C9.72266777%20Z%20M14.5%2C0%20C15.3284271%2C0%2016%2C0.671572876%2016%2C1.5%20L16%2C5%20L14.5%2C5%20L14.499%2C2.588%20L10.779708%2C6.3074783%20L9.71904783%2C5.24681813%20L13.465%2C1.5%20L10.75%2C1.5%20L10.75%2C0%20L14.5%2C0%20Z%20M5.25000001%2C0%20L5.25000001%2C1.5%20L2.567%2C1.5%20L6.31400442%2C5.24681813%20L5.25334424%2C6.3074783%20L1.5%2C2.554%20L1.5%2C5%20L0%2C5%20L0%2C1.5%20C0%2C0.671572876%200.671572876%2C0%201.5%2C0%20L5.25000001%2C0%20Z%22%20id%3D%22%E5%BD%A2%E7%8A%B6%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
|
|
@@ -13957,7 +13978,7 @@ var DetailWrapper = /*#__PURE__*/React__default['default'].memo(function (_ref)
|
|
|
13957
13978
|
return pathKey ? breadcrumbNameMap[pathKey] : undefined;
|
|
13958
13979
|
};
|
|
13959
13980
|
var getPageTitle = function getPageTitle(pathname) {
|
|
13960
|
-
var _ref3 = localStorage.getItem(getCommonInfoKey()) && JSON.parse(localStorage.getItem(
|
|
13981
|
+
var _ref3 = localStorage.getItem(getCommonInfoKey()) && JSON.parse(localStorage.getItem(getCommonInfoKey())) || {},
|
|
13961
13982
|
_ref3$hideRouteArray = _ref3.hideRouteArray,
|
|
13962
13983
|
hideRouteArray = _ref3$hideRouteArray === void 0 ? [] : _ref3$hideRouteArray;
|
|
13963
13984
|
var currRouterData = matchParamsPath("".concat(basePath).concat(pathname), breadcrumbNameMap) || getDetailMatchRoute("".concat(basePath).concat(pathname), breadcrumbNameMap, hideRouteArray, {
|
|
@@ -15726,10 +15747,6 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15726
15747
|
}
|
|
15727
15748
|
var columns = props.columns;
|
|
15728
15749
|
var columnConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.COLUMN_CONDITION);
|
|
15729
|
-
var parseWidth = function parseWidth(widthStr) {
|
|
15730
|
-
var parsedWidth = parseInt(widthStr.replace('px', ''));
|
|
15731
|
-
return isNaN(parsedWidth) ? 0 : parsedWidth;
|
|
15732
|
-
};
|
|
15733
15750
|
var showColumns = getSettingFieldOrColumn(columnConfig, columns, 'columns');
|
|
15734
15751
|
showColumns.forEach(function (item, index) {
|
|
15735
15752
|
item.width = item.width || getItemDefaultWidth(item);
|
|
@@ -15749,7 +15766,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15749
15766
|
handleBssulaColumnsSpecialParams(item);
|
|
15750
15767
|
item.onHeaderCell = function (column) {
|
|
15751
15768
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15752
|
-
width: typeof column.width === 'number' ? column.width :
|
|
15769
|
+
width: typeof column.width === 'number' ? column.width : parseWidth(column.width),
|
|
15753
15770
|
onResize: handleResize(index)
|
|
15754
15771
|
});
|
|
15755
15772
|
};
|
|
@@ -15827,7 +15844,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15827
15844
|
};
|
|
15828
15845
|
// 处理 table 基本参数
|
|
15829
15846
|
var setTableProps = function setTableProps() {
|
|
15830
|
-
var _tableProps, _tableProps$initialPa, _tableProps2,
|
|
15847
|
+
var _tableProps, _tableProps$initialPa, _tableProps2, _tableProps3, _tableProps3$initialP;
|
|
15831
15848
|
var tableProps = value.tableProps || {};
|
|
15832
15849
|
tableProps = _objectSpread2(_objectSpread2({}, tableProps), {}, {
|
|
15833
15850
|
size: value.size || 'middle',
|
|
@@ -15855,14 +15872,14 @@ var BsSulaQueryTable = (function (props) {
|
|
|
15855
15872
|
rowClassName: function rowClassName(record, index) {
|
|
15856
15873
|
return index % 2 === 0 ? 'table_base' : 'table_odd';
|
|
15857
15874
|
},
|
|
15858
|
-
components: {
|
|
15875
|
+
components: _objectSpread2({
|
|
15859
15876
|
header: {
|
|
15860
15877
|
cell: ResizeableTitle$2
|
|
15861
15878
|
}
|
|
15862
|
-
}
|
|
15879
|
+
}, (_tableProps2 = tableProps) === null || _tableProps2 === void 0 ? void 0 : _tableProps2.components)
|
|
15863
15880
|
});
|
|
15864
15881
|
// @ts-ignore
|
|
15865
|
-
if ((
|
|
15882
|
+
if ((_tableProps3 = tableProps) === null || _tableProps3 === void 0 ? void 0 : (_tableProps3$initialP = _tableProps3.initialPaging) === null || _tableProps3$initialP === void 0 ? void 0 : _tableProps3$initialP.pagination) {
|
|
15866
15883
|
// @ts-ignore
|
|
15867
15884
|
tableProps.initialPaging.pagination.showSizeChanger = true;
|
|
15868
15885
|
}
|
|
@@ -35220,6 +35237,7 @@ exports.keyToWord = keyToWord;
|
|
|
35220
35237
|
exports.memoizeOneFormatter = memoizeOneFormatter;
|
|
35221
35238
|
exports.noEmptyArr = noEmptyArr;
|
|
35222
35239
|
exports.paramsControl = paramsControl;
|
|
35240
|
+
exports.parseWidth = parseWidth;
|
|
35223
35241
|
exports.precisionQuantity = precisionQuantity;
|
|
35224
35242
|
exports.randomString = randomString;
|
|
35225
35243
|
exports.readerXlsxToList = readerXlsxToList;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare function downloadExcel(data: any, fileName?: any, isResUrl?: bool
|
|
|
2
2
|
export declare const formatter: (data: any, parentAuthority: any, parentName: any) => any;
|
|
3
3
|
export declare const memoizeOneFormatter: import("memoize-one").MemoizedFn<(data: any, parentAuthority: any, parentName: any) => any>;
|
|
4
4
|
export declare const go2BackAndClose: (backHistoryPath: any) => void;
|
|
5
|
+
export declare const parseWidth: (widthStr: string) => number;
|
|
5
6
|
/**
|
|
6
7
|
* 处理bssulaTable的公共回显样式
|
|
7
8
|
* @param col 每一具体行
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ import shezhi from '../../../assets/icon-shezhi.svg';
|
|
|
19
19
|
import { debounce } from 'lodash';
|
|
20
20
|
import ExportIcon from '@/components/Functional/ExportFunctions/ExportIcon';
|
|
21
21
|
import ENUM from '@/utils/enumConfig';
|
|
22
|
-
import { handleBssulaColumnsSpecialParams, uuid } from '@/utils/utils';
|
|
22
|
+
import { handleBssulaColumnsSpecialParams, uuid, parseWidth } from '@/utils/utils';
|
|
23
23
|
import './bssulaquerytable.less';
|
|
24
24
|
import { getMenuAuthDataKey } from '@/utils/LocalstorageUtils';
|
|
25
25
|
import { shouldUseAuth } from '@/utils';
|
|
@@ -265,12 +265,6 @@ const getSettingFieldOrColumn = (savedConfig, originConfig, type: string) => {
|
|
|
265
265
|
const { columns } = props;
|
|
266
266
|
let columnConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.COLUMN_CONDITION);
|
|
267
267
|
|
|
268
|
-
|
|
269
|
-
const parseWidth = (widthStr: string): number => {
|
|
270
|
-
const parsedWidth = parseInt(widthStr.replace('px', ''));
|
|
271
|
-
return isNaN(parsedWidth) ? 0 : parsedWidth;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
268
|
let showColumns = getSettingFieldOrColumn(columnConfig, columns, 'columns');
|
|
275
269
|
|
|
276
270
|
showColumns.forEach((item, index) => {
|
|
@@ -297,10 +291,9 @@ const getSettingFieldOrColumn = (savedConfig, originConfig, type: string) => {
|
|
|
297
291
|
handleBssulaColumnsSpecialParams(item);
|
|
298
292
|
item.onHeaderCell = (column) => ({
|
|
299
293
|
...item,
|
|
300
|
-
width:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
: parseInt(column.width.replace('px', '')),
|
|
294
|
+
width: typeof column.width === 'number'
|
|
295
|
+
? column.width
|
|
296
|
+
: parseWidth(column.width),
|
|
304
297
|
onResize: handleResize(index),
|
|
305
298
|
});
|
|
306
299
|
});
|
|
@@ -418,6 +411,7 @@ const getSettingFieldOrColumn = (savedConfig, originConfig, type: string) => {
|
|
|
418
411
|
header: {
|
|
419
412
|
cell: ResizeableTitle,
|
|
420
413
|
},
|
|
414
|
+
...tableProps?.components,
|
|
421
415
|
},
|
|
422
416
|
};
|
|
423
417
|
|
|
@@ -92,7 +92,7 @@ const DetailWrapper = React.memo(
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
const getPageTitle = (pathname: string) => {
|
|
95
|
-
const { hideRouteArray = [] } = localStorage.getItem(getCommonInfoKey()) && JSON.parse(localStorage.getItem(
|
|
95
|
+
const { hideRouteArray = [] } = localStorage.getItem(getCommonInfoKey()) && JSON.parse(localStorage.getItem(getCommonInfoKey())) || {};
|
|
96
96
|
const currRouterData = matchParamsPath(
|
|
97
97
|
`${basePath}${pathname}`,
|
|
98
98
|
breadcrumbNameMap,
|
|
@@ -147,7 +147,7 @@ export function matchRoute(path, routeObj, hideRouteObj) {
|
|
|
147
147
|
export const getDetailMatchRoute = (path, routeObj, hideRouteArray, { pathToRegexp }) => {
|
|
148
148
|
const newPath = path.split('?')[0]
|
|
149
149
|
const hideRouteObj = {
|
|
150
|
-
[newPath]: hideRouteArray
|
|
150
|
+
[newPath]: Array.isArray(hideRouteArray) && hideRouteArray?.find((itemRoute) => pathToRegexp(itemRoute.path).test(newPath))
|
|
151
151
|
}
|
|
152
152
|
const matchedRoute = matchRoute(newPath, routeObj, hideRouteObj);
|
|
153
153
|
if (matchedRoute) {
|
|
@@ -273,6 +273,21 @@ export default () => {
|
|
|
273
273
|
dataIndex: 'standardPrice',
|
|
274
274
|
title: '标准单价',
|
|
275
275
|
},
|
|
276
|
+
{
|
|
277
|
+
key: 'createUserName',
|
|
278
|
+
title: '操作人',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
key: 'remark',
|
|
282
|
+
title: '备注',
|
|
283
|
+
textOverflow: true,
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
key: 'operator',
|
|
287
|
+
title: '操作',
|
|
288
|
+
isPermissionColumn: true,
|
|
289
|
+
fixed: 'right',
|
|
290
|
+
}
|
|
276
291
|
]
|
|
277
292
|
const config = {
|
|
278
293
|
modeType: 'view',
|
|
@@ -5,7 +5,7 @@ import ColumnSetting from './columnSetting';
|
|
|
5
5
|
import { getItemDefaultWidth, getShowColumns, handleTextOverflow } from './utils';
|
|
6
6
|
import { noEmptyArray } from './utils';
|
|
7
7
|
import ENUM from '@/utils/enumConfig';
|
|
8
|
-
import { handleAntdColumnsSpecialParams } from '@/utils/utils';
|
|
8
|
+
import { handleAntdColumnsSpecialParams, parseWidth } from '@/utils/utils';
|
|
9
9
|
const { Text } = Typography;
|
|
10
10
|
export default class ColumnSettingTable extends React.Component {
|
|
11
11
|
state: any;
|
|
@@ -168,10 +168,9 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
168
168
|
item.width = item.width || getItemDefaultWidth(item);
|
|
169
169
|
item.onHeaderCell = (column: any) => ({
|
|
170
170
|
...item,
|
|
171
|
-
width:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
: parseInt(column.width.replace('px', '')),
|
|
171
|
+
width: typeof column.width === 'number'
|
|
172
|
+
? column.width
|
|
173
|
+
: parseWidth(column.width),
|
|
175
174
|
onResize: this.handleResize(indexArrInside),
|
|
176
175
|
});
|
|
177
176
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Typography,
|
|
10
10
|
} from 'antd';
|
|
11
11
|
import ENUM from '@/utils/enumConfig';
|
|
12
|
-
import { handleBssulaColumnsSpecialParams } from '@/utils/utils';
|
|
12
|
+
import { handleBssulaColumnsSpecialParams, parseWidth } from '@/utils/utils';
|
|
13
13
|
const { Text } = Typography;
|
|
14
14
|
export default class ColumnSettingSulaTable extends React.Component {
|
|
15
15
|
sulaTableRef: React.RefObject<unknown>;
|
|
@@ -173,10 +173,9 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
173
173
|
item.width = item.width || getItemDefaultWidth(item);
|
|
174
174
|
item.onHeaderCell = (column: any) => ({
|
|
175
175
|
...item,
|
|
176
|
-
width:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
: parseInt(column.width.replace('px', '')),
|
|
176
|
+
width: typeof column.width === 'number'
|
|
177
|
+
? column.width
|
|
178
|
+
: parseWidth(column.width),
|
|
180
179
|
onResize: this.handleResize(indexArrInside),
|
|
181
180
|
});
|
|
182
181
|
}
|
|
@@ -12,7 +12,7 @@ import { Resizable } from 'react-resizable';
|
|
|
12
12
|
import { checkQuantityAccuracy, precisionQuantity } from '@/utils/checkUtils';
|
|
13
13
|
import TableColumnSetting from '@/plugin/TableColumnSetting';
|
|
14
14
|
import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
|
|
15
|
-
import { handleAntdColumnsSpecialParams, uuid } from '@/utils/utils';
|
|
15
|
+
import { handleAntdColumnsSpecialParams, uuid, parseWidth } from '@/utils/utils';
|
|
16
16
|
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
17
17
|
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
18
18
|
import { getSelectDataList, loadSelectSource, formatFormSourceList } from './helps';
|
|
@@ -903,10 +903,9 @@ const AddSelect = (props: any) => {
|
|
|
903
903
|
item.width = item.width || getItemDefaultWidth(item);
|
|
904
904
|
item.onHeaderCell = (column: any) => ({
|
|
905
905
|
...item,
|
|
906
|
-
width:
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
: parseInt(column.width.replace('px', '')),
|
|
906
|
+
width: typeof column.width === 'number'
|
|
907
|
+
? column.width
|
|
908
|
+
: parseWidth(column.width),
|
|
910
909
|
onResize: handleResize(arr,indexArrInside, callback),
|
|
911
910
|
});
|
|
912
911
|
}
|
|
@@ -12,7 +12,7 @@ import { getSkuImg } from '@/utils/TableUtils';
|
|
|
12
12
|
import TableColumnSetting from '@/plugin/TableColumnSetting';
|
|
13
13
|
import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
|
|
14
14
|
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
15
|
-
import { handleAntdColumnsSpecialParams } from '@/utils/utils';
|
|
15
|
+
import { handleAntdColumnsSpecialParams, parseWidth } from '@/utils/utils';
|
|
16
16
|
import { judgeIsRequestSuccess, judgeIsRequestError } from '@/utils/requestUtils';
|
|
17
17
|
|
|
18
18
|
const InputElement = ({
|
|
@@ -714,10 +714,9 @@ const BillEntry: React.FC = ({ onSaveCallback, validDataUrl="/items/sku/import/c
|
|
|
714
714
|
item.width = item.width || getItemDefaultWidth(item);
|
|
715
715
|
item.onHeaderCell = (column: any) => ({
|
|
716
716
|
...item,
|
|
717
|
-
width:
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
: parseInt(column.width.replace('px', '')),
|
|
717
|
+
width: typeof column.width === 'number'
|
|
718
|
+
? column.width
|
|
719
|
+
: parseWidth(column.width),
|
|
721
720
|
onResize: handleResize(arr,indexArrInside, callback),
|
|
722
721
|
});
|
|
723
722
|
}
|
|
@@ -656,7 +656,6 @@ class DataImport extends React.Component {
|
|
|
656
656
|
|
|
657
657
|
const uploadProps = {
|
|
658
658
|
name: 'file',
|
|
659
|
-
action: '',
|
|
660
659
|
headers: {},
|
|
661
660
|
accept: accept || ['.xlsx', '.xls'],
|
|
662
661
|
showUploadList: false,
|
|
@@ -673,7 +672,7 @@ class DataImport extends React.Component {
|
|
|
673
672
|
message.error(`请上传${suffixRule.toString()}等格式的文件!`);
|
|
674
673
|
return Upload.LIST_IGNORE;
|
|
675
674
|
}
|
|
676
|
-
return
|
|
675
|
+
return false; // 阻止默认上传
|
|
677
676
|
},
|
|
678
677
|
onChange(info) {
|
|
679
678
|
if(!(sheetMap && Object.keys(sheetMap)?.length)) return;
|
|
@@ -426,7 +426,8 @@ class DataValidation extends React.Component {
|
|
|
426
426
|
const resultData = this.getData().filter(d => {
|
|
427
427
|
return _.compact(Object.values(d)).length
|
|
428
428
|
})
|
|
429
|
-
|
|
429
|
+
|
|
430
|
+
const resultColumns = customerColumnsMapping?.length? customerColumnsMapping?.filter((c: any) => !!c?.name)?.map((c: any) => c.name) : columns
|
|
430
431
|
|
|
431
432
|
// 处理业务参数
|
|
432
433
|
let otherParams={}
|
|
@@ -660,7 +661,6 @@ class DataValidation extends React.Component {
|
|
|
660
661
|
|
|
661
662
|
const uploadProps = {
|
|
662
663
|
name: 'file',
|
|
663
|
-
action: '',
|
|
664
664
|
headers: {},
|
|
665
665
|
accept: accept || ['.xlsx', '.xls'],
|
|
666
666
|
showUploadList: false,
|
|
@@ -677,7 +677,7 @@ class DataValidation extends React.Component {
|
|
|
677
677
|
message.error(`请上传${suffixRule.toString()}等格式的文件!`);
|
|
678
678
|
return Upload.LIST_IGNORE;
|
|
679
679
|
}
|
|
680
|
-
return
|
|
680
|
+
return false; // 阻止默认上传
|
|
681
681
|
},
|
|
682
682
|
onChange(info) {
|
|
683
683
|
if(!(sheetMap && Object.keys(sheetMap)?.length)) return;
|
|
@@ -563,11 +563,18 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
const onChangeCheckAll = (e) => {
|
|
566
|
+
// 允许用户自定义 全选操作逻辑
|
|
567
|
+
if(modalTableProps?.onCheckAll) {
|
|
568
|
+
modalTableProps?.onCheckAll(e,{items,itemsTotal,tablePagination,onCheckAllData,setSelectedRowKeys,setPopValue,setSelectedRows,setIndeterminate,setCheckedAll})
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
|
|
566
572
|
if (e.target.checked) {
|
|
567
573
|
// 如果下拉框有所有数据就处理选中所有【items.length === itemsTotal】(最多可选100条)
|
|
568
574
|
// 如果超过100条 就默认查出所有数据
|
|
569
|
-
if (items.length < itemsTotal) {
|
|
570
|
-
const
|
|
575
|
+
if ((items.length < itemsTotal) || (items.length === itemsTotal && itemsTotal == 0)) {
|
|
576
|
+
const totalCount = tablePagination?.total || itemsTotal // 兼容有查询条件的情况 首次加载是没有所有数据的,默认给加载后端返回的总条数
|
|
577
|
+
const totalPage = Math.ceil(totalCount / tablePagination?.pageSize);
|
|
571
578
|
const allPageSize = totalPage * tablePagination?.pageSize;
|
|
572
579
|
onCheckAllData(allPageSize)
|
|
573
580
|
} else {
|
|
@@ -1009,7 +1016,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1009
1016
|
};
|
|
1010
1017
|
}}
|
|
1011
1018
|
/>
|
|
1012
|
-
{selectMode ? (
|
|
1019
|
+
{(selectMode && !modalTableProps?.isHiddenCheckAll) ? (
|
|
1013
1020
|
<div className={'select_list_selectAll'}>
|
|
1014
1021
|
<Checkbox
|
|
1015
1022
|
indeterminate={indeterminate}
|
package/src/utils/utils.ts
CHANGED
|
@@ -70,6 +70,11 @@ export const go2BackAndClose = (backHistoryPath) => {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
export const parseWidth = (widthStr: string): number => {
|
|
74
|
+
const parsedWidth = parseInt(widthStr.replace('px', ''));
|
|
75
|
+
return isNaN(parsedWidth) ? 0 : parsedWidth;
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
/**
|
|
74
79
|
* 处理bssulaTable的公共回显样式
|
|
75
80
|
* @param col 每一具体行
|
|
@@ -83,7 +88,8 @@ export const handleBssulaColumnsSpecialParams = (col: any) => {
|
|
|
83
88
|
col.render = ({ text }: any) => handleTooltip(text, col.timeRender);
|
|
84
89
|
} else if (col.textOverflow) {
|
|
85
90
|
// 处理文字太长
|
|
86
|
-
|
|
91
|
+
const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width))
|
|
92
|
+
col.render = ({ text }: any) => handleTextOverflow(text, colWidth);
|
|
87
93
|
} else if (col.images) {
|
|
88
94
|
col.render = ({ text }: any) => tableColumnsImage(text);
|
|
89
95
|
} else if (col.double) {
|
|
@@ -117,7 +123,8 @@ export const handleBssulaColumnsSpecialParams = (col: any) => {
|
|
|
117
123
|
}
|
|
118
124
|
// 处理文字太长
|
|
119
125
|
if (col.textOverflow) {
|
|
120
|
-
col.
|
|
126
|
+
const colWidth = typeof col?.width === 'number' ? col.width : (col.width && parseWidth(col.width))
|
|
127
|
+
col.render = (text: any) => handleTextOverflow(text,colWidth);
|
|
121
128
|
}
|
|
122
129
|
if (col.images) {
|
|
123
130
|
col.render = (text: any) => tableColumnsImage(text);
|
package/src/utils/xlsxUtil.tsx
CHANGED
|
@@ -76,8 +76,8 @@ export const readerXlsxToList = async(file: any, fileList: any, uploadRef?: any,
|
|
|
76
76
|
const { callback, sheetMap } = otherInfo||{};
|
|
77
77
|
|
|
78
78
|
if (Array.isArray(fileList) && fileList.length > 0) {
|
|
79
|
-
|
|
80
|
-
const data2: any = await resolveFile(
|
|
79
|
+
const nowFile = fileList[fileList.length - 1]; // 阻止了默认上传file没有originFileObj了 得从fileList中去取
|
|
80
|
+
const data2: any = await resolveFile(nowFile.originFileObj,{ sheetMap: fieldMappingReverse(sheetMap),sheetCount:1 });
|
|
81
81
|
const data = data2[0]
|
|
82
82
|
|
|
83
83
|
if(!data.length){
|