@kmkf-fe-packages/kmkf-utils 0.6.3-alpha.4 → 0.6.3
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/expressData/index.d.ts +0 -4
- package/dist/esm/expressData/index.js +0 -35
- package/dist/esm/platData/index.d.ts +0 -21
- package/dist/esm/platData/index.js +0 -22
- package/dist/esm/utils/findLabelBySelectValue.js +1 -1
- package/dist/esm/utils/index.d.ts +0 -1
- package/dist/esm/utils/index.js +1 -3
- package/package.json +2 -2
- package/dist/esm/utils/filterFn.d.ts +0 -4
- package/dist/esm/utils/filterFn.js +0 -18
|
@@ -11,10 +11,6 @@ export default class ExpressData {
|
|
|
11
11
|
setExpressData: (val: OptionsItem[]) => OptionsItem[];
|
|
12
12
|
getExpressNameByCode: (code: string | number) => string | number;
|
|
13
13
|
getExpressNameByName: (name: string | number) => string | number;
|
|
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
14
|
static getInstance(): ExpressData;
|
|
19
15
|
}
|
|
20
16
|
export {};
|
|
@@ -48,41 +48,6 @@ var ExpressData = /*#__PURE__*/function () {
|
|
|
48
48
|
});
|
|
49
49
|
return item.length ? item[0].value : name;
|
|
50
50
|
});
|
|
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
51
|
this.initData();
|
|
87
52
|
}
|
|
88
53
|
_createClass(ExpressData, null, [{
|
|
@@ -23,30 +23,9 @@ 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
|
-
};
|
|
29
|
-
platSelectList: {
|
|
30
|
-
label: string;
|
|
31
|
-
value: string;
|
|
32
|
-
}[];
|
|
33
26
|
constructor();
|
|
34
27
|
initData: () => void;
|
|
35
28
|
getPlatData: () => PlatInterface[];
|
|
36
|
-
/**
|
|
37
|
-
* 获取平台类型和平台名称映射关系
|
|
38
|
-
*/
|
|
39
|
-
getPlatMap: () => {
|
|
40
|
-
[x: string]: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* 获取平台选择列表
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
getPlatSelectList: () => {
|
|
47
|
-
label: string;
|
|
48
|
-
value: string;
|
|
49
|
-
}[];
|
|
50
29
|
static getInstance(): PlatData;
|
|
51
30
|
}
|
|
52
31
|
export declare type PlatDataClass = PlatData;
|
|
@@ -17,8 +17,6 @@ var PlatData = /*#__PURE__*/function () {
|
|
|
17
17
|
var _this = this;
|
|
18
18
|
_classCallCheck(this, PlatData);
|
|
19
19
|
_defineProperty(this, "platTypeList", void 0);
|
|
20
|
-
_defineProperty(this, "platMap", void 0);
|
|
21
|
-
_defineProperty(this, "platSelectList", void 0);
|
|
22
20
|
_defineProperty(this, "initData", function () {
|
|
23
21
|
var _this$platTypeList;
|
|
24
22
|
if (((_this$platTypeList = _this.platTypeList) === null || _this$platTypeList === void 0 ? void 0 : _this$platTypeList.length) > 0) return;
|
|
@@ -33,33 +31,13 @@ var PlatData = /*#__PURE__*/function () {
|
|
|
33
31
|
platType.notJoinList = platType.notJoinList || [];
|
|
34
32
|
var list = [].concat(_toConsumableArray(platType.alreadyJoinedList), _toConsumableArray(platType.notJoinList));
|
|
35
33
|
_this.platTypeList = list;
|
|
36
|
-
var platMap = list === null || list === void 0 ? void 0 : list.reduce(function (cur, nxt) {
|
|
37
|
-
cur[nxt.platformType] = nxt.platformName;
|
|
38
|
-
return cur;
|
|
39
|
-
}, {});
|
|
40
|
-
_this.platMap = platMap;
|
|
41
|
-
var platSelectList = list.map(function (p) {
|
|
42
|
-
return {
|
|
43
|
-
label: p.platformName,
|
|
44
|
-
value: p.platformType
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
_this.platSelectList = platSelectList;
|
|
48
34
|
}
|
|
49
35
|
});
|
|
50
36
|
});
|
|
51
37
|
_defineProperty(this, "getPlatData", function () {
|
|
52
38
|
return _this.platTypeList;
|
|
53
39
|
});
|
|
54
|
-
_defineProperty(this, "getPlatMap", function () {
|
|
55
|
-
return _this.platMap;
|
|
56
|
-
});
|
|
57
|
-
_defineProperty(this, "getPlatSelectList", function () {
|
|
58
|
-
return _this.platSelectList;
|
|
59
|
-
});
|
|
60
40
|
this.platTypeList = [];
|
|
61
|
-
this.platMap = {};
|
|
62
|
-
this.platSelectList = [];
|
|
63
41
|
this.initData();
|
|
64
42
|
}
|
|
65
43
|
_createClass(PlatData, null, [{
|
|
@@ -5,7 +5,7 @@ import find from 'lodash/find';
|
|
|
5
5
|
export default (function (vales, options) {
|
|
6
6
|
if (isEmpty(vales)) return [];
|
|
7
7
|
var newKV = [];
|
|
8
|
-
vales
|
|
8
|
+
vales.map(function (value, index) {
|
|
9
9
|
var list = options[index]['list'];
|
|
10
10
|
var flatt = keys(list).reduce(function (next, cur) {
|
|
11
11
|
return next.concat(list[cur]);
|
|
@@ -3,4 +3,3 @@ export { default as findLabelBySelectValue } from './findLabelBySelectValue';
|
|
|
3
3
|
export { default as transMultSelectOptions } from './transMultSelectOptions';
|
|
4
4
|
export { default as imgResize } from './imgResize';
|
|
5
5
|
export { default as isNull } from './isNull';
|
|
6
|
-
export * as filterFn from './filterFn';
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -2,6 +2,4 @@ export { default as toTree } from "./toTree";
|
|
|
2
2
|
export { default as findLabelBySelectValue } from "./findLabelBySelectValue";
|
|
3
3
|
export { default as transMultSelectOptions } from "./transMultSelectOptions";
|
|
4
4
|
export { default as imgResize } from "./imgResize";
|
|
5
|
-
export { default as isNull } from "./isNull";
|
|
6
|
-
import * as _filterFn from "./filterFn";
|
|
7
|
-
export { _filterFn as filterFn };
|
|
5
|
+
export { default as isNull } from "./isNull";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "0.6.3
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"gitHooks": {
|
|
31
31
|
"pre-commit": "lint-staged"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "7729e2b404a284239abb60eaaed125766688ec30"
|
|
34
34
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const filterTableListItemColumnValue: (item: any, id: string, key?: string) => any;
|
|
2
|
-
declare const filterDateFn: (value: string[], recordDateTime: string | string[]) => boolean;
|
|
3
|
-
declare const filterSplitComma: (item: string, input: string) => boolean;
|
|
4
|
-
export { filterDateFn, filterTableListItemColumnValue, filterSplitComma };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
var filterTableListItemColumnValue = function filterTableListItemColumnValue(item, id, key) {
|
|
4
|
-
return key ? get(item, "".concat(id, "_").concat(key), '') : get(item, "".concat(id), '');
|
|
5
|
-
};
|
|
6
|
-
var filterDateFn = function filterDateFn(value, recordDateTime) {
|
|
7
|
-
if (!recordDateTime) return false;
|
|
8
|
-
return Array.isArray(recordDateTime) ? moment(recordDateTime[0]).isSameOrAfter(value[0], 'seconds') && moment(recordDateTime[1]).isSameOrBefore(value[1], 'seconds') : moment(recordDateTime).isSameOrAfter(value[0], 'seconds') && moment(recordDateTime).isSameOrBefore(value[1], 'seconds');
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// 针对物流过滤 + 订单号组件
|
|
12
|
-
var filterSplitComma = function filterSplitComma(item, input) {
|
|
13
|
-
var inputChunks = input.split(/[,|,]/);
|
|
14
|
-
return inputChunks.some(function (i) {
|
|
15
|
-
return item === null || item === void 0 ? void 0 : item.includes(i);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export { filterDateFn, filterTableListItemColumnValue, filterSplitComma };
|