@kmkf-fe-packages/kmkf-utils 0.6.3-alpha.3 → 0.6.3-alpha.31
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/README.md +2 -0
- package/dist/esm/addressData/index.d.ts +2 -8
- package/dist/esm/addressData/index.js +5 -5
- package/dist/esm/expressData/index.d.ts +6 -5
- package/dist/esm/expressData/index.js +9 -42
- package/dist/esm/expressInterceptData/index.d.ts +46 -0
- package/dist/esm/expressInterceptData/index.js +180 -0
- package/dist/esm/index.d.ts +6 -5
- package/dist/esm/index.js +1 -0
- package/dist/esm/platData/index.d.ts +2 -6
- package/dist/esm/utils/findLabelBySelectValue.js +1 -15
- package/dist/esm/utils/isNull.js +3 -3
- package/package.json +18 -6
package/README.md
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
declare type AddressMapT = {
|
|
2
|
-
[p in string]: string;
|
|
3
|
-
};
|
|
4
|
-
declare type AddressTuples = {
|
|
5
|
-
[p in string]: [string, string | number];
|
|
6
|
-
};
|
|
7
1
|
interface TreeOption {
|
|
8
2
|
label: string;
|
|
9
3
|
value: string;
|
|
@@ -11,8 +5,8 @@ interface TreeOption {
|
|
|
11
5
|
}
|
|
12
6
|
export default class AddressData {
|
|
13
7
|
private static instance;
|
|
14
|
-
addrData:
|
|
15
|
-
addrNameMap:
|
|
8
|
+
addrData: Record<string, [string, string | number]>;
|
|
9
|
+
addrNameMap: Record<string, string>;
|
|
16
10
|
treeData: TreeOption[];
|
|
17
11
|
constructor();
|
|
18
12
|
initData: () => void;
|
|
@@ -18,16 +18,16 @@ var AddressData = /*#__PURE__*/function () {
|
|
|
18
18
|
var _Object$keys;
|
|
19
19
|
if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
|
|
20
20
|
request({
|
|
21
|
-
url:
|
|
22
|
-
method:
|
|
21
|
+
url: "/qy/gdfw/template/queryAreas",
|
|
22
|
+
method: "get",
|
|
23
23
|
data: {}
|
|
24
24
|
}).then(function (resp) {
|
|
25
25
|
var map = {};
|
|
26
26
|
var res = {};
|
|
27
27
|
var list = resp.data;
|
|
28
28
|
for (var i = 0; i < list.length; i++) {
|
|
29
|
-
res[list[i][
|
|
30
|
-
map[list[i][
|
|
29
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
30
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
31
31
|
}
|
|
32
32
|
_this.addrData = res;
|
|
33
33
|
_this.addrNameMap = map;
|
|
@@ -38,7 +38,7 @@ var AddressData = /*#__PURE__*/function () {
|
|
|
38
38
|
var nameCode = {},
|
|
39
39
|
arr = [];
|
|
40
40
|
for (var key in _this.addrData) {
|
|
41
|
-
if (
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_this.addrData, key)) {
|
|
42
42
|
var valueArray = _this.addrData[key];
|
|
43
43
|
if (valueArray[1] === Number(addrCode)) {
|
|
44
44
|
nameCode[valueArray[0]] = key;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
interface OptionsItem {
|
|
2
2
|
label: string | number;
|
|
3
3
|
value: string | number;
|
|
4
|
+
expressName?: string;
|
|
5
|
+
expressCode?: string;
|
|
6
|
+
isInterface?: boolean;
|
|
7
|
+
interceptionTypeList?: any[];
|
|
8
|
+
interceptionStatusList?: any[];
|
|
4
9
|
}
|
|
5
10
|
export default class ExpressData {
|
|
6
11
|
private static instance;
|
|
@@ -10,11 +15,7 @@ export default class ExpressData {
|
|
|
10
15
|
getExpressData: () => OptionsItem[] | undefined;
|
|
11
16
|
setExpressData: (val: OptionsItem[]) => OptionsItem[];
|
|
12
17
|
getExpressNameByCode: (code: string | number) => string | number;
|
|
13
|
-
|
|
14
|
-
getInterceptionTypeName: (company: string, type: string) => any;
|
|
15
|
-
getInterceptionStatusName: (company: string, status: string) => any;
|
|
16
|
-
isInterfaceCompany: (company: string) => any;
|
|
17
|
-
isShowNewAddress: (company: string, type: string) => any;
|
|
18
|
+
getExpressCodeByName: (name: string | number) => string | number;
|
|
18
19
|
static getInstance(): ExpressData;
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
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; }
|
|
2
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
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); } }
|
|
4
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; }
|
|
@@ -14,16 +16,16 @@ var ExpressData = /*#__PURE__*/function () {
|
|
|
14
16
|
_defineProperty(this, "initData", function () {
|
|
15
17
|
if (_this.expressData.length > 0) return _this.expressData;
|
|
16
18
|
request({
|
|
17
|
-
url:
|
|
18
|
-
method:
|
|
19
|
+
url: "/qy/logistics/company/getAllLogisticsCompany",
|
|
20
|
+
method: "get",
|
|
19
21
|
data: {}
|
|
20
22
|
}).then(function (res) {
|
|
21
23
|
var data = res.data;
|
|
22
|
-
var expressList = data.
|
|
23
|
-
return {
|
|
24
|
+
var expressList = data.logisticsCompanyDtoList.map(function (item) {
|
|
25
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
24
26
|
label: item.name,
|
|
25
|
-
value: item.
|
|
26
|
-
};
|
|
27
|
+
value: item.cpCode
|
|
28
|
+
});
|
|
27
29
|
});
|
|
28
30
|
_this.expressData = expressList;
|
|
29
31
|
});
|
|
@@ -42,47 +44,12 @@ var ExpressData = /*#__PURE__*/function () {
|
|
|
42
44
|
});
|
|
43
45
|
return item.length ? item[0].label : code;
|
|
44
46
|
});
|
|
45
|
-
_defineProperty(this, "
|
|
47
|
+
_defineProperty(this, "getExpressCodeByName", function (name) {
|
|
46
48
|
var item = (_this.expressData || []).filter(function (item) {
|
|
47
49
|
return item.label === name;
|
|
48
50
|
});
|
|
49
51
|
return item.length ? item[0].value : name;
|
|
50
52
|
});
|
|
51
|
-
_defineProperty(this, "getInterceptionTypeName", function (company, type) {
|
|
52
|
-
var _find;
|
|
53
|
-
var item = (_this.expressData || []).find(function (item) {
|
|
54
|
-
return item.value === company;
|
|
55
|
-
});
|
|
56
|
-
var label = (_find = ((item === null || item === void 0 ? void 0 : item.interceptionTypeList) || []).find(function (t) {
|
|
57
|
-
return t.value === type;
|
|
58
|
-
})) === null || _find === void 0 ? void 0 : _find.label;
|
|
59
|
-
return label;
|
|
60
|
-
});
|
|
61
|
-
_defineProperty(this, "getInterceptionStatusName", function (company, status) {
|
|
62
|
-
var _find2;
|
|
63
|
-
var item = (_this.expressData || []).find(function (item) {
|
|
64
|
-
return item.value === company;
|
|
65
|
-
});
|
|
66
|
-
var label = (_find2 = ((item === null || item === void 0 ? void 0 : item.interceptionStatusList) || []).find(function (t) {
|
|
67
|
-
return t.value === status;
|
|
68
|
-
})) === null || _find2 === void 0 ? void 0 : _find2.label;
|
|
69
|
-
return label;
|
|
70
|
-
});
|
|
71
|
-
_defineProperty(this, "isInterfaceCompany", function (company) {
|
|
72
|
-
var item = (_this.expressData || []).find(function (item) {
|
|
73
|
-
return item.value === company;
|
|
74
|
-
});
|
|
75
|
-
return item === null || item === void 0 ? void 0 : item.isInterface;
|
|
76
|
-
});
|
|
77
|
-
_defineProperty(this, "isShowNewAddress", function (company, type) {
|
|
78
|
-
var _find3, _find3$config;
|
|
79
|
-
var item = (_this.expressData || []).find(function (item) {
|
|
80
|
-
return item.value === company;
|
|
81
|
-
});
|
|
82
|
-
return (_find3 = ((item === null || item === void 0 ? void 0 : item.interceptionTypeList) || []).find(function (t) {
|
|
83
|
-
return t.value === type;
|
|
84
|
-
})) === null || _find3 === void 0 ? void 0 : (_find3$config = _find3.config) === null || _find3$config === void 0 ? void 0 : _find3$config.showAddress;
|
|
85
|
-
});
|
|
86
53
|
this.initData();
|
|
87
54
|
}
|
|
88
55
|
_createClass(ExpressData, null, [{
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface OptionsItem {
|
|
2
|
+
label: string | number;
|
|
3
|
+
value: string | number;
|
|
4
|
+
expressName?: string;
|
|
5
|
+
expressCode?: string;
|
|
6
|
+
isInterface?: boolean;
|
|
7
|
+
interceptionTypeList?: any[];
|
|
8
|
+
interceptionStatusList?: any[];
|
|
9
|
+
}
|
|
10
|
+
export default class ExpressInterceptData {
|
|
11
|
+
private static instance;
|
|
12
|
+
expressData: OptionsItem[];
|
|
13
|
+
showInterceptionMap: any;
|
|
14
|
+
showNewAddressMap: any;
|
|
15
|
+
typeNameMap: any;
|
|
16
|
+
statusNameMap: any;
|
|
17
|
+
typeOptions: {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
21
|
+
statusOptions: {
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}[];
|
|
25
|
+
constructor();
|
|
26
|
+
initData: () => OptionsItem[] | undefined;
|
|
27
|
+
getExpressData: () => OptionsItem[] | undefined;
|
|
28
|
+
getShowInterceptionBtn(): any;
|
|
29
|
+
getTypeNameMap(): any;
|
|
30
|
+
getStatusNameMap(): any;
|
|
31
|
+
getShowNewAddressMap(): any;
|
|
32
|
+
getTypeOptions(): {
|
|
33
|
+
label: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}[];
|
|
36
|
+
getStatusOptions(): {
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}[];
|
|
40
|
+
setExpressData: (val: OptionsItem[]) => OptionsItem[];
|
|
41
|
+
getExpressNameByCode: (code: string | number) => string | number;
|
|
42
|
+
getExpressCodeByName: (name: string | number) => string | number;
|
|
43
|
+
isInterfaceCompany: (company: string) => boolean;
|
|
44
|
+
static getInstance(): ExpressInterceptData;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,180 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
16
|
+
import request from "../request";
|
|
17
|
+
var ExpressInterceptData = /*#__PURE__*/function () {
|
|
18
|
+
//展示拦截按钮映射
|
|
19
|
+
//展示新收货地映射
|
|
20
|
+
//拦截类型映射
|
|
21
|
+
//拦截状态映射
|
|
22
|
+
//拦截类型筛选options
|
|
23
|
+
//拦截状态筛选options
|
|
24
|
+
function ExpressInterceptData() {
|
|
25
|
+
var _this = this;
|
|
26
|
+
_classCallCheck(this, ExpressInterceptData);
|
|
27
|
+
_defineProperty(this, "expressData", []);
|
|
28
|
+
_defineProperty(this, "showInterceptionMap", null);
|
|
29
|
+
_defineProperty(this, "showNewAddressMap", {});
|
|
30
|
+
_defineProperty(this, "typeNameMap", null);
|
|
31
|
+
_defineProperty(this, "statusNameMap", null);
|
|
32
|
+
_defineProperty(this, "typeOptions", []);
|
|
33
|
+
_defineProperty(this, "statusOptions", []);
|
|
34
|
+
_defineProperty(this, "initData", function () {
|
|
35
|
+
if (_this.expressData.length > 0) return _this.expressData;
|
|
36
|
+
request({
|
|
37
|
+
url: "/qy/logistics/listLogisticsWithInterceptInfo",
|
|
38
|
+
method: "post",
|
|
39
|
+
data: {
|
|
40
|
+
platformType: 118
|
|
41
|
+
}
|
|
42
|
+
}).then(function (res) {
|
|
43
|
+
var data = res.data;
|
|
44
|
+
var expressList = data.map(function (item) {
|
|
45
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
46
|
+
label: item.name,
|
|
47
|
+
value: item.cpCode
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
_this.expressData = expressList;
|
|
51
|
+
var showBtn = {},
|
|
52
|
+
showAddress = {},
|
|
53
|
+
typeMap = {},
|
|
54
|
+
statusMap = {},
|
|
55
|
+
typeObj = {},
|
|
56
|
+
statusObj = {};
|
|
57
|
+
expressList.forEach(function (item) {
|
|
58
|
+
var _item$interceptionSta, _item$interceptionTyp;
|
|
59
|
+
if (item !== null && item !== void 0 && (_item$interceptionSta = item.interceptionStatusList) !== null && _item$interceptionSta !== void 0 && _item$interceptionSta.length) {
|
|
60
|
+
item.interceptionStatusList.forEach(function (t) {
|
|
61
|
+
statusMap["".concat(t.value)] = t.label;
|
|
62
|
+
if (statusObj[t.label]) {
|
|
63
|
+
statusObj[t.label] = statusObj[t.label].add(t.value);
|
|
64
|
+
} else {
|
|
65
|
+
statusObj[t.label] = new Set([t.value]);
|
|
66
|
+
}
|
|
67
|
+
if (t !== null && t !== void 0 && t.showInterceptionBtn) {
|
|
68
|
+
showBtn["".concat(t.value)] = true;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (item !== null && item !== void 0 && (_item$interceptionTyp = item.interceptionTypeList) !== null && _item$interceptionTyp !== void 0 && _item$interceptionTyp.length) {
|
|
73
|
+
item.interceptionTypeList.forEach(function (t) {
|
|
74
|
+
var _t$config;
|
|
75
|
+
typeMap["".concat(t.value)] = t.label;
|
|
76
|
+
if (typeObj[t.label]) {
|
|
77
|
+
typeObj[t.label] = typeObj[t.label].add(t.value);
|
|
78
|
+
} else {
|
|
79
|
+
typeObj[t.label] = new Set([t.value]);
|
|
80
|
+
}
|
|
81
|
+
if (t !== null && t !== void 0 && (_t$config = t.config) !== null && _t$config !== void 0 && _t$config.showAddress) {
|
|
82
|
+
showAddress["".concat(t.value)] = true;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
_this.showInterceptionMap = showBtn;
|
|
88
|
+
_this.typeNameMap = typeMap;
|
|
89
|
+
_this.statusNameMap = statusMap;
|
|
90
|
+
_this.showNewAddressMap = showAddress;
|
|
91
|
+
_this.typeOptions = Object.keys(typeObj).map(function (key) {
|
|
92
|
+
return {
|
|
93
|
+
label: key,
|
|
94
|
+
value: _toConsumableArray(typeObj[key]).join(",")
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
_this.statusOptions = Object.keys(statusObj).map(function (key) {
|
|
98
|
+
return {
|
|
99
|
+
label: key,
|
|
100
|
+
value: _toConsumableArray(statusObj[key]).join(",")
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
_defineProperty(this, "getExpressData", function () {
|
|
106
|
+
var _this$expressData;
|
|
107
|
+
if (((_this$expressData = _this.expressData) === null || _this$expressData === void 0 ? void 0 : _this$expressData.length) > 0) return _this.expressData;
|
|
108
|
+
_this.initData();
|
|
109
|
+
});
|
|
110
|
+
_defineProperty(this, "setExpressData", function (val) {
|
|
111
|
+
return _this.expressData = val;
|
|
112
|
+
});
|
|
113
|
+
_defineProperty(this, "getExpressNameByCode", function (code) {
|
|
114
|
+
var item = (_this.expressData || []).filter(function (item) {
|
|
115
|
+
return item.value === code;
|
|
116
|
+
});
|
|
117
|
+
return item.length ? item[0].label : code;
|
|
118
|
+
});
|
|
119
|
+
_defineProperty(this, "getExpressCodeByName", function (name) {
|
|
120
|
+
var item = (_this.expressData || []).filter(function (item) {
|
|
121
|
+
return item.label === name;
|
|
122
|
+
});
|
|
123
|
+
return item.length ? item[0].value : "";
|
|
124
|
+
});
|
|
125
|
+
_defineProperty(this, "isInterfaceCompany", function (company) {
|
|
126
|
+
var item = (_this.expressData || []).find(function (item) {
|
|
127
|
+
return item.value === company;
|
|
128
|
+
});
|
|
129
|
+
return !!(item !== null && item !== void 0 && item.isInterface);
|
|
130
|
+
});
|
|
131
|
+
this.initData();
|
|
132
|
+
}
|
|
133
|
+
_createClass(ExpressInterceptData, [{
|
|
134
|
+
key: "getShowInterceptionBtn",
|
|
135
|
+
value:
|
|
136
|
+
//获取拦截按钮展示映射
|
|
137
|
+
function getShowInterceptionBtn() {
|
|
138
|
+
return this.showInterceptionMap;
|
|
139
|
+
}
|
|
140
|
+
//获取拦截类型映射
|
|
141
|
+
}, {
|
|
142
|
+
key: "getTypeNameMap",
|
|
143
|
+
value: function getTypeNameMap() {
|
|
144
|
+
return this.typeNameMap;
|
|
145
|
+
}
|
|
146
|
+
//获取拦截状态映射
|
|
147
|
+
}, {
|
|
148
|
+
key: "getStatusNameMap",
|
|
149
|
+
value: function getStatusNameMap() {
|
|
150
|
+
return this.statusNameMap;
|
|
151
|
+
}
|
|
152
|
+
//获取新派送地展示映射
|
|
153
|
+
}, {
|
|
154
|
+
key: "getShowNewAddressMap",
|
|
155
|
+
value: function getShowNewAddressMap() {
|
|
156
|
+
return this.showNewAddressMap;
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "getTypeOptions",
|
|
160
|
+
value: function getTypeOptions() {
|
|
161
|
+
return this.typeOptions;
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "getStatusOptions",
|
|
165
|
+
value: function getStatusOptions() {
|
|
166
|
+
return this.statusOptions;
|
|
167
|
+
}
|
|
168
|
+
}], [{
|
|
169
|
+
key: "getInstance",
|
|
170
|
+
value: function getInstance() {
|
|
171
|
+
if (!ExpressInterceptData.instance) {
|
|
172
|
+
ExpressInterceptData.instance = new ExpressInterceptData();
|
|
173
|
+
}
|
|
174
|
+
return ExpressInterceptData.instance;
|
|
175
|
+
}
|
|
176
|
+
}]);
|
|
177
|
+
return ExpressInterceptData;
|
|
178
|
+
}();
|
|
179
|
+
_defineProperty(ExpressInterceptData, "instance", void 0);
|
|
180
|
+
export { ExpressInterceptData as default };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { default as ExpressData } from
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export
|
|
1
|
+
export { default as ExpressData } from "./expressData";
|
|
2
|
+
export { default as ExpressInterceptData } from "./expressInterceptData";
|
|
3
|
+
export { default as AddressData } from "./addressData";
|
|
4
|
+
export { default as PlatData } from "./platData";
|
|
5
|
+
export { default as request } from "./request";
|
|
6
|
+
export * from "./utils";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as ExpressData } from "./expressData";
|
|
2
|
+
export { default as ExpressInterceptData } from "./expressInterceptData";
|
|
2
3
|
export { default as AddressData } from "./addressData";
|
|
3
4
|
export { default as PlatData } from "./platData";
|
|
4
5
|
export { default as request } from "./request";
|
|
@@ -23,9 +23,7 @@ interface PlatInterface {
|
|
|
23
23
|
export default class PlatData {
|
|
24
24
|
private static instance;
|
|
25
25
|
platTypeList: PlatInterface[];
|
|
26
|
-
platMap:
|
|
27
|
-
[prop in string]: string;
|
|
28
|
-
};
|
|
26
|
+
platMap: Record<string, string>;
|
|
29
27
|
platSelectList: {
|
|
30
28
|
label: string;
|
|
31
29
|
value: string;
|
|
@@ -36,9 +34,7 @@ export default class PlatData {
|
|
|
36
34
|
/**
|
|
37
35
|
* 获取平台类型和平台名称映射关系
|
|
38
36
|
*/
|
|
39
|
-
getPlatMap: () =>
|
|
40
|
-
[x: string]: string;
|
|
41
|
-
};
|
|
37
|
+
getPlatMap: () => Record<string, string>;
|
|
42
38
|
/**
|
|
43
39
|
* 获取平台选择列表
|
|
44
40
|
* @returns
|
|
@@ -19,18 +19,4 @@ export default (function (vales, options) {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
return newKV;
|
|
22
|
-
});
|
|
23
|
-
var findNodeById = function findNodeById(tree) {
|
|
24
|
-
var actived = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
25
|
-
for (var i = 0; i < tree.length; i++) {
|
|
26
|
-
if (tree[i].actived == actived) {
|
|
27
|
-
return tree[i];
|
|
28
|
-
}
|
|
29
|
-
if (tree[i].children) {
|
|
30
|
-
var result = findNodeById(tree[i].children, actived);
|
|
31
|
-
if (result) {
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
22
|
+
});
|
package/dist/esm/utils/isNull.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
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
2
|
import every from 'lodash/every';
|
|
3
3
|
var isNull = function isNull(value) {
|
|
4
|
+
if (Array.isArray(value)) {
|
|
5
|
+
return value.length === 0;
|
|
6
|
+
}
|
|
4
7
|
if (_typeof(value) === 'object' && value !== null) {
|
|
5
8
|
return every(Object.values(value), function (v) {
|
|
6
9
|
return isNull(v);
|
|
7
10
|
});
|
|
8
11
|
}
|
|
9
|
-
if (Array.isArray(value)) {
|
|
10
|
-
return value.length === 0;
|
|
11
|
-
}
|
|
12
12
|
if (typeof value === 'number') {
|
|
13
13
|
return false;
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "0.6.3-alpha.
|
|
3
|
+
"version": "0.6.3-alpha.31",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "father build"
|
|
10
|
+
"build": "yarn run lint && father build",
|
|
11
|
+
"lint": "eslint . --ext .ts",
|
|
12
|
+
"lint:fix": "npx eslint . --ext .ts --fix",
|
|
13
|
+
"jest:init": "jest --init",
|
|
14
|
+
"test": "jest"
|
|
11
15
|
},
|
|
12
16
|
"lint-staged": {
|
|
13
17
|
"*.{js,jsx,less,md,json}": [
|
|
@@ -17,18 +21,26 @@
|
|
|
17
21
|
"prettier --parser=typescript --write"
|
|
18
22
|
]
|
|
19
23
|
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"father": "^4.1.7"
|
|
22
|
-
},
|
|
23
24
|
"dependencies": {
|
|
25
|
+
"jest": "^29.5.0",
|
|
24
26
|
"lodash": "^4.17.21",
|
|
25
27
|
"umi-request": "^1.4.0"
|
|
26
28
|
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/jest": "^29.5.1",
|
|
31
|
+
"@types/node": "^20.1.1",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
33
|
+
"@typescript-eslint/parser": "^5.59.2",
|
|
34
|
+
"eslint": "^8.40.0",
|
|
35
|
+
"father": "^4.1.7",
|
|
36
|
+
"ts-jest": "^29.1.0",
|
|
37
|
+
"ts-node": "^10.9.1"
|
|
38
|
+
},
|
|
27
39
|
"publishConfig": {
|
|
28
40
|
"access": "public"
|
|
29
41
|
},
|
|
30
42
|
"gitHooks": {
|
|
31
43
|
"pre-commit": "lint-staged"
|
|
32
44
|
},
|
|
33
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "8f9cdc012fb74fbd9a6e1e2b4afe5f1cb419e631"
|
|
34
46
|
}
|