@bit-sun/business-component 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Business/DetailPageWrapper/utils.d.ts +3 -1
- package/dist/components/Functional/DataImport/index.d.ts +2 -0
- package/dist/components/Functional/DataValidation/index.d.ts +2 -0
- package/dist/index.esm.js +401 -41
- package/dist/index.js +403 -39
- package/dist/utils/LocalstorageUtils.d.ts +1 -0
- package/dist/utils/enumConfig.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/xlsxUtil.d.ts +6 -0
- package/package.json +6 -5
- package/src/components/Business/DetailPageWrapper/index.tsx +3 -2
- package/src/components/Business/DetailPageWrapper/utils.tsx +4 -2
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +8 -6
- package/src/components/Functional/DataImport/index.tsx +89 -12
- package/src/components/Functional/DataValidation/index.tsx +88 -9
- package/src/utils/LocalstorageUtils.ts +6 -0
- package/src/utils/enumConfig.ts +1 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/xlsxUtil.tsx +146 -0
|
@@ -7,5 +7,7 @@ export declare const judgeIsEmpty: (value: any) => boolean;
|
|
|
7
7
|
export declare const getMainCrumbNameMap: (menuData: any) => {};
|
|
8
8
|
export declare const getModeTypeText: (path: any) => "编辑" | "查看" | "新增" | "--";
|
|
9
9
|
export declare function matchRoute(path: any, routeObj: any, hideRouteObj: any): any;
|
|
10
|
-
export declare const getDetailMatchRoute: (path: any, routeObj: any, hideRouteArray: any
|
|
10
|
+
export declare const getDetailMatchRoute: (path: any, routeObj: any, hideRouteArray: any, { pathToRegexp }: {
|
|
11
|
+
pathToRegexp: any;
|
|
12
|
+
}) => any;
|
|
11
13
|
export {};
|
|
@@ -139,6 +139,8 @@ declare class DataImport extends React.Component {
|
|
|
139
139
|
errorChange: (e: any) => void;
|
|
140
140
|
menuList: React.JSX.Element;
|
|
141
141
|
leftMenu: React.JSX.Element;
|
|
142
|
+
getSheetMap: () => {};
|
|
143
|
+
importExcelToLuckySheet: (resultData: any) => void;
|
|
142
144
|
render(): React.JSX.Element;
|
|
143
145
|
}
|
|
144
146
|
export default DataImport;
|
|
@@ -139,6 +139,8 @@ declare class DataValidation extends React.Component {
|
|
|
139
139
|
errorChange: (e: any) => void;
|
|
140
140
|
menuList: React.JSX.Element;
|
|
141
141
|
leftMenu: React.JSX.Element;
|
|
142
|
+
getSheetMap: () => {};
|
|
143
|
+
importExcelToLuckySheet: (resultData: any) => void;
|
|
142
144
|
render(): React.JSX.Element;
|
|
143
145
|
}
|
|
144
146
|
export default DataValidation;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import request$1 from 'umi-request';
|
|
3
3
|
import cookie from 'js-cookie';
|
|
4
|
-
import { message as message$1, Tooltip, Image, Popover, Card, Avatar, Badge, Menu, Input, InputNumber, Space, Button, Dropdown, Checkbox, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag, Typography, Alert, Breadcrumb, Drawer as Drawer$1, List, Radio, Tree, Row, Col, Result, Tabs, Affix, Cascader, DatePicker, TimePicker, Switch } from 'antd';
|
|
4
|
+
import { message as message$1, Tooltip, Image, Popover, Card, Avatar, Badge, Menu, Input, InputNumber, Space, Button, Dropdown, Upload, Checkbox, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag, Typography, Alert, Breadcrumb, Drawer as Drawer$1, List, Radio, Tree, Row, Col, Result, Tabs, Affix, Cascader, DatePicker, TimePicker, Switch } from 'antd';
|
|
5
5
|
import _, { isNil, escapeRegExp, omit, debounce, cloneDeep as cloneDeep$1, throttle, isEmpty } from 'lodash';
|
|
6
6
|
import memoizeOne from 'memoize-one';
|
|
7
7
|
import { formatMessage, history, useLocation, Link, useModel, setLocale, useIntl } from 'umi';
|
|
@@ -11,6 +11,7 @@ import moment$1 from 'moment';
|
|
|
11
11
|
import { EyeOutlined, DeleteOutlined, EditOutlined, CopyOutlined, CloseSquareOutlined, WarningOutlined, SendOutlined, ProfileTwoTone, ExclamationCircleOutlined, DownOutlined, UnorderedListOutlined, SearchOutlined, CaretLeftOutlined, CloseCircleOutlined, ArrowLeftOutlined, FolderOutlined, EllipsisOutlined, CaretDownOutlined, HomeOutlined, DoubleLeftOutlined, DoubleRightOutlined, MenuUnfoldOutlined, DashOutlined, SettingOutlined, BulbOutlined, PlayCircleOutlined, SaveOutlined, FullscreenExitOutlined, MinusCircleOutlined, PlusCircleOutlined } from '@ant-design/icons';
|
|
12
12
|
import { request as request$2, Table as Table$1, QueryTable, Form as Form$1 } from 'bssula';
|
|
13
13
|
import 'qs';
|
|
14
|
+
import { utils, writeFile, read } from 'xlsx';
|
|
14
15
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
15
16
|
import { useDebounceFn, useSize, useMount } from 'ahooks';
|
|
16
17
|
import { stringify } from 'querystring';
|
|
@@ -186,8 +187,8 @@ function _objectWithoutProperties(e, t) {
|
|
|
186
187
|
r,
|
|
187
188
|
i = _objectWithoutPropertiesLoose(e, t);
|
|
188
189
|
if (Object.getOwnPropertySymbols) {
|
|
189
|
-
var
|
|
190
|
-
for (r = 0; r <
|
|
190
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
191
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
191
192
|
}
|
|
192
193
|
return i;
|
|
193
194
|
}
|
|
@@ -195,7 +196,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
195
196
|
if (null == r) return {};
|
|
196
197
|
var t = {};
|
|
197
198
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
198
|
-
if (e.
|
|
199
|
+
if (e.includes(n)) continue;
|
|
199
200
|
t[n] = r[n];
|
|
200
201
|
}
|
|
201
202
|
return t;
|
|
@@ -560,7 +561,8 @@ var ENUM = {
|
|
|
560
561
|
USER_INFO: 'userInfo',
|
|
561
562
|
DICT_CODES: 'dicData',
|
|
562
563
|
CHILD_APP_BACK: 'child_app_back',
|
|
563
|
-
SEARCH_FIELDS_CONDITION: 'searchFieldsCondition'
|
|
564
|
+
SEARCH_FIELDS_CONDITION: 'searchFieldsCondition',
|
|
565
|
+
COMMONINFO: 'commonInfo' //通用信息
|
|
564
566
|
},
|
|
565
567
|
MAIN_AUTH_MAPPING: {
|
|
566
568
|
'/config-project-front/': 'CONFIG_PC',
|
|
@@ -687,6 +689,10 @@ var getMenuAuthDataKey = function getMenuAuthDataKey(channel) {
|
|
|
687
689
|
var getLimitMenuDataKey = function getLimitMenuDataKey(channel) {
|
|
688
690
|
return getLocalStorageSaveKey(ENUM.BROWSER_CACHE.LIMIT_MENU_DATA, channel);
|
|
689
691
|
};
|
|
692
|
+
// 公用数据存储/获取key
|
|
693
|
+
var getCommonInfoKey = function getCommonInfoKey(channel) {
|
|
694
|
+
return getLocalStorageSaveKey(ENUM.BROWSER_CACHE.COMMONINFO, channel);
|
|
695
|
+
};
|
|
690
696
|
/******* 公用localstorage结束 *****/
|
|
691
697
|
|
|
692
698
|
var resposne$1 = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}');
|
|
@@ -1449,6 +1455,185 @@ var shouldUseAuth = function shouldUseAuth() {
|
|
|
1449
1455
|
return window.__POWERED_BY_WUJIE__ ? true : false;
|
|
1450
1456
|
};
|
|
1451
1457
|
|
|
1458
|
+
/**---------------------excel专程数据-------开始------------------------*/
|
|
1459
|
+
var fieldMappingReverse = function fieldMappingReverse(sheetMap) {
|
|
1460
|
+
var obj = {};
|
|
1461
|
+
Object.entries(sheetMap).forEach(function (_ref) {
|
|
1462
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
1463
|
+
key = _ref2[0],
|
|
1464
|
+
val = _ref2[1];
|
|
1465
|
+
// @ts-ignore
|
|
1466
|
+
obj[val] = key;
|
|
1467
|
+
});
|
|
1468
|
+
return obj;
|
|
1469
|
+
};
|
|
1470
|
+
// 把文件以二进制的方式读出来
|
|
1471
|
+
var analyseExcelToByte = function analyseExcelToByte(file) {
|
|
1472
|
+
return new Promise(function (resolve) {
|
|
1473
|
+
var reader = new FileReader();
|
|
1474
|
+
reader.readAsBinaryString(file);
|
|
1475
|
+
reader.onload = function (ev) {
|
|
1476
|
+
var _ev$target;
|
|
1477
|
+
resolve(ev === null || ev === void 0 ? void 0 : (_ev$target = ev.target) === null || _ev$target === void 0 ? void 0 : _ev$target.result);
|
|
1478
|
+
};
|
|
1479
|
+
});
|
|
1480
|
+
};
|
|
1481
|
+
// 把excel数据【数组对象:中文表头key,value即表格内容】转换成服务端需要的数据【数组对象:英文表头key---中文表头对应的英文,value即表格内容】
|
|
1482
|
+
var parseToServe = function parseToServe(outdata, revertChart) {
|
|
1483
|
+
var arrs = [];
|
|
1484
|
+
outdata.forEach(function (item, i) {
|
|
1485
|
+
var arr = [];
|
|
1486
|
+
item.forEach(function (ite) {
|
|
1487
|
+
var obj = {};
|
|
1488
|
+
for (var key in revertChart) {
|
|
1489
|
+
var target = revertChart;
|
|
1490
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) break;
|
|
1491
|
+
var v = target[key];
|
|
1492
|
+
// if (key === ''||!item[key]) break; //表头字段映射为空,不进行导出
|
|
1493
|
+
if (key && (ite[key] || ite[key] === 0)) {
|
|
1494
|
+
obj[v] = ite[key];
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
arr.push(obj);
|
|
1498
|
+
});
|
|
1499
|
+
arrs.push(arr);
|
|
1500
|
+
});
|
|
1501
|
+
return arrs;
|
|
1502
|
+
};
|
|
1503
|
+
//读取excel表
|
|
1504
|
+
// sheepMap是表头字段中英文映射
|
|
1505
|
+
// sheetCount:表的数量,默认一张
|
|
1506
|
+
var resolveFile = /*#__PURE__*/function () {
|
|
1507
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
1508
|
+
var config,
|
|
1509
|
+
data,
|
|
1510
|
+
_args = arguments;
|
|
1511
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1512
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1513
|
+
case 0:
|
|
1514
|
+
config = _args.length > 1 && _args[1] !== undefined ? _args[1] : {
|
|
1515
|
+
sheetMap: [],
|
|
1516
|
+
sheetCount: 1
|
|
1517
|
+
};
|
|
1518
|
+
_context.next = 3;
|
|
1519
|
+
return analyseExcelToByte(file);
|
|
1520
|
+
case 3:
|
|
1521
|
+
data = _context.sent;
|
|
1522
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
1523
|
+
var workbook = read(data, {
|
|
1524
|
+
type: 'binary'
|
|
1525
|
+
});
|
|
1526
|
+
//根据sheet数量取出
|
|
1527
|
+
var sheetMapJsonList = _toConsumableArray(Array(config.sheetCount || 1)).map(function (ite, i) {
|
|
1528
|
+
var worksheets = workbook.Sheets[workbook.SheetNames[i]];
|
|
1529
|
+
return utils.sheet_to_json(worksheets);
|
|
1530
|
+
});
|
|
1531
|
+
var outdata = parseToServe(sheetMapJsonList, config.sheetMap);
|
|
1532
|
+
resolve(outdata);
|
|
1533
|
+
}));
|
|
1534
|
+
case 5:
|
|
1535
|
+
case "end":
|
|
1536
|
+
return _context.stop();
|
|
1537
|
+
}
|
|
1538
|
+
}, _callee);
|
|
1539
|
+
}));
|
|
1540
|
+
return function resolveFile(_x) {
|
|
1541
|
+
return _ref3.apply(this, arguments);
|
|
1542
|
+
};
|
|
1543
|
+
}();
|
|
1544
|
+
//读取文件
|
|
1545
|
+
var readerXlsxToList = /*#__PURE__*/function () {
|
|
1546
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file, fileList, uploadRef, done, otherInfo) {
|
|
1547
|
+
var _ref5, callback, sheetMap, data2, data;
|
|
1548
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1549
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1550
|
+
case 0:
|
|
1551
|
+
_ref5 = otherInfo || {}, callback = _ref5.callback, sheetMap = _ref5.sheetMap;
|
|
1552
|
+
if (!(Array.isArray(fileList) && fileList.length > 0)) {
|
|
1553
|
+
_context2.next = 14;
|
|
1554
|
+
break;
|
|
1555
|
+
}
|
|
1556
|
+
_context2.next = 4;
|
|
1557
|
+
return resolveFile(file.originFileObj, {
|
|
1558
|
+
sheetMap: fieldMappingReverse(sheetMap),
|
|
1559
|
+
sheetCount: 1
|
|
1560
|
+
});
|
|
1561
|
+
case 4:
|
|
1562
|
+
data2 = _context2.sent;
|
|
1563
|
+
data = data2[0];
|
|
1564
|
+
if (data.length) {
|
|
1565
|
+
_context2.next = 9;
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
message$1.error("\u8BF7\u5148\u5F55\u5165\u6570\u636E\u518D\u5BFC\u5165");
|
|
1569
|
+
return _context2.abrupt("return");
|
|
1570
|
+
case 9:
|
|
1571
|
+
if (callback) callback(data);
|
|
1572
|
+
!callback && message$1.success("\u5BFC\u5165\u6210\u529F");
|
|
1573
|
+
return _context2.abrupt("return", data);
|
|
1574
|
+
case 14:
|
|
1575
|
+
message$1.error("\u8BF7\u9009\u62E9\u6587\u4EF6");
|
|
1576
|
+
return _context2.abrupt("return");
|
|
1577
|
+
case 16:
|
|
1578
|
+
case "end":
|
|
1579
|
+
return _context2.stop();
|
|
1580
|
+
}
|
|
1581
|
+
}, _callee2);
|
|
1582
|
+
}));
|
|
1583
|
+
return function readerXlsxToList(_x2, _x3, _x4, _x5, _x6) {
|
|
1584
|
+
return _ref4.apply(this, arguments);
|
|
1585
|
+
};
|
|
1586
|
+
}();
|
|
1587
|
+
/**---------------------excel专程数据-------结束------------------------*/
|
|
1588
|
+
/**---------------------数据写入excel-------开始------------------------*/
|
|
1589
|
+
//数据写入excel
|
|
1590
|
+
var writeListToXlsx = function writeListToXlsx(list) {
|
|
1591
|
+
var fileName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '导出';
|
|
1592
|
+
// 创建工作薄
|
|
1593
|
+
var workbook = utils.book_new();
|
|
1594
|
+
// 利用XLSX的json_to_sheet工具将json数据转化为表
|
|
1595
|
+
var workSheet = utils.json_to_sheet(list);
|
|
1596
|
+
// 设置表格范围
|
|
1597
|
+
workSheet['!ref'] = "A1:AI".concat(list.length + 1);
|
|
1598
|
+
// 利用XLSX的book_append_sheet工具将表添加到excel文档中
|
|
1599
|
+
utils.book_append_sheet(workbook, workSheet, 'sheet0');
|
|
1600
|
+
// 执行数据转换文件写入
|
|
1601
|
+
writeFile(workbook, "".concat(fileName, ".xlsx"), {
|
|
1602
|
+
bookType: 'xlsx',
|
|
1603
|
+
bookSST: true,
|
|
1604
|
+
type: 'array'
|
|
1605
|
+
});
|
|
1606
|
+
};
|
|
1607
|
+
//字段转中文映射 alwaysTrans 为true就是如果在映射中找不到就按原样返回
|
|
1608
|
+
var keyToWord = function keyToWord(data, fieldMapping) {
|
|
1609
|
+
var alwaysTrans = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
1610
|
+
var keyMap = new Map([]);
|
|
1611
|
+
for (var _i = 0, _Object$entries = Object.entries(fieldMapping); _i < _Object$entries.length; _i++) {
|
|
1612
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
1613
|
+
key = _Object$entries$_i[0],
|
|
1614
|
+
value = _Object$entries$_i[1];
|
|
1615
|
+
keyMap.set(key, value);
|
|
1616
|
+
}
|
|
1617
|
+
return data.map(function (item) {
|
|
1618
|
+
var obj = {};
|
|
1619
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(item); _i2 < _Object$entries2.length; _i2++) {
|
|
1620
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
|
1621
|
+
_key = _Object$entries2$_i[0],
|
|
1622
|
+
_value = _Object$entries2$_i[1];
|
|
1623
|
+
if (keyMap.has(_key)) {
|
|
1624
|
+
//@ts-ignore
|
|
1625
|
+
obj[keyMap.get(_key)] = _value;
|
|
1626
|
+
} else {
|
|
1627
|
+
if (alwaysTrans) {
|
|
1628
|
+
obj[_key] = _value;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
return obj;
|
|
1633
|
+
});
|
|
1634
|
+
};
|
|
1635
|
+
/**---------------------数据写入excel-------结束------------------------*/
|
|
1636
|
+
|
|
1452
1637
|
var FORMAT_TIME_STR = 'YYYY-MM-DD HH:mm:ss';
|
|
1453
1638
|
var FORMAT_DAY_STR = 'YYYY-MM-DD';
|
|
1454
1639
|
var FUNCTION_GET = 'GET';
|
|
@@ -2495,13 +2680,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2495
2680
|
defaultRowHeight: 20,
|
|
2496
2681
|
defaultColWidth: 120,
|
|
2497
2682
|
config: {},
|
|
2498
|
-
// celldata:
|
|
2499
|
-
// data && data.length !== 0 ? data : _.flattenDeep(Array.from({ length: 100 }).map((a, b) => Array.from({ length: 100 }).map((c, d) => ({
|
|
2500
|
-
// "r": b,
|
|
2501
|
-
// "c": d,
|
|
2502
|
-
// "v": { "ct": { "fa": "@", "t": "s" }, }
|
|
2503
|
-
// }))))
|
|
2504
|
-
// ,
|
|
2505
2683
|
celldata: data && data.length !== 0 ? data : _.flattenDeep(Array.from({
|
|
2506
2684
|
length: 100
|
|
2507
2685
|
}).map(function (a, b) {
|
|
@@ -2663,7 +2841,10 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2663
2841
|
});
|
|
2664
2842
|
return obj;
|
|
2665
2843
|
});
|
|
2666
|
-
|
|
2844
|
+
// 解决 没有输入的行不要录入进去
|
|
2845
|
+
return data.filter(function (d) {
|
|
2846
|
+
return _.compact(Object.values(d)).length;
|
|
2847
|
+
});
|
|
2667
2848
|
};
|
|
2668
2849
|
_this.resetData = function () {
|
|
2669
2850
|
var _customerColumnsMappi;
|
|
@@ -2847,6 +3028,43 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2847
3028
|
});
|
|
2848
3029
|
}), provided.placeholder);
|
|
2849
3030
|
}))));
|
|
3031
|
+
_this.getSheetMap = function () {
|
|
3032
|
+
var _this$props2 = _this.props,
|
|
3033
|
+
customerColumnsMapping = _this$props2.customerColumnsMapping,
|
|
3034
|
+
columns = _this$props2.columns;
|
|
3035
|
+
var sheetData = customerColumnsMapping || columns.map(function (s) {
|
|
3036
|
+
return {
|
|
3037
|
+
title: mapping.get(s),
|
|
3038
|
+
name: s
|
|
3039
|
+
};
|
|
3040
|
+
}) || [];
|
|
3041
|
+
var sheetMap = {};
|
|
3042
|
+
sheetData.forEach(function (item, index) {
|
|
3043
|
+
sheetMap[item.name] = item === null || item === void 0 ? void 0 : item.title;
|
|
3044
|
+
});
|
|
3045
|
+
return sheetMap;
|
|
3046
|
+
};
|
|
3047
|
+
_this.importExcelToLuckySheet = function (resultData) {
|
|
3048
|
+
var res = resultData || [];
|
|
3049
|
+
var sheetData = luckysheet.getSheetData();
|
|
3050
|
+
sheetData.map(function (item, index) {
|
|
3051
|
+
if (!(res === null || res === void 0 ? void 0 : res[index])) return item;
|
|
3052
|
+
var rowItem = res[index];
|
|
3053
|
+
item === null || item === void 0 ? void 0 : item.forEach(function (element, colIndex) {
|
|
3054
|
+
var _ref4;
|
|
3055
|
+
var colKey = (_ref4 = Object.keys(rowItem) || []) === null || _ref4 === void 0 ? void 0 : _ref4[colIndex];
|
|
3056
|
+
if (!(rowItem === null || rowItem === void 0 ? void 0 : rowItem[colKey])) return element;
|
|
3057
|
+
element.m = rowItem[colKey];
|
|
3058
|
+
element.v = rowItem[colKey];
|
|
3059
|
+
});
|
|
3060
|
+
});
|
|
3061
|
+
luckysheet.create(_this.setConfig(luckysheet.transToCellData(sheetData)));
|
|
3062
|
+
_this.setState({
|
|
3063
|
+
data: luckysheet.transToCellData(sheetData),
|
|
3064
|
+
errorListCheck: false,
|
|
3065
|
+
resultData: resultData
|
|
3066
|
+
});
|
|
3067
|
+
};
|
|
2850
3068
|
_this.props.onRef(_this);
|
|
2851
3069
|
var format = {
|
|
2852
3070
|
fa: FORMAT_NAME_GENERAL,
|
|
@@ -2904,10 +3122,58 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2904
3122
|
key: "render",
|
|
2905
3123
|
value: function render() {
|
|
2906
3124
|
var errorListCheck = this.state.errorListCheck;
|
|
2907
|
-
var _this$
|
|
2908
|
-
title = _this$
|
|
2909
|
-
notValid = _this$
|
|
3125
|
+
var _this$props3 = this.props,
|
|
3126
|
+
title = _this$props3.title,
|
|
3127
|
+
notValid = _this$props3.notValid,
|
|
3128
|
+
notExcelImport = _this$props3.notExcelImport,
|
|
3129
|
+
excelImportConfig = _this$props3.excelImportConfig;
|
|
3130
|
+
var _ref5 = excelImportConfig || {},
|
|
3131
|
+
size = _ref5.size,
|
|
3132
|
+
accept = _ref5.accept,
|
|
3133
|
+
suffixRule = _ref5.suffixRule;
|
|
2910
3134
|
var totalSummary = this.getCount();
|
|
3135
|
+
var sheetMap = this.getSheetMap();
|
|
3136
|
+
var callBackFun = this.importExcelToLuckySheet;
|
|
3137
|
+
var uploadProps = {
|
|
3138
|
+
name: 'file',
|
|
3139
|
+
action: '',
|
|
3140
|
+
headers: {},
|
|
3141
|
+
accept: accept || ['.xlsx', '.xls'],
|
|
3142
|
+
showUploadList: false,
|
|
3143
|
+
beforeUpload: function beforeUpload(file) {
|
|
3144
|
+
// 文件校验
|
|
3145
|
+
var extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase();
|
|
3146
|
+
if (size && file.size > size * 1024 * 1024) {
|
|
3147
|
+
message$1.error("\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7".concat(size, "M!"));
|
|
3148
|
+
return Upload.LIST_IGNORE;
|
|
3149
|
+
}
|
|
3150
|
+
if (suffixRule && suffixRule.length > 0 && !suffixRule.includes(extName)) {
|
|
3151
|
+
message$1.error("\u8BF7\u4E0A\u4F20".concat(suffixRule.toString(), "\u7B49\u683C\u5F0F\u7684\u6587\u4EF6!"));
|
|
3152
|
+
return Upload.LIST_IGNORE;
|
|
3153
|
+
}
|
|
3154
|
+
return true;
|
|
3155
|
+
},
|
|
3156
|
+
onChange: function onChange(info) {
|
|
3157
|
+
var _Object$keys;
|
|
3158
|
+
if (!(sheetMap && ((_Object$keys = Object.keys(sheetMap)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length))) return;
|
|
3159
|
+
if (info.file.status !== 'uploading') {
|
|
3160
|
+
var _ref6 = info || {},
|
|
3161
|
+
file = _ref6.file,
|
|
3162
|
+
fileList = _ref6.fileList;
|
|
3163
|
+
readerXlsxToList(file, fileList, null, null, {
|
|
3164
|
+
callback: function callback(excelData) {
|
|
3165
|
+
callBackFun(excelData);
|
|
3166
|
+
},
|
|
3167
|
+
sheetMap: sheetMap
|
|
3168
|
+
});
|
|
3169
|
+
}
|
|
3170
|
+
if (info.file.status === 'done') {
|
|
3171
|
+
message$1.success("".concat(info.file.name, " \u5DF2\u4E0A\u4F20\uFF0C\u8BF7\u68C0\u9A8C\u6570\u636E\u65E0\u8BEF\u540E\u4FDD\u5B58"));
|
|
3172
|
+
} else if (info.file.status === 'error') {
|
|
3173
|
+
message$1.error("".concat(info.file.name, " \u4E0A\u4F20\u5931\u8D25.\u8BF7\u91CD\u65B0\u4E0A\u4F20"));
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
};
|
|
2911
3177
|
var luckyCss = {
|
|
2912
3178
|
margin: '0px',
|
|
2913
3179
|
padding: '0px',
|
|
@@ -2925,7 +3191,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2925
3191
|
placement: "bottomLeft"
|
|
2926
3192
|
}, /*#__PURE__*/React$1.createElement("a", null, /*#__PURE__*/React$1.createElement(ProfileTwoTone, null))), /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
2927
3193
|
title: /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("span", null, "\u4F7F\u7528\u6307\u5357\uFF1A"), /*#__PURE__*/React$1.createElement("br", null), /*#__PURE__*/React$1.createElement("span", null, "1\u3001\u62D6\u52A8\u6570\u636E\u9879\uFF0C\u4EE5\u9002\u914D\u6E90\u6570\u636E\u7684\u987A\u5E8F\uFF0C\u5982\u60A8Excel\u4E2D\u6570\u636E\u6392\u5E8F\u4F9D\u6B21\u4E3A\u7F16\u7801\u3001\u4EF7\u683C\u548C\u6570\u91CF\uFF0C\u5219\u60A8\u4E5F\u53EF\u4EE5\u5C06\u6570\u636E\u9879\u7684\u987A\u5E8F\u8C03\u6574\u4E3A\u4E00\u81F4"), /*#__PURE__*/React$1.createElement("br", null), /*#__PURE__*/React$1.createElement("span", null, "2\u3001\u590D\u5236\u6587\u4EF6\u6570\u636E\uFF08\u591A\u5217\u4E00\u8D77\uFF09\uFF0C\u5728\u6587\u672C\u6846\u5185\u8FDB\u884C\u7C98\u8D34"), /*#__PURE__*/React$1.createElement("br", null), /*#__PURE__*/React$1.createElement("span", null, "3\u3001\u70B9\u51FB\u8BC6\u522B\u6309\u94AE\u8FDB\u884C\u6570\u636E\u6821\u9A8C\uFF0C\u5982\u5168\u90E8\u6B63\u786E\uFF0C\u5219\u70B9\u51FB\u5F55\u5165\u6309\u94AE\u53EF\u5F55\u5165\u6570\u636E\uFF0C\u5982\u5B58\u5728\u9519\u8BEF\u6570\u636E\uFF0C\u5219\u9700\u4FEE\u6539\u540E\u518D\u8FDB\u884C\u5F55\u5165"))
|
|
2928
|
-
}, /*#__PURE__*/React$1.createElement(ExclamationCircleOutlined, null))), /*#__PURE__*/React$1.createElement(Space, null, /*#__PURE__*/React$1.createElement(Dropdown, {
|
|
3194
|
+
}, /*#__PURE__*/React$1.createElement(ExclamationCircleOutlined, null))), /*#__PURE__*/React$1.createElement(Space, null, !notExcelImport && ( /*#__PURE__*/React$1.createElement(Upload, _objectSpread2({}, uploadProps), /*#__PURE__*/React$1.createElement(Button, null, "\u5BFC\u5165"))), /*#__PURE__*/React$1.createElement(Dropdown, {
|
|
2929
3195
|
trigger: ['click'],
|
|
2930
3196
|
overlay: this.menuList,
|
|
2931
3197
|
placement: "bottomRight"
|
|
@@ -3090,13 +3356,6 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3090
3356
|
defaultRowHeight: 20,
|
|
3091
3357
|
defaultColWidth: 120,
|
|
3092
3358
|
config: {},
|
|
3093
|
-
// celldata:
|
|
3094
|
-
// data && data.length !== 0 ? data : _.flattenDeep(Array.from({ length: 100 }).map((a, b) => Array.from({ length: 100 }).map((c, d) => ({
|
|
3095
|
-
// "r": b,
|
|
3096
|
-
// "c": d,
|
|
3097
|
-
// "v": { "ct": { "fa": "@", "t": "s" }, }
|
|
3098
|
-
// }))))
|
|
3099
|
-
// ,
|
|
3100
3359
|
celldata: data && data.length !== 0 ? data : _.flattenDeep(Array.from({
|
|
3101
3360
|
length: 100
|
|
3102
3361
|
}).map(function (a, b) {
|
|
@@ -3258,7 +3517,10 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3258
3517
|
});
|
|
3259
3518
|
return obj;
|
|
3260
3519
|
});
|
|
3261
|
-
|
|
3520
|
+
// 解决 没有输入的行不要录入进去
|
|
3521
|
+
return data.filter(function (d) {
|
|
3522
|
+
return _.compact(Object.values(d)).length;
|
|
3523
|
+
});
|
|
3262
3524
|
};
|
|
3263
3525
|
_this.resetData = function () {
|
|
3264
3526
|
var _customerColumnsMappi;
|
|
@@ -3442,12 +3704,48 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3442
3704
|
});
|
|
3443
3705
|
}), provided.placeholder);
|
|
3444
3706
|
}))));
|
|
3707
|
+
_this.getSheetMap = function () {
|
|
3708
|
+
var _this$props2 = _this.props,
|
|
3709
|
+
customerColumnsMapping = _this$props2.customerColumnsMapping,
|
|
3710
|
+
columns = _this$props2.columns;
|
|
3711
|
+
var sheetData = customerColumnsMapping || columns.map(function (s) {
|
|
3712
|
+
return {
|
|
3713
|
+
title: mapping$1.get(s),
|
|
3714
|
+
name: s
|
|
3715
|
+
};
|
|
3716
|
+
}) || [];
|
|
3717
|
+
var sheetMap = {};
|
|
3718
|
+
sheetData.forEach(function (item, index) {
|
|
3719
|
+
sheetMap[item.name] = item === null || item === void 0 ? void 0 : item.title;
|
|
3720
|
+
});
|
|
3721
|
+
return sheetMap;
|
|
3722
|
+
};
|
|
3723
|
+
_this.importExcelToLuckySheet = function (resultData) {
|
|
3724
|
+
var res = resultData || [];
|
|
3725
|
+
var sheetData = luckysheet$1.getSheetData();
|
|
3726
|
+
sheetData.map(function (item, index) {
|
|
3727
|
+
if (!(res === null || res === void 0 ? void 0 : res[index])) return item;
|
|
3728
|
+
var rowItem = res[index];
|
|
3729
|
+
item === null || item === void 0 ? void 0 : item.forEach(function (element, colIndex) {
|
|
3730
|
+
var _ref4;
|
|
3731
|
+
var colKey = (_ref4 = Object.keys(rowItem) || []) === null || _ref4 === void 0 ? void 0 : _ref4[colIndex];
|
|
3732
|
+
if (!(rowItem === null || rowItem === void 0 ? void 0 : rowItem[colKey])) return element;
|
|
3733
|
+
element.m = rowItem[colKey];
|
|
3734
|
+
element.v = rowItem[colKey];
|
|
3735
|
+
});
|
|
3736
|
+
});
|
|
3737
|
+
luckysheet$1.create(_this.setConfig(luckysheet$1.transToCellData(sheetData)));
|
|
3738
|
+
_this.setState({
|
|
3739
|
+
data: luckysheet$1.transToCellData(sheetData),
|
|
3740
|
+
errorListCheck: false,
|
|
3741
|
+
resultData: resultData
|
|
3742
|
+
});
|
|
3743
|
+
};
|
|
3445
3744
|
_this.props.onRef(_this);
|
|
3446
3745
|
var format = {
|
|
3447
3746
|
fa: FORMAT_NAME_GENERAL$1,
|
|
3448
3747
|
t: FORMAT_TYPE_STRING$1
|
|
3449
3748
|
};
|
|
3450
|
-
debugger;
|
|
3451
3749
|
if (props === null || props === void 0 ? void 0 : (_props$customerColumn = props.customerColumnsMapping) === null || _props$customerColumn === void 0 ? void 0 : _props$customerColumn.length) {
|
|
3452
3750
|
var _props$customerColumn2;
|
|
3453
3751
|
itemsTemp$1 = (props === null || props === void 0 ? void 0 : (_props$customerColumn2 = props.customerColumnsMapping) === null || _props$customerColumn2 === void 0 ? void 0 : _props$customerColumn2.map(function (item, index) {
|
|
@@ -3460,7 +3758,6 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3460
3758
|
return createItem$1('item-0', index, mapping$1.get(item), item, format);
|
|
3461
3759
|
})) || [];
|
|
3462
3760
|
}
|
|
3463
|
-
console.log(itemsTemp$1, 'itemsTemp');
|
|
3464
3761
|
luckysheet$1 = window.luckysheet || window.top.luckysheet;
|
|
3465
3762
|
_this.state = {
|
|
3466
3763
|
showErrorData: false,
|
|
@@ -3501,10 +3798,58 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3501
3798
|
key: "render",
|
|
3502
3799
|
value: function render() {
|
|
3503
3800
|
var errorListCheck = this.state.errorListCheck;
|
|
3504
|
-
var _this$
|
|
3505
|
-
title = _this$
|
|
3506
|
-
notValid = _this$
|
|
3801
|
+
var _this$props3 = this.props,
|
|
3802
|
+
title = _this$props3.title,
|
|
3803
|
+
notValid = _this$props3.notValid,
|
|
3804
|
+
notExcelImport = _this$props3.notExcelImport,
|
|
3805
|
+
excelImportConfig = _this$props3.excelImportConfig;
|
|
3806
|
+
var _ref5 = excelImportConfig || {},
|
|
3807
|
+
size = _ref5.size,
|
|
3808
|
+
accept = _ref5.accept,
|
|
3809
|
+
suffixRule = _ref5.suffixRule;
|
|
3507
3810
|
var totalSummary = this.getCount();
|
|
3811
|
+
var sheetMap = this.getSheetMap();
|
|
3812
|
+
var callBackFun = this.importExcelToLuckySheet;
|
|
3813
|
+
var uploadProps = {
|
|
3814
|
+
name: 'file',
|
|
3815
|
+
action: '',
|
|
3816
|
+
headers: {},
|
|
3817
|
+
accept: accept || ['.xlsx', '.xls'],
|
|
3818
|
+
showUploadList: false,
|
|
3819
|
+
beforeUpload: function beforeUpload(file) {
|
|
3820
|
+
// 文件校验
|
|
3821
|
+
var extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase();
|
|
3822
|
+
if (size && file.size > size * 1024 * 1024) {
|
|
3823
|
+
message$1.error("\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7".concat(size, "M!"));
|
|
3824
|
+
return Upload.LIST_IGNORE;
|
|
3825
|
+
}
|
|
3826
|
+
if (suffixRule && suffixRule.length > 0 && !suffixRule.includes(extName)) {
|
|
3827
|
+
message$1.error("\u8BF7\u4E0A\u4F20".concat(suffixRule.toString(), "\u7B49\u683C\u5F0F\u7684\u6587\u4EF6!"));
|
|
3828
|
+
return Upload.LIST_IGNORE;
|
|
3829
|
+
}
|
|
3830
|
+
return true;
|
|
3831
|
+
},
|
|
3832
|
+
onChange: function onChange(info) {
|
|
3833
|
+
var _Object$keys;
|
|
3834
|
+
if (!(sheetMap && ((_Object$keys = Object.keys(sheetMap)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length))) return;
|
|
3835
|
+
if (info.file.status !== 'uploading') {
|
|
3836
|
+
var _ref6 = info || {},
|
|
3837
|
+
file = _ref6.file,
|
|
3838
|
+
fileList = _ref6.fileList;
|
|
3839
|
+
readerXlsxToList(file, fileList, null, null, {
|
|
3840
|
+
callback: function callback(excelData) {
|
|
3841
|
+
callBackFun(excelData);
|
|
3842
|
+
},
|
|
3843
|
+
sheetMap: sheetMap
|
|
3844
|
+
});
|
|
3845
|
+
}
|
|
3846
|
+
if (info.file.status === 'done') {
|
|
3847
|
+
message$1.success("".concat(info.file.name, " \u5DF2\u4E0A\u4F20\uFF0C\u8BF7\u68C0\u9A8C\u6570\u636E\u65E0\u8BEF\u540E\u4FDD\u5B58"));
|
|
3848
|
+
} else if (info.file.status === 'error') {
|
|
3849
|
+
message$1.error("".concat(info.file.name, " \u4E0A\u4F20\u5931\u8D25.\u8BF7\u91CD\u65B0\u4E0A\u4F20"));
|
|
3850
|
+
}
|
|
3851
|
+
}
|
|
3852
|
+
};
|
|
3508
3853
|
var luckyCss = {
|
|
3509
3854
|
margin: '0px',
|
|
3510
3855
|
padding: '0px',
|
|
@@ -3522,7 +3867,7 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
3522
3867
|
placement: "bottomLeft"
|
|
3523
3868
|
}, /*#__PURE__*/React$1.createElement("a", null, /*#__PURE__*/React$1.createElement(ProfileTwoTone, null))), /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
3524
3869
|
title: /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("span", null, "\u4F7F\u7528\u6307\u5357\uFF1A"), /*#__PURE__*/React$1.createElement("br", null), /*#__PURE__*/React$1.createElement("span", null, "1\u3001\u62D6\u52A8\u6570\u636E\u9879\uFF0C\u4EE5\u9002\u914D\u6E90\u6570\u636E\u7684\u987A\u5E8F\uFF0C\u5982\u60A8Excel\u4E2D\u6570\u636E\u6392\u5E8F\u4F9D\u6B21\u4E3A\u7F16\u7801\u3001\u4EF7\u683C\u548C\u6570\u91CF\uFF0C\u5219\u60A8\u4E5F\u53EF\u4EE5\u5C06\u6570\u636E\u9879\u7684\u987A\u5E8F\u8C03\u6574\u4E3A\u4E00\u81F4"), /*#__PURE__*/React$1.createElement("br", null), /*#__PURE__*/React$1.createElement("span", null, "2\u3001\u590D\u5236\u6587\u4EF6\u6570\u636E\uFF08\u591A\u5217\u4E00\u8D77\uFF09\uFF0C\u5728\u6587\u672C\u6846\u5185\u8FDB\u884C\u7C98\u8D34"), /*#__PURE__*/React$1.createElement("br", null), /*#__PURE__*/React$1.createElement("span", null, "3\u3001\u70B9\u51FB\u8BC6\u522B\u6309\u94AE\u8FDB\u884C\u6570\u636E\u6821\u9A8C\uFF0C\u5982\u5168\u90E8\u6B63\u786E\uFF0C\u5219\u70B9\u51FB\u5F55\u5165\u6309\u94AE\u53EF\u5F55\u5165\u6570\u636E\uFF0C\u5982\u5B58\u5728\u9519\u8BEF\u6570\u636E\uFF0C\u5219\u9700\u4FEE\u6539\u540E\u518D\u8FDB\u884C\u5F55\u5165"))
|
|
3525
|
-
}, /*#__PURE__*/React$1.createElement(ExclamationCircleOutlined, null))), /*#__PURE__*/React$1.createElement(Space, null, /*#__PURE__*/React$1.createElement(Dropdown, {
|
|
3870
|
+
}, /*#__PURE__*/React$1.createElement(ExclamationCircleOutlined, null))), /*#__PURE__*/React$1.createElement(Space, null, !notExcelImport && ( /*#__PURE__*/React$1.createElement(Upload, _objectSpread2({}, uploadProps), /*#__PURE__*/React$1.createElement(Button, null, "\u5BFC\u5165"))), /*#__PURE__*/React$1.createElement(Dropdown, {
|
|
3526
3871
|
trigger: ['click'],
|
|
3527
3872
|
overlay: this.menuList,
|
|
3528
3873
|
placement: "bottomRight"
|
|
@@ -8136,9 +8481,11 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps, hidde
|
|
|
8136
8481
|
}
|
|
8137
8482
|
}
|
|
8138
8483
|
}];
|
|
8139
|
-
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})
|
|
8140
|
-
|
|
8141
|
-
|
|
8484
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
8485
|
+
var firstElement = x === null || x === void 0 ? void 0 : x[0];
|
|
8486
|
+
var allList = firstElement && [firstElement, firstElement];
|
|
8487
|
+
formatSource(allList, 0, 2, tableSearchForm);
|
|
8488
|
+
formatSource(allList, 1, 3, tableSearchForm);
|
|
8142
8489
|
});
|
|
8143
8490
|
modalTableProps = _objectSpread2({
|
|
8144
8491
|
modalTableTitle: '选择供应商',
|
|
@@ -9186,9 +9533,11 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps, hidde
|
|
|
9186
9533
|
}
|
|
9187
9534
|
}
|
|
9188
9535
|
}];
|
|
9189
|
-
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})
|
|
9190
|
-
|
|
9191
|
-
|
|
9536
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
9537
|
+
var firstElement = x === null || x === void 0 ? void 0 : x[0];
|
|
9538
|
+
var allList = firstElement && [firstElement, firstElement];
|
|
9539
|
+
formatSource(allList, 0, 2, tableSearchForm);
|
|
9540
|
+
formatSource(allList, 1, 3, tableSearchForm);
|
|
9192
9541
|
});
|
|
9193
9542
|
modalTableProps = _objectSpread2({
|
|
9194
9543
|
modalTableTitle: '选择客户',
|
|
@@ -13432,9 +13781,14 @@ function matchRoute(path, routeObj, hideRouteObj) {
|
|
|
13432
13781
|
// 检查是否为action路由
|
|
13433
13782
|
var actionMatch = path.match(/.*\/action\/.*/);
|
|
13434
13783
|
if (actionMatch) {
|
|
13784
|
+
var _routeObj$path$match$, _path$match;
|
|
13435
13785
|
// 从hideRouteObj中进行全量匹配
|
|
13436
13786
|
var matchedRoute = hideRouteObj[path];
|
|
13437
|
-
|
|
13787
|
+
var regex = new RegExp("^(.*?)/action");
|
|
13788
|
+
var nameMap = (routeObj === null || routeObj === void 0 ? void 0 : (_routeObj$path$match$ = routeObj[path === null || path === void 0 ? void 0 : (_path$match = path.match(regex)) === null || _path$match === void 0 ? void 0 : _path$match[1]]) === null || _routeObj$path$match$ === void 0 ? void 0 : _routeObj$path$match$.nameMap) || []; // 去拿对应列表的nameMap
|
|
13789
|
+
return matchedRoute ? _objectSpread2(_objectSpread2({}, matchedRoute), {}, {
|
|
13790
|
+
nameMap: nameMap
|
|
13791
|
+
}) : null; // 如果找到匹配的路由则返回,否则返回null
|
|
13438
13792
|
}
|
|
13439
13793
|
// 检查是否为特殊路由(add/view/edit)
|
|
13440
13794
|
var specialMatch = path.match(/(.*)(\/add(\/[^\/](.*))*|\/create(\/[^\/](.*))*|\/view\/([^\/](.*))+|\/edit\/([^\/](.*))+)$/);
|
|
@@ -13447,7 +13801,8 @@ function matchRoute(path, routeObj, hideRouteObj) {
|
|
|
13447
13801
|
// 如果都不匹配,返回null
|
|
13448
13802
|
return null;
|
|
13449
13803
|
}
|
|
13450
|
-
var getDetailMatchRoute = function getDetailMatchRoute(path, routeObj, hideRouteArray) {
|
|
13804
|
+
var getDetailMatchRoute = function getDetailMatchRoute(path, routeObj, hideRouteArray, _ref) {
|
|
13805
|
+
var pathToRegexp = _ref.pathToRegexp;
|
|
13451
13806
|
var newPath = path.split('?')[0];
|
|
13452
13807
|
var hideRouteObj = _defineProperty({}, newPath, hideRouteArray.find(function (itemRoute) {
|
|
13453
13808
|
return pathToRegexp(itemRoute.path).test(newPath);
|
|
@@ -13579,7 +13934,12 @@ var DetailWrapper = /*#__PURE__*/React$1.memo(function (_ref) {
|
|
|
13579
13934
|
return pathKey ? breadcrumbNameMap[pathKey] : undefined;
|
|
13580
13935
|
};
|
|
13581
13936
|
var getPageTitle = function getPageTitle(pathname) {
|
|
13582
|
-
var
|
|
13937
|
+
var _ref3 = localStorage.getItem(getCommonInfoKey()) && JSON.parse(localStorage.getItem('commonInfo')) || {},
|
|
13938
|
+
_ref3$hideRouteArray = _ref3.hideRouteArray,
|
|
13939
|
+
hideRouteArray = _ref3$hideRouteArray === void 0 ? [] : _ref3$hideRouteArray;
|
|
13940
|
+
var currRouterData = matchParamsPath("".concat(basePath).concat(pathname), breadcrumbNameMap) || getDetailMatchRoute("".concat(basePath).concat(pathname), breadcrumbNameMap, hideRouteArray, {
|
|
13941
|
+
pathToRegexp: pathToRegexp
|
|
13942
|
+
});
|
|
13583
13943
|
if (!currRouterData) {
|
|
13584
13944
|
return '';
|
|
13585
13945
|
}
|
|
@@ -34743,4 +35103,4 @@ var index$7 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
34743
35103
|
})));
|
|
34744
35104
|
});
|
|
34745
35105
|
|
|
34746
|
-
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, 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, memoizeOneFormatter, noEmptyArr, paramsControl, precisionQuantity, randomString, 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 };
|
|
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 };
|