@kmkf-fe-packages/kmkf-utils 0.7.1-alpha.0 → 0.7.1
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/esm/expressInterceptData/index.d.ts +0 -2
- package/dist/esm/expressInterceptData/index.js +2 -15
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -1
- package/package.json +2 -2
- package/dist/esm/logisticsAddressData/index.d.ts +0 -21
- package/dist/esm/logisticsAddressData/index.js +0 -62
|
@@ -13,7 +13,6 @@ export default class ExpressInterceptData {
|
|
|
13
13
|
showInterceptionMap: any;
|
|
14
14
|
showSenderMobileMap: any;
|
|
15
15
|
showNewAddressMap: any;
|
|
16
|
-
showReturnAddressMap: any;
|
|
17
16
|
typeNameMap: any;
|
|
18
17
|
statusNameMap: any;
|
|
19
18
|
typeOptions: {
|
|
@@ -31,7 +30,6 @@ export default class ExpressInterceptData {
|
|
|
31
30
|
getTypeNameMap(): any;
|
|
32
31
|
getStatusNameMap(): any;
|
|
33
32
|
getShowNewAddressMap(): any;
|
|
34
|
-
getShowReturnAddressMap(): any;
|
|
35
33
|
getShowSenderMobileMap(): any;
|
|
36
34
|
getTypeOptions(): {
|
|
37
35
|
label: string;
|
|
@@ -18,7 +18,6 @@ var ExpressInterceptData = /*#__PURE__*/function () {
|
|
|
18
18
|
//展示拦截按钮映射
|
|
19
19
|
//展示发件人手机号映射
|
|
20
20
|
//展示派送地址映射
|
|
21
|
-
//退回诶之显示映射
|
|
22
21
|
//拦截类型映射
|
|
23
22
|
//物流状态映射
|
|
24
23
|
//拦截类型筛选options
|
|
@@ -30,7 +29,6 @@ var ExpressInterceptData = /*#__PURE__*/function () {
|
|
|
30
29
|
_defineProperty(this, "showInterceptionMap", null);
|
|
31
30
|
_defineProperty(this, "showSenderMobileMap", {});
|
|
32
31
|
_defineProperty(this, "showNewAddressMap", {});
|
|
33
|
-
_defineProperty(this, "showReturnAddressMap", {});
|
|
34
32
|
_defineProperty(this, "typeNameMap", null);
|
|
35
33
|
_defineProperty(this, "statusNameMap", null);
|
|
36
34
|
_defineProperty(this, "typeOptions", []);
|
|
@@ -55,7 +53,6 @@ var ExpressInterceptData = /*#__PURE__*/function () {
|
|
|
55
53
|
var showBtn = {},
|
|
56
54
|
showSender = {},
|
|
57
55
|
showAddress = {},
|
|
58
|
-
showReturnAddress = {},
|
|
59
56
|
typeMap = {},
|
|
60
57
|
statusMap = {},
|
|
61
58
|
typeObj = {},
|
|
@@ -78,7 +75,7 @@ var ExpressInterceptData = /*#__PURE__*/function () {
|
|
|
78
75
|
}
|
|
79
76
|
if (item !== null && item !== void 0 && (_item$interceptionTyp = item.interceptionTypeList) !== null && _item$interceptionTyp !== void 0 && _item$interceptionTyp.length) {
|
|
80
77
|
item.interceptionTypeList.forEach(function (t) {
|
|
81
|
-
var _t$config, _t$config2
|
|
78
|
+
var _t$config, _t$config2;
|
|
82
79
|
typeMap["".concat(t.value)] = t.label;
|
|
83
80
|
if (typeObj[t.label]) {
|
|
84
81
|
typeObj[t.label] = typeObj[t.label].add(t.value);
|
|
@@ -88,10 +85,7 @@ var ExpressInterceptData = /*#__PURE__*/function () {
|
|
|
88
85
|
if (t !== null && t !== void 0 && (_t$config = t.config) !== null && _t$config !== void 0 && _t$config.showAddress) {
|
|
89
86
|
showAddress["".concat(t.value)] = true;
|
|
90
87
|
}
|
|
91
|
-
if (t !== null && t !== void 0 && (_t$config2 = t.config) !== null && _t$config2 !== void 0 && _t$config2.
|
|
92
|
-
showReturnAddress["".concat(t.value)] = true;
|
|
93
|
-
}
|
|
94
|
-
if (t !== null && t !== void 0 && (_t$config3 = t.config) !== null && _t$config3 !== void 0 && _t$config3.showSenderMobile) {
|
|
88
|
+
if (t !== null && t !== void 0 && (_t$config2 = t.config) !== null && _t$config2 !== void 0 && _t$config2.showSenderMobile) {
|
|
95
89
|
showSender["".concat(t.value)] = true;
|
|
96
90
|
}
|
|
97
91
|
});
|
|
@@ -101,7 +95,6 @@ var ExpressInterceptData = /*#__PURE__*/function () {
|
|
|
101
95
|
_this.typeNameMap = typeMap;
|
|
102
96
|
_this.statusNameMap = statusMap;
|
|
103
97
|
_this.showNewAddressMap = showAddress;
|
|
104
|
-
_this.showReturnAddressMap = showReturnAddress;
|
|
105
98
|
_this.showSenderMobileMap = showSender;
|
|
106
99
|
_this.typeOptions = Object.keys(typeObj).map(function (key) {
|
|
107
100
|
return {
|
|
@@ -160,12 +153,6 @@ var ExpressInterceptData = /*#__PURE__*/function () {
|
|
|
160
153
|
value: function getShowNewAddressMap() {
|
|
161
154
|
return this.showNewAddressMap;
|
|
162
155
|
}
|
|
163
|
-
//获取退回地址展示映射
|
|
164
|
-
}, {
|
|
165
|
-
key: "getShowReturnAddressMap",
|
|
166
|
-
value: function getShowReturnAddressMap() {
|
|
167
|
-
return this.showReturnAddressMap;
|
|
168
|
-
}
|
|
169
156
|
//获取发件人手机号展示映射
|
|
170
157
|
}, {
|
|
171
158
|
key: "getShowSenderMobileMap",
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,6 +2,5 @@ export { default as ExpressData } from "./expressData";
|
|
|
2
2
|
export { default as ExpressInterceptData } from "./expressInterceptData";
|
|
3
3
|
export { default as AddressData } from "./addressData";
|
|
4
4
|
export { default as PlatData } from "./platData";
|
|
5
|
-
export { default as LogisticsAddressData } from "./logisticsAddressData";
|
|
6
5
|
export { default as request } from "./request";
|
|
7
6
|
export * from "./utils";
|
package/dist/esm/index.js
CHANGED
|
@@ -2,6 +2,5 @@ export { default as ExpressData } from "./expressData";
|
|
|
2
2
|
export { default as ExpressInterceptData } from "./expressInterceptData";
|
|
3
3
|
export { default as AddressData } from "./addressData";
|
|
4
4
|
export { default as PlatData } from "./platData";
|
|
5
|
-
export { default as LogisticsAddressData } from "./logisticsAddressData";
|
|
6
5
|
export { default as request } from "./request";
|
|
7
6
|
export * from "./utils";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "0.7.1
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"gitHooks": {
|
|
43
43
|
"pre-commit": "lint-staged"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "45b9ed0a862e698d4e244071b87ad8109a2d26c7"
|
|
46
46
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
interface OptionsItem {
|
|
2
|
-
cpCode: string;
|
|
3
|
-
uk: string;
|
|
4
|
-
province: string;
|
|
5
|
-
city: string;
|
|
6
|
-
district: string;
|
|
7
|
-
detail: string;
|
|
8
|
-
userName: string;
|
|
9
|
-
mobile: string;
|
|
10
|
-
}
|
|
11
|
-
export default class logisticsAddressData {
|
|
12
|
-
private static instance;
|
|
13
|
-
addressData: OptionsItem[];
|
|
14
|
-
constructor();
|
|
15
|
-
initData: () => OptionsItem[] | undefined;
|
|
16
|
-
getAddressData: () => OptionsItem[] | undefined;
|
|
17
|
-
setExpressData: (val: OptionsItem[]) => OptionsItem[];
|
|
18
|
-
getItemByUk: (uk: string) => OptionsItem | undefined;
|
|
19
|
-
static getInstance(): logisticsAddressData;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
-
import request from "../request";
|
|
11
|
-
var logisticsAddressData = /*#__PURE__*/function () {
|
|
12
|
-
function logisticsAddressData() {
|
|
13
|
-
var _this = this;
|
|
14
|
-
_classCallCheck(this, logisticsAddressData);
|
|
15
|
-
_defineProperty(this, "addressData", []);
|
|
16
|
-
_defineProperty(this, "initData", function () {
|
|
17
|
-
if (_this.addressData.length > 0) return _this.addressData;
|
|
18
|
-
request({
|
|
19
|
-
url: "/qy/userConfig/listLogisticsAddress",
|
|
20
|
-
method: "post",
|
|
21
|
-
data: {}
|
|
22
|
-
}).then(function (res) {
|
|
23
|
-
var data = res.data;
|
|
24
|
-
var addressList = data.map(function (item) {
|
|
25
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
26
|
-
label: "".concat(item === null || item === void 0 ? void 0 : item.userName, "-").concat(item === null || item === void 0 ? void 0 : item.mobile),
|
|
27
|
-
value: item.uk
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
_this.addressData = addressList;
|
|
31
|
-
}).catch(function (e) {
|
|
32
|
-
console.log(e);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
_defineProperty(this, "getAddressData", function () {
|
|
36
|
-
var _this$addressData;
|
|
37
|
-
if (((_this$addressData = _this.addressData) === null || _this$addressData === void 0 ? void 0 : _this$addressData.length) > 0) return _this.addressData;
|
|
38
|
-
_this.initData();
|
|
39
|
-
});
|
|
40
|
-
_defineProperty(this, "setExpressData", function (val) {
|
|
41
|
-
return _this.addressData = val;
|
|
42
|
-
});
|
|
43
|
-
_defineProperty(this, "getItemByUk", function (uk) {
|
|
44
|
-
return (_this.addressData || []).find(function (item) {
|
|
45
|
-
return item.uk === uk;
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
this.initData();
|
|
49
|
-
}
|
|
50
|
-
_createClass(logisticsAddressData, null, [{
|
|
51
|
-
key: "getInstance",
|
|
52
|
-
value: function getInstance() {
|
|
53
|
-
if (!logisticsAddressData.instance) {
|
|
54
|
-
logisticsAddressData.instance = new logisticsAddressData();
|
|
55
|
-
}
|
|
56
|
-
return logisticsAddressData.instance;
|
|
57
|
-
}
|
|
58
|
-
}]);
|
|
59
|
-
return logisticsAddressData;
|
|
60
|
-
}();
|
|
61
|
-
_defineProperty(logisticsAddressData, "instance", void 0);
|
|
62
|
-
export { logisticsAddressData as default };
|