ls-pro-common 3.1.45 → 3.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.css +16 -0
- package/dist/common.js +1 -1
- package/dist/common.less +2 -1
- package/dist/common.min.css +16 -0
- package/dist/common.min.js +1 -1
- package/es/components/Select/AreaCitySelect.d.ts +5 -0
- package/es/components/Select/AreaCitySelect.js +25 -0
- package/es/components/Select/AreaDistrictSelect.d.ts +5 -0
- package/es/components/Select/AreaDistrictSelect.js +25 -0
- package/es/components/Select/AreaProvinceSelect.d.ts +5 -0
- package/es/components/Select/AreaProvinceSelect.js +25 -0
- package/es/components/Select/Base.d.ts +11 -0
- package/es/components/Select/Base.js +127 -0
- package/es/components/Select/BrandDeptSelect.d.ts +5 -0
- package/es/components/Select/BrandDeptSelect.js +12 -0
- package/es/components/Select/CategorySelect.d.ts +5 -0
- package/es/components/Select/CategorySelect.js +12 -0
- package/es/components/Select/ColorSelect.d.ts +5 -0
- package/es/components/Select/ColorSelect.js +12 -0
- package/es/components/Select/ExpressCompanyPageSelect.d.ts +5 -0
- package/es/components/Select/ExpressCompanyPageSelect.js +12 -0
- package/es/components/Select/ExpressCompanySelect.d.ts +5 -0
- package/es/components/Select/ExpressCompanySelect.js +12 -0
- package/es/components/Select/GenderSelect.d.ts +5 -0
- package/es/components/Select/GenderSelect.js +12 -0
- package/es/components/Select/LogisticCategorySelect.d.ts +5 -0
- package/es/components/Select/LogisticCategorySelect.js +12 -0
- package/es/components/Select/LogisticRegionSelect.d.ts +5 -0
- package/es/components/Select/LogisticRegionSelect.js +12 -0
- package/es/components/Select/ManagingCitySelect.d.ts +5 -0
- package/es/components/Select/ManagingCitySelect.js +12 -0
- package/es/components/Select/OwnerSelect.d.ts +5 -0
- package/es/components/Select/OwnerSelect.js +12 -0
- package/es/components/Select/PhysicalStoreSelect.d.ts +5 -0
- package/es/components/Select/PhysicalStoreSelect.js +12 -0
- package/es/components/Select/PowerUnitSelect.d.ts +5 -0
- package/es/components/Select/PowerUnitSelect.js +12 -0
- package/es/components/Select/ProfitLossMainSelect.d.ts +5 -0
- package/es/components/Select/ProfitLossMainSelect.js +12 -0
- package/es/components/Select/SeasonSelect.d.ts +5 -0
- package/es/components/Select/SeasonSelect.js +12 -0
- package/es/components/Select/SettleAccountSelect.d.ts +5 -0
- package/es/components/Select/SettleAccountSelect.js +12 -0
- package/es/components/Select/SettleCategorySelect.d.ts +5 -0
- package/es/components/Select/SettleCategorySelect.js +12 -0
- package/es/components/Select/SettleCompanySelect.d.ts +5 -0
- package/es/components/Select/SettleCompanySelect.js +12 -0
- package/es/components/Select/ShopPageSelect.d.ts +5 -0
- package/es/components/Select/ShopPageSelect.js +12 -0
- package/es/components/Select/SizeTypeSelect.d.ts +5 -0
- package/es/components/Select/SizeTypeSelect.js +12 -0
- package/es/components/Select/StoreSelect.d.ts +5 -0
- package/es/components/Select/StoreSelect.js +12 -0
- package/es/components/Select/SupplierSelect.d.ts +5 -0
- package/es/components/Select/SupplierSelect.js +12 -0
- package/es/components/Select/TransportLocnoSelect.d.ts +5 -0
- package/es/components/Select/TransportLocnoSelect.js +12 -0
- package/es/components/Select/TransportPointPageSelect.d.ts +5 -0
- package/es/components/Select/TransportPointPageSelect.js +12 -0
- package/es/components/Select/UploadPointPageSelect.d.ts +5 -0
- package/es/components/Select/UploadPointPageSelect.js +12 -0
- package/es/components/Select/YearSelect.d.ts +5 -0
- package/es/components/Select/YearSelect.js +12 -0
- package/es/components/Select/common.d.ts +32 -0
- package/es/components/Select/common.js +20 -0
- package/es/components/Select/index.less +17 -0
- package/es/components/ViewOffice.js +1 -0
- package/es/components/index.d.ts +28 -0
- package/es/components/index.js +29 -1
- package/es/hooks/useMdm.d.ts +11 -2
- package/es/hooks/useMdm.js +26 -11
- package/es/http/index.d.ts +21 -0
- package/es/http/index.js +246 -2
- package/es/http/mdmCache.d.ts +19 -0
- package/es/http/mdmCache.js +157 -0
- package/es/http/mdmRequest.d.ts +148 -73
- package/es/http/mdmRequest.js +223 -93
- package/es/utils/index.d.ts +5 -3
- package/es/utils/index.js +15 -3
- package/es/utils/modal.js +1 -1
- package/es/utils/pasteUpload.d.ts +27 -0
- package/es/utils/pasteUpload.js +117 -0
- package/lib/components/Select/AreaCitySelect.d.ts +5 -0
- package/lib/components/Select/AreaCitySelect.js +25 -0
- package/lib/components/Select/AreaDistrictSelect.d.ts +5 -0
- package/lib/components/Select/AreaDistrictSelect.js +25 -0
- package/lib/components/Select/AreaProvinceSelect.d.ts +5 -0
- package/lib/components/Select/AreaProvinceSelect.js +25 -0
- package/lib/components/Select/Base.d.ts +11 -0
- package/lib/components/Select/Base.js +127 -0
- package/lib/components/Select/BrandDeptSelect.d.ts +5 -0
- package/lib/components/Select/BrandDeptSelect.js +12 -0
- package/lib/components/Select/CategorySelect.d.ts +5 -0
- package/lib/components/Select/CategorySelect.js +12 -0
- package/lib/components/Select/ColorSelect.d.ts +5 -0
- package/lib/components/Select/ColorSelect.js +12 -0
- package/lib/components/Select/ExpressCompanyPageSelect.d.ts +5 -0
- package/lib/components/Select/ExpressCompanyPageSelect.js +12 -0
- package/lib/components/Select/ExpressCompanySelect.d.ts +5 -0
- package/lib/components/Select/ExpressCompanySelect.js +12 -0
- package/lib/components/Select/GenderSelect.d.ts +5 -0
- package/lib/components/Select/GenderSelect.js +12 -0
- package/lib/components/Select/LogisticCategorySelect.d.ts +5 -0
- package/lib/components/Select/LogisticCategorySelect.js +12 -0
- package/lib/components/Select/LogisticRegionSelect.d.ts +5 -0
- package/lib/components/Select/LogisticRegionSelect.js +12 -0
- package/lib/components/Select/ManagingCitySelect.d.ts +5 -0
- package/lib/components/Select/ManagingCitySelect.js +12 -0
- package/lib/components/Select/OwnerSelect.d.ts +5 -0
- package/lib/components/Select/OwnerSelect.js +12 -0
- package/lib/components/Select/PhysicalStoreSelect.d.ts +5 -0
- package/lib/components/Select/PhysicalStoreSelect.js +12 -0
- package/lib/components/Select/PowerUnitSelect.d.ts +5 -0
- package/lib/components/Select/PowerUnitSelect.js +12 -0
- package/lib/components/Select/ProfitLossMainSelect.d.ts +5 -0
- package/lib/components/Select/ProfitLossMainSelect.js +12 -0
- package/lib/components/Select/SeasonSelect.d.ts +5 -0
- package/lib/components/Select/SeasonSelect.js +12 -0
- package/lib/components/Select/SettleAccountSelect.d.ts +5 -0
- package/lib/components/Select/SettleAccountSelect.js +12 -0
- package/lib/components/Select/SettleCategorySelect.d.ts +5 -0
- package/lib/components/Select/SettleCategorySelect.js +12 -0
- package/lib/components/Select/SettleCompanySelect.d.ts +5 -0
- package/lib/components/Select/SettleCompanySelect.js +12 -0
- package/lib/components/Select/ShopPageSelect.d.ts +5 -0
- package/lib/components/Select/ShopPageSelect.js +12 -0
- package/lib/components/Select/SizeTypeSelect.d.ts +5 -0
- package/lib/components/Select/SizeTypeSelect.js +12 -0
- package/lib/components/Select/StoreSelect.d.ts +5 -0
- package/lib/components/Select/StoreSelect.js +12 -0
- package/lib/components/Select/SupplierSelect.d.ts +5 -0
- package/lib/components/Select/SupplierSelect.js +12 -0
- package/lib/components/Select/TransportLocnoSelect.d.ts +5 -0
- package/lib/components/Select/TransportLocnoSelect.js +12 -0
- package/lib/components/Select/TransportPointPageSelect.d.ts +5 -0
- package/lib/components/Select/TransportPointPageSelect.js +12 -0
- package/lib/components/Select/UploadPointPageSelect.d.ts +5 -0
- package/lib/components/Select/UploadPointPageSelect.js +12 -0
- package/lib/components/Select/YearSelect.d.ts +5 -0
- package/lib/components/Select/YearSelect.js +12 -0
- package/lib/components/Select/common.d.ts +32 -0
- package/lib/components/Select/common.js +20 -0
- package/lib/components/Select/index.less +17 -0
- package/lib/components/ViewOffice.js +1 -0
- package/lib/components/index.d.ts +28 -0
- package/lib/components/index.js +29 -1
- package/lib/hooks/useMdm.d.ts +11 -2
- package/lib/hooks/useMdm.js +26 -11
- package/lib/http/index.d.ts +21 -0
- package/lib/http/index.js +246 -2
- package/lib/http/mdmCache.d.ts +19 -0
- package/lib/http/mdmCache.js +157 -0
- package/lib/http/mdmRequest.d.ts +148 -73
- package/lib/http/mdmRequest.js +223 -93
- package/lib/utils/index.d.ts +5 -3
- package/lib/utils/index.js +15 -3
- package/lib/utils/modal.js +1 -1
- package/lib/utils/pasteUpload.d.ts +27 -0
- package/lib/utils/pasteUpload.js +117 -0
- package/package.json +1 -1
package/lib/http/mdmRequest.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { httpBatchGet } from '.';
|
|
4
|
-
import { getCache, setCache } from '../utils';
|
|
4
|
+
import { getCache, setCache, clearCache } from '../utils';
|
|
5
|
+
import { getMdmCache, setMdmCache, deleteMdmCache, clearMdmCache as clearMdmCacheInMemory } from './mdmCache';
|
|
6
|
+
/**
|
|
7
|
+
* 设置分页,默认取50000条
|
|
8
|
+
*
|
|
9
|
+
* @param params
|
|
10
|
+
*/
|
|
5
11
|
export var setPageSize = function setPageSize() {
|
|
6
12
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
13
|
if (params && params.pageSize === undefined) {
|
|
@@ -11,16 +17,14 @@ export var setPageSize = function setPageSize() {
|
|
|
11
17
|
function httpGetWithCache(_x, _x2) {
|
|
12
18
|
return _httpGetWithCache.apply(this, arguments);
|
|
13
19
|
}
|
|
14
|
-
/**
|
|
15
|
-
* @param params 请求参数
|
|
16
|
-
* @name 获取主数据货主数据,调用接口/lesoon-mdm-center-api/bmOwner/page
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
20
|
+
/** 主数据接口地址 */
|
|
19
21
|
function _httpGetWithCache() {
|
|
20
22
|
_httpGetWithCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(type, url) {
|
|
21
23
|
var _result$flag;
|
|
22
24
|
var params,
|
|
25
|
+
cache,
|
|
23
26
|
cacheKey,
|
|
27
|
+
memoryCacheData,
|
|
24
28
|
cacheData,
|
|
25
29
|
result,
|
|
26
30
|
_args2 = arguments;
|
|
@@ -28,23 +32,40 @@ function _httpGetWithCache() {
|
|
|
28
32
|
while (1) switch (_context2.prev = _context2.next) {
|
|
29
33
|
case 0:
|
|
30
34
|
params = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
|
|
35
|
+
cache = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : true;
|
|
31
36
|
cacheKey = "mdm-".concat(type, "-").concat(JSON.stringify(params));
|
|
37
|
+
if (!cache) {
|
|
38
|
+
_context2.next = 10;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
memoryCacheData = getMdmCache(cacheKey);
|
|
42
|
+
if (!memoryCacheData) {
|
|
43
|
+
_context2.next = 7;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
return _context2.abrupt("return", memoryCacheData);
|
|
47
|
+
case 7:
|
|
32
48
|
cacheData = getCache(cacheKey, true);
|
|
33
49
|
if (!cacheData) {
|
|
34
|
-
_context2.next =
|
|
50
|
+
_context2.next = 10;
|
|
35
51
|
break;
|
|
36
52
|
}
|
|
37
53
|
return _context2.abrupt("return", cacheData);
|
|
38
|
-
case
|
|
39
|
-
_context2.next =
|
|
54
|
+
case 10:
|
|
55
|
+
_context2.next = 12;
|
|
40
56
|
return httpBatchGet(url, params);
|
|
41
|
-
case
|
|
57
|
+
case 12:
|
|
42
58
|
result = _context2.sent;
|
|
43
|
-
if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0') {
|
|
44
|
-
|
|
59
|
+
if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0' && cache) {
|
|
60
|
+
try {
|
|
61
|
+
setCache(cacheKey, result, true);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
// 缓存太大时无法保存,设置到内存中缓存
|
|
64
|
+
setMdmCache(cacheKey, result);
|
|
65
|
+
}
|
|
45
66
|
}
|
|
46
67
|
return _context2.abrupt("return", result);
|
|
47
|
-
case
|
|
68
|
+
case 15:
|
|
48
69
|
case "end":
|
|
49
70
|
return _context2.stop();
|
|
50
71
|
}
|
|
@@ -52,19 +73,55 @@ function _httpGetWithCache() {
|
|
|
52
73
|
}));
|
|
53
74
|
return _httpGetWithCache.apply(this, arguments);
|
|
54
75
|
}
|
|
76
|
+
export var mdmApi = {
|
|
77
|
+
owner: '/lesoon-mdm-center-api/bmOwner/page',
|
|
78
|
+
store: '/lesoon-mdm-center-api/bmStore/page',
|
|
79
|
+
brandDept: '/lesoon-mdm-center-api/bmBrandDept/page',
|
|
80
|
+
logisticRegion: '/lesoon-mdm-center-api/bmLogisticRegion/page',
|
|
81
|
+
expressCompany: '/lesoon-mdm-center-api/bmForwarder/page',
|
|
82
|
+
expressCompanyPage: '/lesoon-mdm-center-api/bmForwarder/pageVo',
|
|
83
|
+
physicalStore: '/lesoon-mdm-center-api/bmPhysicalStore/page',
|
|
84
|
+
settleCategory: '/lesoon-mdm-center-api/bmSettlementCate/page',
|
|
85
|
+
profitLossMain: '/lesoon-mdm-center-api/bmProfitLossMain/page',
|
|
86
|
+
settleCompany: '/lesoon-mdm-center-api/bmSettleCompany/page',
|
|
87
|
+
powerUnit: '/lesoon-mdm-center-api/bmPowerUnit/page',
|
|
88
|
+
settleAccount: '/lesoon-mdm-center-api/bmSettleAccount/page',
|
|
89
|
+
logisticCategory: '/lesoon-mdm-center-api/bmLogisticCategory/page',
|
|
90
|
+
managingCity: '/lesoon-mdm-center-api/bmManagingCity/page',
|
|
91
|
+
area: '/lesoon-mdm-center-api/sysAdministrativeDivision/page',
|
|
92
|
+
transportLocno: '/lesoon-mdm-center-api/tmsTransportLocno/page',
|
|
93
|
+
transportPointPage: '/lesoon-mdm-center-api/tmsTransportPoint/getTransportPointByPage',
|
|
94
|
+
uploadPointPage: '/lesoon-mdm-center-api/tmsUploadPoint/findTmpUploadPintList',
|
|
95
|
+
shopPage: '/lesoon-mdm-center-api/bmShop/pageVo',
|
|
96
|
+
color: '/lesoon-mdm-center-api/bmColor/page',
|
|
97
|
+
sizeType: '/lesoon-mdm-center-api/bmSizeType/page',
|
|
98
|
+
gender: '/lesoon-mdm-center-api/bmGender/page',
|
|
99
|
+
year: '/lesoon-mdm-center-api/bmYear/page',
|
|
100
|
+
season: '/lesoon-mdm-center-api/bmSeason/page',
|
|
101
|
+
category: '/lesoon-mdm-center-api/bmCategory/page',
|
|
102
|
+
supplier: '/lesoon-mdm-center-api/bmSupplier/page'
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* @param params 请求参数
|
|
106
|
+
* @param cache 是否启用缓存
|
|
107
|
+
* @name 获取主数据货主数据,调用接口/lesoon-mdm-center-api/bmOwner/page
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
55
110
|
export var getOwner = /*#__PURE__*/function () {
|
|
56
111
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
57
112
|
var params,
|
|
113
|
+
cache,
|
|
58
114
|
url,
|
|
59
115
|
_args = arguments;
|
|
60
116
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
61
117
|
while (1) switch (_context.prev = _context.next) {
|
|
62
118
|
case 0:
|
|
63
119
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
120
|
+
cache = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;
|
|
64
121
|
setPageSize(params);
|
|
65
|
-
url =
|
|
66
|
-
return _context.abrupt("return", httpGetWithCache('owner', url, params));
|
|
67
|
-
case
|
|
122
|
+
url = mdmApi.owner;
|
|
123
|
+
return _context.abrupt("return", httpGetWithCache('owner', url, params, cache));
|
|
124
|
+
case 5:
|
|
68
125
|
case "end":
|
|
69
126
|
return _context.stop();
|
|
70
127
|
}
|
|
@@ -76,276 +133,331 @@ export var getOwner = /*#__PURE__*/function () {
|
|
|
76
133
|
}();
|
|
77
134
|
/**
|
|
78
135
|
* @param params 请求参数
|
|
136
|
+
* @param cache 是否启用缓存
|
|
79
137
|
* @name 获取主数据仓库数据,调用接口/lesoon-mdm-center-api/bmStore/page
|
|
80
138
|
* @returns
|
|
81
139
|
*/
|
|
82
140
|
export var getStore = function getStore() {
|
|
83
141
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
142
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
84
143
|
setPageSize(params);
|
|
85
|
-
var url =
|
|
86
|
-
return httpGetWithCache('store', url, params);
|
|
144
|
+
var url = mdmApi.store;
|
|
145
|
+
return httpGetWithCache('store', url, params, cache);
|
|
87
146
|
};
|
|
88
147
|
/**
|
|
89
148
|
* @param params 请求参数
|
|
149
|
+
* @param cache 是否启用缓存
|
|
90
150
|
* @name 获取主数据品牌部数据,调用接口/lesoon-mdm-center-api/bmBrandDept/page
|
|
91
151
|
* @returns
|
|
92
152
|
*/
|
|
93
153
|
export var getBrandDept = function getBrandDept() {
|
|
94
154
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
155
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
95
156
|
setPageSize(params);
|
|
96
|
-
var url =
|
|
97
|
-
return httpGetWithCache('brandDept', url, params);
|
|
157
|
+
var url = mdmApi.brandDept;
|
|
158
|
+
return httpGetWithCache('brandDept', url, params, cache);
|
|
98
159
|
};
|
|
99
160
|
/**
|
|
100
161
|
* @param params 请求参数
|
|
162
|
+
* @param cache 是否启用缓存
|
|
101
163
|
* @name 获取主数据物流大区数据,调用接口/lesoon-mdm-center-api/bmLogisticRegion/page
|
|
102
164
|
* @returns
|
|
103
165
|
*/
|
|
104
166
|
export var getLogisticRegion = function getLogisticRegion() {
|
|
105
167
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
168
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
106
169
|
setPageSize(params);
|
|
107
|
-
var url =
|
|
108
|
-
return httpGetWithCache('region', url, params);
|
|
170
|
+
var url = mdmApi.logisticRegion;
|
|
171
|
+
return httpGetWithCache('region', url, params, cache);
|
|
109
172
|
};
|
|
110
173
|
/**
|
|
111
|
-
* @param where:
|
|
174
|
+
* @param params 请求参数 {where:{forwarderLevel: 1 // 承运商级别 1:一级 2:二级 , forwarderType: 1 // 承运商类型
|
|
175
|
+
* 0:货运公司 1:快递公司 }}
|
|
176
|
+
* @param cache 是否启用缓存
|
|
112
177
|
* @name 获取快递/快运承运商,调用接口/lesoon-mdm-center-api/bmForwarder/page
|
|
113
178
|
* @returns
|
|
114
179
|
*/
|
|
115
180
|
export var getExpressCompany = function getExpressCompany() {
|
|
116
181
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
182
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
117
183
|
setPageSize(params);
|
|
118
|
-
var url =
|
|
119
|
-
return httpGetWithCache('forwarder', url, params);
|
|
184
|
+
var url = mdmApi.expressCompany;
|
|
185
|
+
return httpGetWithCache('forwarder', url, params, cache);
|
|
120
186
|
};
|
|
121
187
|
/**
|
|
188
|
+
* @param params 请求参数
|
|
189
|
+
* @param cache 是否启用缓存
|
|
122
190
|
* @name 分页获取快递公司/承运商,调用接口/lesoon-mdm-center-api/bmForwarder/pageVo
|
|
123
191
|
* @returns
|
|
124
192
|
*/
|
|
125
193
|
export var getExpressCompanyPage = function getExpressCompanyPage() {
|
|
126
194
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
195
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
127
196
|
setPageSize(params);
|
|
128
|
-
var url =
|
|
129
|
-
return httpGetWithCache('forwarder', url, params);
|
|
197
|
+
var url = mdmApi.expressCompanyPage;
|
|
198
|
+
return httpGetWithCache('forwarder', url, params, cache);
|
|
130
199
|
};
|
|
131
200
|
/**
|
|
201
|
+
* @param params 请求参数
|
|
202
|
+
* @param cache 是否启用缓存
|
|
132
203
|
* @name 实体仓,调用接口/lesoon-mdm-center-api/bmPhysicalStore/page
|
|
133
204
|
* @returns
|
|
134
205
|
*/
|
|
135
206
|
export var getPhysicalStore = function getPhysicalStore() {
|
|
136
207
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
208
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
137
209
|
setPageSize(params);
|
|
138
|
-
var url =
|
|
139
|
-
return httpGetWithCache('physicalStore', url, params);
|
|
210
|
+
var url = mdmApi.physicalStore;
|
|
211
|
+
return httpGetWithCache('physicalStore', url, params, cache);
|
|
140
212
|
};
|
|
141
213
|
/**
|
|
142
|
-
* @param params
|
|
214
|
+
* @param params 请求参数
|
|
215
|
+
* @param cache 是否启用缓存
|
|
143
216
|
* @name 结算大类,调用接口/lesoon-mdm-center-api/bmSettlementCate/page
|
|
144
217
|
* @returns
|
|
145
218
|
*/
|
|
146
219
|
export var getSettleCategory = function getSettleCategory() {
|
|
147
220
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
221
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
148
222
|
setPageSize(params);
|
|
149
|
-
var url =
|
|
150
|
-
return httpGetWithCache('settlementCate', url, params);
|
|
223
|
+
var url = mdmApi.settleCategory;
|
|
224
|
+
return httpGetWithCache('settlementCate', url, params, cache);
|
|
151
225
|
};
|
|
152
226
|
/**
|
|
153
|
-
* @param
|
|
227
|
+
* @param params 请求参数
|
|
228
|
+
* @param cache 是否启用缓存
|
|
154
229
|
* @name 获取损益主体,调用接口/lesoon-mdm-center-api/bmProfitLossMain/page
|
|
155
230
|
* @returns
|
|
156
231
|
*/
|
|
157
232
|
export var getProfitLossMain = function getProfitLossMain() {
|
|
158
233
|
var param = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
234
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
159
235
|
setPageSize(param);
|
|
160
|
-
var url =
|
|
161
|
-
return httpGetWithCache('profitLossMain', url, param);
|
|
236
|
+
var url = mdmApi.profitLossMain;
|
|
237
|
+
return httpGetWithCache('profitLossMain', url, param, cache);
|
|
162
238
|
};
|
|
163
239
|
/**
|
|
164
|
-
* @param params
|
|
240
|
+
* @param params 请求参数
|
|
241
|
+
* @param cache 是否启用缓存
|
|
165
242
|
* @name 结算公司,调用接口/lesoon-mdm-center-api/bmSettleCompany/page
|
|
166
243
|
* @returns
|
|
167
244
|
*/
|
|
168
245
|
export var getSettleCompany = function getSettleCompany() {
|
|
169
246
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
247
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
170
248
|
setPageSize(params);
|
|
171
|
-
var url =
|
|
172
|
-
return httpGetWithCache('settleCompany', url, params);
|
|
249
|
+
var url = mdmApi.settleCompany;
|
|
250
|
+
return httpGetWithCache('settleCompany', url, params, cache);
|
|
173
251
|
};
|
|
174
252
|
/**
|
|
175
|
-
* @param params
|
|
253
|
+
* @param params 请求参数
|
|
254
|
+
* @param cache 是否启用缓存
|
|
176
255
|
* @name 货权,调用接口/lesoon-mdm-center-api/bmPowerUnit/page
|
|
177
256
|
* @returns
|
|
178
257
|
*/
|
|
179
258
|
export var getPowerUnit = function getPowerUnit() {
|
|
180
259
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
260
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
181
261
|
setPageSize(params);
|
|
182
|
-
var url =
|
|
183
|
-
return httpGetWithCache('powerUnit', url, params);
|
|
262
|
+
var url = mdmApi.powerUnit;
|
|
263
|
+
return httpGetWithCache('powerUnit', url, params, cache);
|
|
184
264
|
};
|
|
185
265
|
/**
|
|
186
|
-
* @param params
|
|
266
|
+
* @param params 请求参数
|
|
267
|
+
* @param cache 是否启用缓存
|
|
187
268
|
* @name 结算账号,调用接口/lesoon-mdm-center-api/bmSettleAccount/page
|
|
188
269
|
* @returns
|
|
189
270
|
*/
|
|
190
271
|
export var getSettleAccount = function getSettleAccount() {
|
|
191
272
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
273
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
192
274
|
setPageSize(params);
|
|
193
|
-
var url =
|
|
194
|
-
return httpGetWithCache('settleAccount', url, params);
|
|
275
|
+
var url = mdmApi.settleAccount;
|
|
276
|
+
return httpGetWithCache('settleAccount', url, params, cache);
|
|
195
277
|
};
|
|
196
278
|
/**
|
|
279
|
+
* @param params 请求参数
|
|
280
|
+
* @param cache 是否启用缓存
|
|
197
281
|
* @name 获取物流大类,调用接口/lesoon-mdm-center-api/bmLogisticCategory/page
|
|
198
282
|
* @returns
|
|
199
283
|
*/
|
|
200
284
|
export var getLogisticCategory = function getLogisticCategory() {
|
|
201
285
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
286
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
202
287
|
setPageSize(params);
|
|
203
|
-
var url =
|
|
204
|
-
return httpGetWithCache('logisticCategory', url, params);
|
|
288
|
+
var url = mdmApi.logisticCategory;
|
|
289
|
+
return httpGetWithCache('logisticCategory', url, params, cache);
|
|
205
290
|
};
|
|
206
291
|
/**
|
|
207
|
-
* @param
|
|
292
|
+
* @param params 请求参数
|
|
293
|
+
* @param cache 是否启用缓存
|
|
208
294
|
* @name 管理城市,调用接口/lesoon-mdm-center-api/bmManagingCity/page
|
|
209
295
|
* @returns
|
|
210
296
|
*/
|
|
211
297
|
export var getManagingCity = function getManagingCity() {
|
|
212
298
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
299
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
213
300
|
setPageSize(params);
|
|
214
|
-
var url =
|
|
215
|
-
return httpGetWithCache('managingCity', url, params);
|
|
301
|
+
var url = mdmApi.managingCity;
|
|
302
|
+
return httpGetWithCache('managingCity', url, params, cache);
|
|
216
303
|
};
|
|
217
304
|
/**
|
|
218
|
-
* @param {where: {level:'province'}} level Province=省,city=市,district=区
|
|
305
|
+
* @param params 请求参数 {where: {level:'province'}} level Province=省,city=市,district=区
|
|
306
|
+
* @param cache 是否启用缓存
|
|
219
307
|
* @name 获取省市区,调用接口/lesoon-mdm-center-api/sysAdministrativeDivision/page
|
|
220
308
|
* @returns
|
|
221
309
|
*/
|
|
222
310
|
export var getArea = function getArea() {
|
|
223
311
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
312
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
224
313
|
setPageSize(params);
|
|
225
|
-
var url =
|
|
226
|
-
return httpGetWithCache('area', url, params);
|
|
314
|
+
var url = mdmApi.area;
|
|
315
|
+
return httpGetWithCache('area', url, params, cache);
|
|
227
316
|
};
|
|
228
317
|
/**
|
|
229
|
-
* @param
|
|
318
|
+
* @param params 请求参数
|
|
319
|
+
* @param cache 是否启用缓存
|
|
230
320
|
* @name 获取集散中心,调用接口/lesoon-mdm-center-api/tmsTransportLocno/page
|
|
231
321
|
* @returns
|
|
232
322
|
*/
|
|
233
323
|
export var getTransportLocno = function getTransportLocno() {
|
|
234
324
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
325
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
235
326
|
setPageSize(params);
|
|
236
|
-
var url =
|
|
237
|
-
return httpGetWithCache('transportLocno', url, params);
|
|
327
|
+
var url = mdmApi.transportLocno;
|
|
328
|
+
return httpGetWithCache('transportLocno', url, params, cache);
|
|
238
329
|
};
|
|
239
330
|
/**
|
|
240
|
-
* @param
|
|
331
|
+
* @param params 请求参数
|
|
332
|
+
* @param cache 是否启用缓存
|
|
241
333
|
* @name 分页获取配送点,调用接口/lesoon-mdm-center-api/tmsTransportPoint/getTransportPointByPage
|
|
242
334
|
* @returns
|
|
243
335
|
*/
|
|
244
336
|
export var getTransportPointPage = function getTransportPointPage() {
|
|
245
337
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
338
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
246
339
|
setPageSize(params);
|
|
247
|
-
var url =
|
|
248
|
-
return httpGetWithCache('transportPoint', url, params);
|
|
340
|
+
var url = mdmApi.transportPointPage;
|
|
341
|
+
return httpGetWithCache('transportPoint', url, params, cache);
|
|
249
342
|
};
|
|
250
343
|
/**
|
|
251
|
-
* @param
|
|
344
|
+
* @param params 请求参数
|
|
345
|
+
* @param cache 是否启用缓存
|
|
252
346
|
* @name 分页获取卸货点,调用接口/lesoon-mdm-center-api/tmsUploadPoint/findTmpUploadPintList
|
|
253
347
|
* @returns
|
|
254
348
|
*/
|
|
255
349
|
export var getUploadPointPage = function getUploadPointPage() {
|
|
256
350
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
351
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
257
352
|
setPageSize(params);
|
|
258
|
-
var url =
|
|
259
|
-
return httpGetWithCache('uploadPoint', url, params);
|
|
353
|
+
var url = mdmApi.uploadPointPage;
|
|
354
|
+
return httpGetWithCache('uploadPoint', url, params, cache);
|
|
260
355
|
};
|
|
261
356
|
/**
|
|
262
|
-
* @param
|
|
357
|
+
* @param params 请求参数
|
|
358
|
+
* @param cache 是否启用缓存
|
|
263
359
|
* @name 分页获取店铺,调用接口/lesoon-mdm-center-api/bmShop/pageVo
|
|
264
360
|
* @returns
|
|
265
361
|
*/
|
|
266
362
|
export var getShopPage = function getShopPage() {
|
|
267
363
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
364
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
268
365
|
setPageSize(params);
|
|
269
|
-
var url =
|
|
270
|
-
return httpGetWithCache('shop', url, params);
|
|
366
|
+
var url = mdmApi.shopPage;
|
|
367
|
+
return httpGetWithCache('shop', url, params, cache);
|
|
271
368
|
};
|
|
272
369
|
/**
|
|
273
|
-
* @param
|
|
370
|
+
* @param params 请求参数
|
|
371
|
+
* @param cache 是否启用缓存
|
|
274
372
|
* @name 获取颜色,调用接口/lesoon-mdm-center-api/bmColor/page
|
|
275
373
|
* @returns
|
|
276
374
|
*/
|
|
277
375
|
export var getColor = function getColor() {
|
|
278
376
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
377
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
279
378
|
setPageSize(params);
|
|
280
|
-
var url =
|
|
281
|
-
return httpGetWithCache('color', url, params);
|
|
379
|
+
var url = mdmApi.color;
|
|
380
|
+
return httpGetWithCache('color', url, params, cache);
|
|
282
381
|
};
|
|
283
382
|
/**
|
|
284
|
-
* @param
|
|
383
|
+
* @param params 请求参数
|
|
384
|
+
* @param cache 是否启用缓存
|
|
285
385
|
* @name 获取尺码类型,调用接口/lesoon-mdm-center-api/bmSizeType/page
|
|
286
386
|
* @returns
|
|
287
387
|
*/
|
|
288
388
|
export var getSizeType = function getSizeType() {
|
|
289
389
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
390
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
290
391
|
setPageSize(params);
|
|
291
|
-
var url =
|
|
292
|
-
return httpGetWithCache('sizeType', url, params);
|
|
392
|
+
var url = mdmApi.sizeType;
|
|
393
|
+
return httpGetWithCache('sizeType', url, params, cache);
|
|
293
394
|
};
|
|
294
395
|
/**
|
|
295
|
-
* @param
|
|
396
|
+
* @param params 请求参数
|
|
397
|
+
* @param cache 是否启用缓存
|
|
296
398
|
* @name 获取性别,调用接口/lesoon-mdm-center-api/bmGender/page
|
|
297
399
|
* @returns
|
|
298
400
|
*/
|
|
299
401
|
export var getGender = function getGender() {
|
|
300
402
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
403
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
301
404
|
setPageSize(params);
|
|
302
|
-
var url =
|
|
303
|
-
return httpGetWithCache('gender', url, params);
|
|
405
|
+
var url = mdmApi.gender;
|
|
406
|
+
return httpGetWithCache('gender', url, params, cache);
|
|
304
407
|
};
|
|
305
408
|
/**
|
|
306
|
-
* @param
|
|
409
|
+
* @param params 请求参数
|
|
410
|
+
* @param cache 是否启用缓存
|
|
307
411
|
* @name 获取年份,调用接口/lesoon-mdm-center-api/bmYear/page
|
|
308
412
|
* @returns
|
|
309
413
|
*/
|
|
310
414
|
export var getYear = function getYear() {
|
|
311
415
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
416
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
312
417
|
setPageSize(params);
|
|
313
|
-
var url =
|
|
314
|
-
return httpGetWithCache('year', url, params);
|
|
418
|
+
var url = mdmApi.year;
|
|
419
|
+
return httpGetWithCache('year', url, params, cache);
|
|
315
420
|
};
|
|
316
421
|
/**
|
|
317
|
-
* @param
|
|
422
|
+
* @param params 请求参数
|
|
423
|
+
* @param cache 是否启用缓存
|
|
318
424
|
* @name 获取季节,调用接口/lesoon-mdm-center-api/bmSeason/page
|
|
319
425
|
* @returns
|
|
320
426
|
*/
|
|
321
427
|
export var getSeason = function getSeason() {
|
|
322
428
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
429
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
323
430
|
setPageSize(params);
|
|
324
|
-
var url =
|
|
325
|
-
return httpGetWithCache('season', url, params);
|
|
431
|
+
var url = mdmApi.season;
|
|
432
|
+
return httpGetWithCache('season', url, params, cache);
|
|
326
433
|
};
|
|
327
434
|
/**
|
|
328
|
-
* @param
|
|
435
|
+
* @param params 请求参数
|
|
436
|
+
* @param cache 是否启用缓存
|
|
329
437
|
* @name 获取品类,调用接口/lesoon-mdm-center-api/bmCategory/page
|
|
330
438
|
* @returns
|
|
331
439
|
*/
|
|
332
440
|
export var getCategory = function getCategory() {
|
|
333
441
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
442
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
334
443
|
setPageSize(params);
|
|
335
|
-
var url =
|
|
336
|
-
return httpGetWithCache('category', url, params);
|
|
444
|
+
var url = mdmApi.category;
|
|
445
|
+
return httpGetWithCache('category', url, params, cache);
|
|
337
446
|
};
|
|
338
447
|
/**
|
|
339
|
-
* @param params
|
|
448
|
+
* @param params 请求参数
|
|
449
|
+
* @param cache 是否启用缓存
|
|
340
450
|
* @name 供应商,调用接口/lesoon-mdm-center-api/bmSupplier/page
|
|
341
451
|
* @returns
|
|
342
452
|
*/
|
|
343
453
|
export var getSupplier = function getSupplier() {
|
|
344
454
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
455
|
+
var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
345
456
|
setPageSize(params);
|
|
346
|
-
var url =
|
|
347
|
-
return httpGetWithCache('supplier', url, params);
|
|
457
|
+
var url = mdmApi.supplier;
|
|
458
|
+
return httpGetWithCache('supplier', url, params, cache);
|
|
348
459
|
};
|
|
460
|
+
/** 主数据类型映射 */
|
|
349
461
|
var mdmMap = {
|
|
350
462
|
owner: getOwner,
|
|
351
463
|
store: getStore,
|
|
@@ -374,19 +486,37 @@ var mdmMap = {
|
|
|
374
486
|
category: getCategory,
|
|
375
487
|
supplier: getSupplier
|
|
376
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* 通用获取主数据方法
|
|
491
|
+
*
|
|
492
|
+
* @param type 主数据类型
|
|
493
|
+
* @param params 请求参数
|
|
494
|
+
* @param cache 是否启用缓存
|
|
495
|
+
* @returns
|
|
496
|
+
*/
|
|
377
497
|
export var getMdmData = function getMdmData(type) {
|
|
378
498
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
499
|
+
var cache = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
379
500
|
var fn = mdmMap[type];
|
|
380
501
|
if (!fn) {
|
|
381
502
|
throw new Error("".concat(type, " \u4E0D\u5B58\u5728"));
|
|
382
503
|
}
|
|
383
|
-
return fn(params);
|
|
504
|
+
return fn(params, cache);
|
|
384
505
|
};
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
506
|
+
/** 清空主数据缓存 */
|
|
507
|
+
export var clearMdmCache = function clearMdmCache(keys) {
|
|
508
|
+
if (keys) {
|
|
509
|
+
keys.forEach(function (key) {
|
|
510
|
+
deleteMdmCache(key);
|
|
511
|
+
clearCache(key, true);
|
|
512
|
+
});
|
|
513
|
+
} else {
|
|
514
|
+
clearMdmCacheInMemory();
|
|
515
|
+
// 清空所有 mdm- 开头的缓存
|
|
516
|
+
Object.keys(sessionStorage).forEach(function (key) {
|
|
517
|
+
if (key.startsWith('mdm-')) {
|
|
518
|
+
clearCache(key, true);
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}
|
|
392
522
|
};
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './size';
|
|
|
6
6
|
export * from './promise';
|
|
7
7
|
export * from './clac';
|
|
8
8
|
export { getBrowserId } from 'ls-pro-tools';
|
|
9
|
+
export * from './pasteUpload';
|
|
9
10
|
/**
|
|
10
11
|
* 获取 url 参数
|
|
11
12
|
*
|
|
@@ -134,11 +135,12 @@ export declare const off: (eventName: string, fn: Function, el: any | undefined)
|
|
|
134
135
|
* @param bodyParam Post传参数
|
|
135
136
|
* @param param Get传参数
|
|
136
137
|
* @param method 请求方式,默认post
|
|
138
|
+
* @param isNewPrintCenter 是否是新的打印中心,默认false
|
|
137
139
|
* @returns
|
|
138
140
|
*/
|
|
139
|
-
export declare const printView: (templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET') => any;
|
|
141
|
+
export declare const printView: (templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET', isNewPrintCenter?: boolean) => any;
|
|
140
142
|
/**
|
|
141
|
-
*
|
|
143
|
+
* 直接打印,通过打印组件进行打印。
|
|
142
144
|
*
|
|
143
145
|
* @param taskName 打印任务名
|
|
144
146
|
* @param templateNo 打印模板
|
|
@@ -148,7 +150,7 @@ export declare const printView: (templateNo: string, reqUrl: string, bodyParam?:
|
|
|
148
150
|
* @param method 请求方式,默认post
|
|
149
151
|
* @returns
|
|
150
152
|
*/
|
|
151
|
-
export declare const printAsync: (taskName: string, templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET') => Promise<any>;
|
|
153
|
+
export declare const printAsync: (taskName: string, templateNo: string, reqUrl: string, bodyParam?: any, param?: any, method?: 'POST' | 'GET', isNewPrintCenter?: boolean) => Promise<any>;
|
|
152
154
|
export declare const isDev: boolean;
|
|
153
155
|
export declare type UserType = {
|
|
154
156
|
id?: string;
|
package/lib/utils/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from './size';
|
|
|
9
9
|
export * from './promise';
|
|
10
10
|
export * from './clac';
|
|
11
11
|
export { getBrowserId } from 'ls-pro-tools';
|
|
12
|
+
export * from './pasteUpload';
|
|
12
13
|
/**
|
|
13
14
|
* 获取 url 参数
|
|
14
15
|
*
|
|
@@ -312,13 +313,19 @@ export var off = function off(eventName, fn, el) {
|
|
|
312
313
|
* @param bodyParam Post传参数
|
|
313
314
|
* @param param Get传参数
|
|
314
315
|
* @param method 请求方式,默认post
|
|
316
|
+
* @param isNewPrintCenter 是否是新的打印中心,默认false
|
|
315
317
|
* @returns
|
|
316
318
|
*/
|
|
317
319
|
export var printView = function printView(templateNo, reqUrl) {
|
|
318
320
|
var bodyParam = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
319
321
|
var param = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
320
322
|
var method = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'POST';
|
|
321
|
-
var
|
|
323
|
+
var isNewPrintCenter = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
324
|
+
var api = '/petrel-print-center-api/report/remote/print/dataStr';
|
|
325
|
+
if (isNewPrintCenter) {
|
|
326
|
+
api = '/lesoon-basic-api/basic/ireport/preview/print/dataStr';
|
|
327
|
+
}
|
|
328
|
+
var printCenterUrl = toGatewayUrl(api);
|
|
322
329
|
reqUrl = toGatewayUrl(reqUrl);
|
|
323
330
|
if (!reqUrl.includes(location.origin)) {
|
|
324
331
|
reqUrl = location.origin + reqUrl;
|
|
@@ -338,7 +345,7 @@ export var printView = function printView(templateNo, reqUrl) {
|
|
|
338
345
|
return openWin;
|
|
339
346
|
};
|
|
340
347
|
/**
|
|
341
|
-
*
|
|
348
|
+
* 直接打印,通过打印组件进行打印。
|
|
342
349
|
*
|
|
343
350
|
* @param taskName 打印任务名
|
|
344
351
|
* @param templateNo 打印模板
|
|
@@ -352,7 +359,12 @@ export var printAsync = function printAsync(taskName, templateNo, reqUrl) {
|
|
|
352
359
|
var bodyParam = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
353
360
|
var param = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
|
354
361
|
var method = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'POST';
|
|
355
|
-
var
|
|
362
|
+
var isNewPrintCenter = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
363
|
+
var api = '/petrel-print-center-api/report/client/print';
|
|
364
|
+
if (isNewPrintCenter) {
|
|
365
|
+
api = '/lesoon-basic-api/basic/report/client/template/print';
|
|
366
|
+
}
|
|
367
|
+
var printCenterUrl = toGatewayUrl(api);
|
|
356
368
|
if (!printCenterUrl.includes(location.origin)) {
|
|
357
369
|
printCenterUrl = location.origin + printCenterUrl;
|
|
358
370
|
}
|