@kmkf-fe-packages/kmkf-utils 0.6.3 → 0.7.1-alpha.0
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 +4 -10
- package/dist/esm/addressData/index.js +9 -8
- package/dist/esm/expressData/index.d.ts +7 -2
- package/dist/esm/expressData/index.js +13 -9
- package/dist/esm/expressInterceptData/index.d.ts +48 -0
- package/dist/esm/expressInterceptData/index.js +197 -0
- package/dist/esm/global.d.ts +51 -0
- package/dist/esm/index.d.ts +7 -5
- package/dist/esm/index.js +2 -0
- package/dist/esm/logisticsAddressData/index.d.ts +21 -0
- package/dist/esm/logisticsAddressData/index.js +62 -0
- package/dist/esm/platData/index.d.ts +17 -0
- package/dist/esm/platData/index.js +22 -0
- package/dist/esm/utils/filterFn.d.ts +4 -0
- package/dist/esm/utils/filterFn.js +18 -0
- package/dist/esm/utils/findLabelBySelectValue.d.ts +1 -1
- package/dist/esm/utils/findLabelBySelectValue.js +5 -19
- package/dist/esm/utils/index.d.ts +3 -0
- package/dist/esm/utils/index.js +6 -1
- package/dist/esm/utils/isNull.js +3 -3
- package/dist/esm/utils/orderBackFormValues.d.ts +22 -0
- package/dist/esm/utils/orderBackFormValues.js +266 -0
- package/dist/esm/utils/template.d.ts +11 -0
- package/dist/esm/utils/template.js +17 -0
- package/dist/esm/utils/transMultSelectOptions.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,9 +5,9 @@ interface TreeOption {
|
|
|
11
5
|
}
|
|
12
6
|
export default class AddressData {
|
|
13
7
|
private static instance;
|
|
14
|
-
addrData:
|
|
15
|
-
addrNameMap:
|
|
16
|
-
|
|
8
|
+
addrData: Record<string, [string, string | number]>;
|
|
9
|
+
addrNameMap: Record<string, string>;
|
|
10
|
+
addressOptions: TreeOption[];
|
|
17
11
|
constructor();
|
|
18
12
|
initData: () => void;
|
|
19
13
|
parseData: (addrCode: string | number) => {
|
|
@@ -32,7 +26,7 @@ export default class AddressData {
|
|
|
32
26
|
label: string;
|
|
33
27
|
value: string;
|
|
34
28
|
}[];
|
|
35
|
-
getProCodeByName: (proName: string) =>
|
|
29
|
+
getProCodeByName: (proName: string) => number | undefined;
|
|
36
30
|
getNameByCode: (code: string | number) => string;
|
|
37
31
|
static getInstance(): AddressData;
|
|
38
32
|
}
|
|
@@ -7,38 +7,39 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
7
7
|
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); }
|
|
8
8
|
import request from "../request";
|
|
9
9
|
import { toTree } from "../utils";
|
|
10
|
+
import get from 'lodash/get';
|
|
10
11
|
var AddressData = /*#__PURE__*/function () {
|
|
11
12
|
function AddressData() {
|
|
12
13
|
var _this = this;
|
|
13
14
|
_classCallCheck(this, AddressData);
|
|
14
15
|
_defineProperty(this, "addrData", {});
|
|
15
16
|
_defineProperty(this, "addrNameMap", {});
|
|
16
|
-
_defineProperty(this, "
|
|
17
|
+
_defineProperty(this, "addressOptions", []);
|
|
17
18
|
_defineProperty(this, "initData", function () {
|
|
18
19
|
var _Object$keys;
|
|
19
20
|
if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
|
|
20
21
|
request({
|
|
21
|
-
url:
|
|
22
|
-
method:
|
|
22
|
+
url: "/qy/gdfw/template/queryAreas",
|
|
23
|
+
method: "get",
|
|
23
24
|
data: {}
|
|
24
25
|
}).then(function (resp) {
|
|
25
26
|
var map = {};
|
|
26
27
|
var res = {};
|
|
27
28
|
var list = resp.data;
|
|
28
29
|
for (var i = 0; i < list.length; i++) {
|
|
29
|
-
res[list[i][
|
|
30
|
-
map[list[i][
|
|
30
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
31
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
31
32
|
}
|
|
32
33
|
_this.addrData = res;
|
|
33
34
|
_this.addrNameMap = map;
|
|
34
|
-
_this.
|
|
35
|
+
_this.addressOptions = get(toTree(list, 0), '0.children', []);
|
|
35
36
|
});
|
|
36
37
|
});
|
|
37
38
|
_defineProperty(this, "parseData", function (addrCode) {
|
|
38
39
|
var nameCode = {},
|
|
39
40
|
arr = [];
|
|
40
41
|
for (var key in _this.addrData) {
|
|
41
|
-
if (
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(_this.addrData, key)) {
|
|
42
43
|
var valueArray = _this.addrData[key];
|
|
43
44
|
if (valueArray[1] === Number(addrCode)) {
|
|
44
45
|
nameCode[valueArray[0]] = key;
|
|
@@ -63,7 +64,7 @@ var AddressData = /*#__PURE__*/function () {
|
|
|
63
64
|
_defineProperty(this, "getProCodeByName", function (proName) {
|
|
64
65
|
for (var key in _this.addrData) {
|
|
65
66
|
if (_this.addrData[key][0] === proName) {
|
|
66
|
-
return key;
|
|
67
|
+
return Number(key);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
});
|
|
@@ -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
|
+
logisticsStatusList?: any[];
|
|
4
9
|
}
|
|
5
10
|
export default class ExpressData {
|
|
6
11
|
private static instance;
|
|
@@ -9,8 +14,8 @@ export default class ExpressData {
|
|
|
9
14
|
initData: () => OptionsItem[] | undefined;
|
|
10
15
|
getExpressData: () => OptionsItem[] | undefined;
|
|
11
16
|
setExpressData: (val: OptionsItem[]) => OptionsItem[];
|
|
12
|
-
getExpressNameByCode: (code: string | number) => string | number;
|
|
13
|
-
|
|
17
|
+
getExpressNameByCode: (code: string | number, returnCurrentValue?: boolean) => string | number;
|
|
18
|
+
getExpressCodeByName: (name: string | number, returnCurrentValue?: boolean) => string | number;
|
|
14
19
|
static getInstance(): ExpressData;
|
|
15
20
|
}
|
|
16
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
|
});
|
|
@@ -37,16 +39,18 @@ var ExpressData = /*#__PURE__*/function () {
|
|
|
37
39
|
return _this.expressData = val;
|
|
38
40
|
});
|
|
39
41
|
_defineProperty(this, "getExpressNameByCode", function (code) {
|
|
42
|
+
var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
40
43
|
var item = (_this.expressData || []).filter(function (item) {
|
|
41
44
|
return item.value === code;
|
|
42
45
|
});
|
|
43
|
-
return item.length ? item[0].label : code;
|
|
46
|
+
return item.length ? item[0].label : returnCurrentValue ? code : "";
|
|
44
47
|
});
|
|
45
|
-
_defineProperty(this, "
|
|
48
|
+
_defineProperty(this, "getExpressCodeByName", function (name) {
|
|
49
|
+
var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
46
50
|
var item = (_this.expressData || []).filter(function (item) {
|
|
47
51
|
return item.label === name;
|
|
48
52
|
});
|
|
49
|
-
return item.length ? item[0].value : name;
|
|
53
|
+
return item.length ? item[0].value : returnCurrentValue ? name : "";
|
|
50
54
|
});
|
|
51
55
|
this.initData();
|
|
52
56
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
interface OptionsItem {
|
|
2
|
+
label: string | number;
|
|
3
|
+
value: string | number;
|
|
4
|
+
expressName?: string;
|
|
5
|
+
expressCode?: string;
|
|
6
|
+
isInterface?: boolean;
|
|
7
|
+
interceptionTypeList?: any[];
|
|
8
|
+
logisticsStatusList?: any[];
|
|
9
|
+
}
|
|
10
|
+
export default class ExpressInterceptData {
|
|
11
|
+
private static instance;
|
|
12
|
+
expressData: OptionsItem[];
|
|
13
|
+
showInterceptionMap: any;
|
|
14
|
+
showSenderMobileMap: any;
|
|
15
|
+
showNewAddressMap: any;
|
|
16
|
+
showReturnAddressMap: any;
|
|
17
|
+
typeNameMap: any;
|
|
18
|
+
statusNameMap: any;
|
|
19
|
+
typeOptions: {
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
statusOptions: {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
constructor();
|
|
28
|
+
initData: () => OptionsItem[] | undefined;
|
|
29
|
+
getExpressData: () => OptionsItem[] | undefined;
|
|
30
|
+
getShowInterceptionBtn(): any;
|
|
31
|
+
getTypeNameMap(): any;
|
|
32
|
+
getStatusNameMap(): any;
|
|
33
|
+
getShowNewAddressMap(): any;
|
|
34
|
+
getShowReturnAddressMap(): any;
|
|
35
|
+
getShowSenderMobileMap(): any;
|
|
36
|
+
getTypeOptions(): {
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}[];
|
|
40
|
+
getStatusOptions(): {
|
|
41
|
+
label: string;
|
|
42
|
+
value: string;
|
|
43
|
+
}[];
|
|
44
|
+
setExpressData: (val: OptionsItem[]) => OptionsItem[];
|
|
45
|
+
isInterfaceCompany: (company: string) => boolean;
|
|
46
|
+
static getInstance(): ExpressInterceptData;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,197 @@
|
|
|
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
|
+
//拦截类型映射
|
|
23
|
+
//物流状态映射
|
|
24
|
+
//拦截类型筛选options
|
|
25
|
+
//物流状态筛选options
|
|
26
|
+
function ExpressInterceptData() {
|
|
27
|
+
var _this = this;
|
|
28
|
+
_classCallCheck(this, ExpressInterceptData);
|
|
29
|
+
_defineProperty(this, "expressData", []);
|
|
30
|
+
_defineProperty(this, "showInterceptionMap", null);
|
|
31
|
+
_defineProperty(this, "showSenderMobileMap", {});
|
|
32
|
+
_defineProperty(this, "showNewAddressMap", {});
|
|
33
|
+
_defineProperty(this, "showReturnAddressMap", {});
|
|
34
|
+
_defineProperty(this, "typeNameMap", null);
|
|
35
|
+
_defineProperty(this, "statusNameMap", null);
|
|
36
|
+
_defineProperty(this, "typeOptions", []);
|
|
37
|
+
_defineProperty(this, "statusOptions", []);
|
|
38
|
+
_defineProperty(this, "initData", function () {
|
|
39
|
+
if (_this.expressData.length > 0) return _this.expressData;
|
|
40
|
+
request({
|
|
41
|
+
url: "/qy/logistics/listLogisticsWithInterceptInfo",
|
|
42
|
+
method: "post",
|
|
43
|
+
data: {
|
|
44
|
+
platformType: 118
|
|
45
|
+
}
|
|
46
|
+
}).then(function (res) {
|
|
47
|
+
var data = res.data;
|
|
48
|
+
var expressList = data.map(function (item) {
|
|
49
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
50
|
+
label: item.name,
|
|
51
|
+
value: item.cpCode
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
_this.expressData = expressList;
|
|
55
|
+
var showBtn = {},
|
|
56
|
+
showSender = {},
|
|
57
|
+
showAddress = {},
|
|
58
|
+
showReturnAddress = {},
|
|
59
|
+
typeMap = {},
|
|
60
|
+
statusMap = {},
|
|
61
|
+
typeObj = {},
|
|
62
|
+
statusObj = {};
|
|
63
|
+
expressList.forEach(function (item) {
|
|
64
|
+
var _item$logisticsStatus, _item$interceptionTyp;
|
|
65
|
+
if (item !== null && item !== void 0 && (_item$logisticsStatus = item.logisticsStatusList) !== null && _item$logisticsStatus !== void 0 && _item$logisticsStatus.length) {
|
|
66
|
+
item.logisticsStatusList.forEach(function (t) {
|
|
67
|
+
statusMap["".concat(t.value)] = t.label;
|
|
68
|
+
if (statusObj[t.label]) {
|
|
69
|
+
statusObj[t.label] = statusObj[t.label].add(t.value);
|
|
70
|
+
} else {
|
|
71
|
+
statusObj[t.label] = new Set([t.value]);
|
|
72
|
+
}
|
|
73
|
+
//todo 取消拦截按钮
|
|
74
|
+
if (t !== null && t !== void 0 && t.showInterceptionBtn) {
|
|
75
|
+
showBtn["".concat(t.value)] = true;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (item !== null && item !== void 0 && (_item$interceptionTyp = item.interceptionTypeList) !== null && _item$interceptionTyp !== void 0 && _item$interceptionTyp.length) {
|
|
80
|
+
item.interceptionTypeList.forEach(function (t) {
|
|
81
|
+
var _t$config, _t$config2, _t$config3;
|
|
82
|
+
typeMap["".concat(t.value)] = t.label;
|
|
83
|
+
if (typeObj[t.label]) {
|
|
84
|
+
typeObj[t.label] = typeObj[t.label].add(t.value);
|
|
85
|
+
} else {
|
|
86
|
+
typeObj[t.label] = new Set([t.value]);
|
|
87
|
+
}
|
|
88
|
+
if (t !== null && t !== void 0 && (_t$config = t.config) !== null && _t$config !== void 0 && _t$config.showAddress) {
|
|
89
|
+
showAddress["".concat(t.value)] = true;
|
|
90
|
+
}
|
|
91
|
+
if (t !== null && t !== void 0 && (_t$config2 = t.config) !== null && _t$config2 !== void 0 && _t$config2.showAddressSelect) {
|
|
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) {
|
|
95
|
+
showSender["".concat(t.value)] = true;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
_this.showInterceptionMap = showBtn;
|
|
101
|
+
_this.typeNameMap = typeMap;
|
|
102
|
+
_this.statusNameMap = statusMap;
|
|
103
|
+
_this.showNewAddressMap = showAddress;
|
|
104
|
+
_this.showReturnAddressMap = showReturnAddress;
|
|
105
|
+
_this.showSenderMobileMap = showSender;
|
|
106
|
+
_this.typeOptions = Object.keys(typeObj).map(function (key) {
|
|
107
|
+
return {
|
|
108
|
+
label: key,
|
|
109
|
+
value: _toConsumableArray(typeObj[key]).join(",")
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
_this.statusOptions = Object.keys(statusObj).map(function (key) {
|
|
113
|
+
return {
|
|
114
|
+
label: key,
|
|
115
|
+
value: _toConsumableArray(statusObj[key]).join(",")
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
}).catch(function (e) {
|
|
119
|
+
console.log(e);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
_defineProperty(this, "getExpressData", function () {
|
|
123
|
+
var _this$expressData;
|
|
124
|
+
if (((_this$expressData = _this.expressData) === null || _this$expressData === void 0 ? void 0 : _this$expressData.length) > 0) return _this.expressData;
|
|
125
|
+
_this.initData();
|
|
126
|
+
});
|
|
127
|
+
_defineProperty(this, "setExpressData", function (val) {
|
|
128
|
+
return _this.expressData = val;
|
|
129
|
+
});
|
|
130
|
+
_defineProperty(this, "isInterfaceCompany", function (company) {
|
|
131
|
+
var item = (_this.expressData || []).find(function (item) {
|
|
132
|
+
return item.value === company;
|
|
133
|
+
});
|
|
134
|
+
return !!(item !== null && item !== void 0 && item.isInterface);
|
|
135
|
+
});
|
|
136
|
+
this.initData();
|
|
137
|
+
}
|
|
138
|
+
_createClass(ExpressInterceptData, [{
|
|
139
|
+
key: "getShowInterceptionBtn",
|
|
140
|
+
value:
|
|
141
|
+
//获取拦截按钮展示映射
|
|
142
|
+
function getShowInterceptionBtn() {
|
|
143
|
+
return this.showInterceptionMap;
|
|
144
|
+
}
|
|
145
|
+
//获取拦截类型映射
|
|
146
|
+
}, {
|
|
147
|
+
key: "getTypeNameMap",
|
|
148
|
+
value: function getTypeNameMap() {
|
|
149
|
+
return this.typeNameMap;
|
|
150
|
+
}
|
|
151
|
+
//获取物流状态映射
|
|
152
|
+
}, {
|
|
153
|
+
key: "getStatusNameMap",
|
|
154
|
+
value: function getStatusNameMap() {
|
|
155
|
+
return this.statusNameMap;
|
|
156
|
+
}
|
|
157
|
+
//获取派送地址展示映射
|
|
158
|
+
}, {
|
|
159
|
+
key: "getShowNewAddressMap",
|
|
160
|
+
value: function getShowNewAddressMap() {
|
|
161
|
+
return this.showNewAddressMap;
|
|
162
|
+
}
|
|
163
|
+
//获取退回地址展示映射
|
|
164
|
+
}, {
|
|
165
|
+
key: "getShowReturnAddressMap",
|
|
166
|
+
value: function getShowReturnAddressMap() {
|
|
167
|
+
return this.showReturnAddressMap;
|
|
168
|
+
}
|
|
169
|
+
//获取发件人手机号展示映射
|
|
170
|
+
}, {
|
|
171
|
+
key: "getShowSenderMobileMap",
|
|
172
|
+
value: function getShowSenderMobileMap() {
|
|
173
|
+
return this.showSenderMobileMap;
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "getTypeOptions",
|
|
177
|
+
value: function getTypeOptions() {
|
|
178
|
+
return this.typeOptions;
|
|
179
|
+
}
|
|
180
|
+
}, {
|
|
181
|
+
key: "getStatusOptions",
|
|
182
|
+
value: function getStatusOptions() {
|
|
183
|
+
return this.statusOptions;
|
|
184
|
+
}
|
|
185
|
+
}], [{
|
|
186
|
+
key: "getInstance",
|
|
187
|
+
value: function getInstance() {
|
|
188
|
+
if (!ExpressInterceptData.instance) {
|
|
189
|
+
ExpressInterceptData.instance = new ExpressInterceptData();
|
|
190
|
+
}
|
|
191
|
+
return ExpressInterceptData.instance;
|
|
192
|
+
}
|
|
193
|
+
}]);
|
|
194
|
+
return ExpressInterceptData;
|
|
195
|
+
}();
|
|
196
|
+
_defineProperty(ExpressInterceptData, "instance", void 0);
|
|
197
|
+
export { ExpressInterceptData as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
declare enum TComponentType {
|
|
2
|
+
PLATFORM_INPUT = 'PLATFORM_INPUT',
|
|
3
|
+
SHOP_INPUT = 'SHOP_INPUT',
|
|
4
|
+
OPERATOR_INPUT = 'OPERATOR_INPUT',
|
|
5
|
+
HANDLER_INPUT = 'HANDLER_INPUT',
|
|
6
|
+
COMPLETED_USER_INPUT='COMPLETED_USER_INPUT',
|
|
7
|
+
INPUT='INPUT',
|
|
8
|
+
RADIO='RADIO',TEXTAREA='TEXTAREA'
|
|
9
|
+
,CHECKBOX='CHECKBOX'
|
|
10
|
+
,DATETIME='DATETIME'
|
|
11
|
+
,SELECT='SELECT'
|
|
12
|
+
,PICTURE='PICTURE'
|
|
13
|
+
,BASIC_MULT_SELECT='BASIC_MULT_SELECT'
|
|
14
|
+
,MULT_SELECT='MULT_SELECT'
|
|
15
|
+
,BASIC_ADDRESS='BASIC_ADDRESS'
|
|
16
|
+
,BASIC_GRADE='BASIC_GRADE'
|
|
17
|
+
,RATE='RATE'
|
|
18
|
+
,SHOP_NAME_INPUT='SHOP_NAME_INPUT'
|
|
19
|
+
,TRADE_ID_INPUT='TRADE_ID_INPUT'
|
|
20
|
+
,BUYER_NICK_INPUT = 'BUYER_NICK_INPUT'
|
|
21
|
+
,RECEIVER_NAME_INPUT='RECEIVER_NAME_INPUT'
|
|
22
|
+
,RECEIVER_MOBILE_INPUT='RECEIVER_MOBILE_INPUT'
|
|
23
|
+
,RECEIVER_ADDRESS_INPUT='RECEIVER_ADDRESS_INPUT'
|
|
24
|
+
,TRADE_CREATE_DATETIME='TRADE_CREATE_DATETIME'
|
|
25
|
+
,TRADE_PAYMENT_DATETIME='TRADE_PAYMENT_DATETIME'
|
|
26
|
+
,TRADE_DELIVERY_DATETIME='TRADE_DELIVERY_DATETIME'
|
|
27
|
+
,TRADE_CLOSING_DATETIME='TRADE_CLOSING_DATETIME'
|
|
28
|
+
,EXPRESS_LOGISTICS_SELECT='EXPRESS_LOGISTICS_SELECT'
|
|
29
|
+
,RETURN_LOGISTICS_SELECT='RETURN_LOGISTICS_SELECT'
|
|
30
|
+
,ACTUAL_PAYMENT='ACTUAL_PAYMENT'
|
|
31
|
+
,REMARK_INPUT='REMARK_INPUT'
|
|
32
|
+
,ITEM_SELECT='ITEM_SELECT'
|
|
33
|
+
,ITEM_ID='ITEM_ID'
|
|
34
|
+
,ITEM_ENCODE='ITEM_ENCODE'
|
|
35
|
+
,ALI_PAY_INPUT='ALI_PAY_INPUT'
|
|
36
|
+
,ORDINARY_INVOICE='ORDINARY_INVOICE'
|
|
37
|
+
,ITEM_SELECT_THIRD='ITEM_SELECT_THIRD'
|
|
38
|
+
,ENTERPRISE_PAYMENT='ENTERPRISE_PAYMENT'
|
|
39
|
+
,SYSTEM_ORDER_NO='SYSTEM_ORDER_NO'
|
|
40
|
+
,LOGISTICS_INTERCEPTION='LOGISTICS_INTERCEPTION'
|
|
41
|
+
,WORK_ORDER_ID_INPUT='WORK_ORDER_ID_INPUT'
|
|
42
|
+
,FLOW_STATUS_SELECT='FLOW_STATUS_SELECT'
|
|
43
|
+
,COMPLETED_DATETIME='COMPLETED_DATETIME'
|
|
44
|
+
,CREATED_DATETIME='CREATED_DATETIME'
|
|
45
|
+
,UPDATE_DATETIME='UPDATE_DATETIME'
|
|
46
|
+
,TEMPLATE_ID_INPUT='TEMPLATE_ID_INPUT'
|
|
47
|
+
,JST_LOGISTICS='JST_LOGISTICS'
|
|
48
|
+
,JST_ITEM_SELECT_THIRD='JST_ITEM_SELECT_THIRD'
|
|
49
|
+
,JST_SUPPLY='JST_SUPPLY'
|
|
50
|
+
,JST_SEND_GOOD='JST_SEND_GOOD'
|
|
51
|
+
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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 LogisticsAddressData } from "./logisticsAddressData";
|
|
6
|
+
export { default as request } from "./request";
|
|
7
|
+
export * from "./utils";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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";
|
|
5
|
+
export { default as LogisticsAddressData } from "./logisticsAddressData";
|
|
4
6
|
export { default as request } from "./request";
|
|
5
7
|
export * from "./utils";
|
|
@@ -0,0 +1,21 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,62 @@
|
|
|
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 };
|
|
@@ -23,9 +23,26 @@ interface PlatInterface {
|
|
|
23
23
|
export default class PlatData {
|
|
24
24
|
private static instance;
|
|
25
25
|
platTypeList: PlatInterface[];
|
|
26
|
+
platMap: Record<string, string>;
|
|
27
|
+
platSelectList: {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
}[];
|
|
26
31
|
constructor();
|
|
27
32
|
initData: () => void;
|
|
28
33
|
getPlatData: () => PlatInterface[];
|
|
34
|
+
/**
|
|
35
|
+
* 获取平台类型和平台名称映射关系
|
|
36
|
+
*/
|
|
37
|
+
getPlatMap: () => Record<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* 获取平台选择列表
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
getPlatSelectList: () => {
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}[];
|
|
29
46
|
static getInstance(): PlatData;
|
|
30
47
|
}
|
|
31
48
|
export declare type PlatDataClass = PlatData;
|
|
@@ -17,6 +17,8 @@ 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);
|
|
20
22
|
_defineProperty(this, "initData", function () {
|
|
21
23
|
var _this$platTypeList;
|
|
22
24
|
if (((_this$platTypeList = _this.platTypeList) === null || _this$platTypeList === void 0 ? void 0 : _this$platTypeList.length) > 0) return;
|
|
@@ -31,13 +33,33 @@ var PlatData = /*#__PURE__*/function () {
|
|
|
31
33
|
platType.notJoinList = platType.notJoinList || [];
|
|
32
34
|
var list = [].concat(_toConsumableArray(platType.alreadyJoinedList), _toConsumableArray(platType.notJoinList));
|
|
33
35
|
_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;
|
|
34
48
|
}
|
|
35
49
|
});
|
|
36
50
|
});
|
|
37
51
|
_defineProperty(this, "getPlatData", function () {
|
|
38
52
|
return _this.platTypeList;
|
|
39
53
|
});
|
|
54
|
+
_defineProperty(this, "getPlatMap", function () {
|
|
55
|
+
return _this.platMap;
|
|
56
|
+
});
|
|
57
|
+
_defineProperty(this, "getPlatSelectList", function () {
|
|
58
|
+
return _this.platSelectList;
|
|
59
|
+
});
|
|
40
60
|
this.platTypeList = [];
|
|
61
|
+
this.platMap = {};
|
|
62
|
+
this.platSelectList = [];
|
|
41
63
|
this.initData();
|
|
42
64
|
}
|
|
43
65
|
_createClass(PlatData, null, [{
|
|
@@ -0,0 +1,4 @@
|
|
|
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 };
|
|
@@ -0,0 +1,18 @@
|
|
|
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 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (
|
|
1
|
+
declare const _default: (values: any[], options: any) => any[];
|
|
2
2
|
export default _default;
|
|
@@ -2,35 +2,21 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
2
2
|
import keys from 'lodash/keys';
|
|
3
3
|
import get from 'lodash/get';
|
|
4
4
|
import find from 'lodash/find';
|
|
5
|
-
export default (function (
|
|
6
|
-
if (isEmpty(
|
|
5
|
+
export default (function (values, options) {
|
|
6
|
+
if (isEmpty(values)) return [];
|
|
7
7
|
var newKV = [];
|
|
8
|
-
|
|
8
|
+
values === null || values === void 0 ? void 0 : values.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]);
|
|
12
12
|
}, []);
|
|
13
13
|
var label = get(find(flatt, {
|
|
14
14
|
actived: value
|
|
15
|
-
}), 'label');
|
|
15
|
+
}), 'label', '');
|
|
16
16
|
newKV.push({
|
|
17
17
|
label: label,
|
|
18
18
|
actived: value
|
|
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
|
+
});
|
|
@@ -3,3 +3,6 @@ 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 { default as orderBackFormValues } from './orderBackFormValues';
|
|
7
|
+
export * as filterFn from './filterFn';
|
|
8
|
+
export * as templateFn from './template';
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -2,4 +2,9 @@ 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";
|
|
5
|
+
export { default as isNull } from "./isNull";
|
|
6
|
+
export { default as orderBackFormValues } from "./orderBackFormValues";
|
|
7
|
+
import * as _filterFn from "./filterFn";
|
|
8
|
+
export { _filterFn as filterFn };
|
|
9
|
+
import * as _templateFn from "./template";
|
|
10
|
+
export { _templateFn as templateFn };
|
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
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import TComponentType from "../global.d.ts";
|
|
2
|
+
interface OrderBackFormValuesI {
|
|
3
|
+
type?: "add" | "edit";
|
|
4
|
+
templateDetail: {
|
|
5
|
+
componentDtoList?: Array<{
|
|
6
|
+
uniqueKey: string;
|
|
7
|
+
componentConfig: Partial<{
|
|
8
|
+
showField: string;
|
|
9
|
+
enableItemId: boolean;
|
|
10
|
+
enableSupplierName: boolean;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>;
|
|
13
|
+
workOrderComponentType?: TComponentType | string;
|
|
14
|
+
workOrderComponentGroup: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
formValue?: Record<string, unknown>;
|
|
18
|
+
order_no?: string | null;
|
|
19
|
+
detail: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: ({ detail, order_no, formValue, templateDetail, type, }: OrderBackFormValuesI) => Record<string, any>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
import moment from "moment";
|
|
8
|
+
import ExpressData from "../expressData";
|
|
9
|
+
import ExpressInterceptData from "../expressInterceptData";
|
|
10
|
+
//重组聚水潭商品数据
|
|
11
|
+
var updateJSTItemListHandle = function updateJSTItemListHandle() {
|
|
12
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
13
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "logistics";
|
|
14
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
15
|
+
var showField = config.showField,
|
|
16
|
+
enableItemId = config.enableItemId,
|
|
17
|
+
enableSupplierName = config.enableSupplierName;
|
|
18
|
+
if (type !== "itemList") {
|
|
19
|
+
var newList = list === null || list === void 0 ? void 0 : list.map(function (item) {
|
|
20
|
+
var items = item.items.map(function (t) {
|
|
21
|
+
return {
|
|
22
|
+
title: t.skuName,
|
|
23
|
+
picUrl: t.pic,
|
|
24
|
+
platform: "jst",
|
|
25
|
+
skuId: t.skuId
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
var params = {
|
|
29
|
+
items: items
|
|
30
|
+
};
|
|
31
|
+
if (type === "logistics") {
|
|
32
|
+
params.logisticsCompany = ExpressData.getInstance().getExpressCodeByName(item.logisticsCompany, false);
|
|
33
|
+
params.logisticsCode = item.lId;
|
|
34
|
+
} else if (type === "supply") {
|
|
35
|
+
if (["supplyId", "all"].includes(showField || "")) {
|
|
36
|
+
params.supplyId = item.drpCoIdTo;
|
|
37
|
+
}
|
|
38
|
+
if (["supplyName", "all"].includes(showField || "")) {
|
|
39
|
+
params.supplyName = item.drpCoName;
|
|
40
|
+
}
|
|
41
|
+
} else if (type === "send") {
|
|
42
|
+
if (["sendId", "all"].includes(showField || "")) {
|
|
43
|
+
params.sendId = item.wmsCoId;
|
|
44
|
+
}
|
|
45
|
+
if (["sendName", "all"].includes(showField || "")) {
|
|
46
|
+
params.sendName = item.wmsCoName;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return params;
|
|
50
|
+
});
|
|
51
|
+
if (!newList.length) {
|
|
52
|
+
switch (type) {
|
|
53
|
+
case "logistics":
|
|
54
|
+
newList = [{
|
|
55
|
+
logisticsCompany: null,
|
|
56
|
+
logisticsCode: ""
|
|
57
|
+
}];
|
|
58
|
+
break;
|
|
59
|
+
case "supply":
|
|
60
|
+
newList = [{
|
|
61
|
+
supplyId: ""
|
|
62
|
+
}];
|
|
63
|
+
break;
|
|
64
|
+
case "send":
|
|
65
|
+
newList = [{
|
|
66
|
+
sendId: "",
|
|
67
|
+
sendName: ""
|
|
68
|
+
}];
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return newList;
|
|
73
|
+
} else {
|
|
74
|
+
return list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
|
|
75
|
+
var items = next.items.map(function (t) {
|
|
76
|
+
var params = {
|
|
77
|
+
title: t.skuName,
|
|
78
|
+
picUrl: t.pic,
|
|
79
|
+
platform: "jst"
|
|
80
|
+
};
|
|
81
|
+
if (enableItemId) {
|
|
82
|
+
params.itemId = t.supplierId;
|
|
83
|
+
}
|
|
84
|
+
if (enableSupplierName) {
|
|
85
|
+
params.supplierName = t.supplierName;
|
|
86
|
+
}
|
|
87
|
+
return params;
|
|
88
|
+
});
|
|
89
|
+
prv.push.apply(prv, _toConsumableArray(items));
|
|
90
|
+
return prv;
|
|
91
|
+
}, []);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// 淘宝商品组件信息处理
|
|
96
|
+
|
|
97
|
+
var taobaoGoodHandle = function taobaoGoodHandle() {
|
|
98
|
+
var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
99
|
+
var type = arguments.length > 1 ? arguments[1] : undefined;
|
|
100
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
101
|
+
var changeSku = config.changeSku;
|
|
102
|
+
return arr === null || arr === void 0 ? void 0 : arr.map(function (item) {
|
|
103
|
+
var numIid = item.numIid,
|
|
104
|
+
title = item.title,
|
|
105
|
+
picUrl = item.picUrl,
|
|
106
|
+
price = item.price,
|
|
107
|
+
outerId = item.outerId,
|
|
108
|
+
platform = item.platform,
|
|
109
|
+
skuInfoDTO = item.skuInfoDTO;
|
|
110
|
+
var params = {
|
|
111
|
+
numIid: numIid,
|
|
112
|
+
title: title,
|
|
113
|
+
picUrl: picUrl,
|
|
114
|
+
price: price,
|
|
115
|
+
platform: platform
|
|
116
|
+
};
|
|
117
|
+
if (skuInfoDTO) {
|
|
118
|
+
params.picUrl = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.picUrl;
|
|
119
|
+
params.price = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.price;
|
|
120
|
+
params.skuId = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.skuId;
|
|
121
|
+
}
|
|
122
|
+
if (changeSku) {
|
|
123
|
+
params.propertiesName = (skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.propertiesName) || "";
|
|
124
|
+
}
|
|
125
|
+
if (type === "ITEM_ENCODE") {
|
|
126
|
+
params.outerId = (skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.outerSkuId) || outerId;
|
|
127
|
+
} else if (type === "ITEM_SELECT_THIRD") {
|
|
128
|
+
params.itemId = "";
|
|
129
|
+
params.supplierName = "";
|
|
130
|
+
}
|
|
131
|
+
return params;
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
//订单返填数据重组
|
|
135
|
+
export default (function (_ref) {
|
|
136
|
+
var _ref$detail = _ref.detail,
|
|
137
|
+
detail = _ref$detail === void 0 ? {} : _ref$detail,
|
|
138
|
+
_ref$order_no = _ref.order_no,
|
|
139
|
+
order_no = _ref$order_no === void 0 ? null : _ref$order_no,
|
|
140
|
+
_ref$formValue = _ref.formValue,
|
|
141
|
+
formValue = _ref$formValue === void 0 ? {} : _ref$formValue,
|
|
142
|
+
_ref$templateDetail = _ref.templateDetail,
|
|
143
|
+
templateDetail = _ref$templateDetail === void 0 ? {} : _ref$templateDetail,
|
|
144
|
+
_ref$type = _ref.type,
|
|
145
|
+
type = _ref$type === void 0 ? "add" : _ref$type;
|
|
146
|
+
return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
|
|
147
|
+
var uniqueKey = next.uniqueKey;
|
|
148
|
+
var config = next.componentConfig;
|
|
149
|
+
switch (next.workOrderComponentType) {
|
|
150
|
+
case "TRADE_ID_INPUT":
|
|
151
|
+
prv[uniqueKey] = order_no || detail["orderNo"];
|
|
152
|
+
break;
|
|
153
|
+
case "BUYER_NICK_INPUT":
|
|
154
|
+
prv[uniqueKey] = {
|
|
155
|
+
buyerNick: detail["buyerNick"],
|
|
156
|
+
buyerOpenUid: detail["buyerOpenUid"]
|
|
157
|
+
};
|
|
158
|
+
break;
|
|
159
|
+
case "RECEIVER_NAME_INPUT":
|
|
160
|
+
prv[uniqueKey] = detail["receiveName"];
|
|
161
|
+
break;
|
|
162
|
+
case "RECEIVER_MOBILE_INPUT":
|
|
163
|
+
prv[uniqueKey] = detail["receiveMobile"];
|
|
164
|
+
break;
|
|
165
|
+
case "RECEIVER_ADDRESS_INPUT":
|
|
166
|
+
prv[uniqueKey] = {
|
|
167
|
+
address: detail["provinceCode"] ? [+detail["provinceCode"], +detail["cityCode"], +detail["townCode"]] : [],
|
|
168
|
+
detail: detail["address"] || ""
|
|
169
|
+
};
|
|
170
|
+
break;
|
|
171
|
+
case "TRADE_CREATE_DATETIME":
|
|
172
|
+
prv[uniqueKey] = detail["orderCreateDateTime"] ? moment(detail["orderCreateDateTime"]).format("YYYY-MM-DD HH:mm:ss") : "";
|
|
173
|
+
break;
|
|
174
|
+
case "TRADE_PAYMENT_DATETIME":
|
|
175
|
+
prv[uniqueKey] = detail["orderPaymentDateTime"] ? moment(detail["orderPaymentDateTime"]).format("YYYY-MM-DD HH:mm:ss") : "";
|
|
176
|
+
break;
|
|
177
|
+
case "TRADE_DELIVERY_DATETIME":
|
|
178
|
+
prv[uniqueKey] = detail["orderDeliveryDateTime"] ? moment(detail["orderDeliveryDateTime"]).format("YYYY-MM-DD HH:mm:ss") : "";
|
|
179
|
+
break;
|
|
180
|
+
case "TRADE_CLOSING_DATETIME":
|
|
181
|
+
prv[uniqueKey] = detail["orderClosingDateTime"] ? moment(detail["orderClosingDateTime"]).format("YYYY-MM-DD HH:mm:ss") : "";
|
|
182
|
+
break;
|
|
183
|
+
case "ACTUAL_PAYMENT":
|
|
184
|
+
prv[uniqueKey] = detail["actualPayment"];
|
|
185
|
+
break;
|
|
186
|
+
case "EXPRESS_LOGISTICS_SELECT":
|
|
187
|
+
prv[uniqueKey] = {
|
|
188
|
+
company: ExpressData.getInstance().getExpressCodeByName(detail["expressLogisticsCompany"]),
|
|
189
|
+
order: detail["expressLogisticsCode"]
|
|
190
|
+
};
|
|
191
|
+
break;
|
|
192
|
+
case "RETURN_LOGISTICS_SELECT":
|
|
193
|
+
prv[uniqueKey] = {
|
|
194
|
+
company: ExpressData.getInstance().getExpressCodeByName(detail["returnLogisticsCompany"]),
|
|
195
|
+
order: detail["returnLogisticsCode"]
|
|
196
|
+
};
|
|
197
|
+
break;
|
|
198
|
+
case "ALI_PAY_INPUT":
|
|
199
|
+
prv[uniqueKey] = {
|
|
200
|
+
name: detail["alipayName"],
|
|
201
|
+
user: detail["alipayAccount"]
|
|
202
|
+
};
|
|
203
|
+
break;
|
|
204
|
+
case "ITEM_SELECT":
|
|
205
|
+
case "ITEM_ID":
|
|
206
|
+
case "ITEM_ENCODE":
|
|
207
|
+
prv[uniqueKey] = taobaoGoodHandle(detail["itemList"], next.workOrderComponentType, next.componentConfig);
|
|
208
|
+
break;
|
|
209
|
+
case "REMARK_INPUT":
|
|
210
|
+
prv[uniqueKey] = {
|
|
211
|
+
remark: detail["remark"] || "",
|
|
212
|
+
flag: detail["flag"] ? Number(detail["flag"]) : detail["flag"]
|
|
213
|
+
};
|
|
214
|
+
break;
|
|
215
|
+
case "ENTERPRISE_PAYMENT":
|
|
216
|
+
//编辑的时候不能修改打款信息
|
|
217
|
+
if (type === "edit") break;
|
|
218
|
+
prv[uniqueKey] = {
|
|
219
|
+
enterprisePaymentTid: detail["orderNo"],
|
|
220
|
+
enterprisePaymentRefundFee: "",
|
|
221
|
+
enterprisePaymentBuyerNick: detail["buyerNick"],
|
|
222
|
+
enterprisePaymentBuyerOpenUid: detail["buyerOpenUid"],
|
|
223
|
+
enterprisePaymentAlipayNick: "",
|
|
224
|
+
enterprisePaymentAlipayNo: ""
|
|
225
|
+
};
|
|
226
|
+
break;
|
|
227
|
+
case "LOGISTICS_INTERCEPTION":
|
|
228
|
+
{
|
|
229
|
+
var _formValue$uniqueKey;
|
|
230
|
+
//物流公司是已对接快递公司时,订单反填不会再起作用
|
|
231
|
+
var interceptCompany = (_formValue$uniqueKey = formValue[uniqueKey]) === null || _formValue$uniqueKey === void 0 ? void 0 : _formValue$uniqueKey.interceptCompany;
|
|
232
|
+
var isInterface = interceptCompany ? ExpressInterceptData.getInstance().isInterfaceCompany(interceptCompany) : false;
|
|
233
|
+
if (type === "edit" && isInterface) break;
|
|
234
|
+
prv[uniqueKey] = {
|
|
235
|
+
interceptCompany: ExpressData.getInstance().getExpressCodeByName(detail["expressLogisticsCompany"]),
|
|
236
|
+
interceptCode: detail["expressLogisticsCode"],
|
|
237
|
+
interceptType: undefined,
|
|
238
|
+
interceptSenderMobile: undefined,
|
|
239
|
+
interceptAddress: [],
|
|
240
|
+
interceptDetail: undefined,
|
|
241
|
+
interceptReceiverName: undefined,
|
|
242
|
+
interceptReceiverMobile: undefined,
|
|
243
|
+
interceptStatus: undefined,
|
|
244
|
+
interceptOther: undefined
|
|
245
|
+
};
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
case "JST_ITEM_SELECT_THIRD":
|
|
249
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail["jstItemList"], "itemList", config);
|
|
250
|
+
break;
|
|
251
|
+
case "JST_SUPPLY":
|
|
252
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail["jstItemList"], "supply", config);
|
|
253
|
+
break;
|
|
254
|
+
case "JST_SEND_GOOD":
|
|
255
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail["jstItemList"], "send", config);
|
|
256
|
+
break;
|
|
257
|
+
case "JST_LOGISTICS":
|
|
258
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail["jstItemList"], "logistics", config);
|
|
259
|
+
break;
|
|
260
|
+
case "SYSTEM_ORDER_NO":
|
|
261
|
+
prv[uniqueKey] = detail["sid"];
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
return prv;
|
|
265
|
+
}, {});
|
|
266
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare type Node = {
|
|
2
|
+
groupId: number;
|
|
3
|
+
groupName: string;
|
|
4
|
+
workOrderTemplates: Array<{
|
|
5
|
+
groupId: number;
|
|
6
|
+
uniqueKey: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
export declare const getNodeNamesByChildId: (tree: Array<Node>, childId: string) => (string | undefined)[] | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export var getNodeNamesByChildId = function getNodeNamesByChildId(tree, childId) {
|
|
2
|
+
var _tree$map;
|
|
3
|
+
var childList = tree === null || tree === void 0 ? void 0 : (_tree$map = tree.map(function (item) {
|
|
4
|
+
return item.workOrderTemplates;
|
|
5
|
+
})) === null || _tree$map === void 0 ? void 0 : _tree$map.flat();
|
|
6
|
+
var child = childList.find(function (c) {
|
|
7
|
+
return c.uniqueKey === childId;
|
|
8
|
+
});
|
|
9
|
+
if (child) {
|
|
10
|
+
var parentId = child.groupId;
|
|
11
|
+
var parentNode = tree === null || tree === void 0 ? void 0 : tree.find(function (item) {
|
|
12
|
+
return item.groupId === parentId;
|
|
13
|
+
});
|
|
14
|
+
return [parentNode === null || parentNode === void 0 ? void 0 : parentNode.groupName, child.name];
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import get from
|
|
1
|
+
import get from "lodash/get";
|
|
2
2
|
var findNodeById = function findNodeById(tree) {
|
|
3
|
-
var actived = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
3
|
+
var actived = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
4
4
|
for (var i = 0; i < tree.length; i++) {
|
|
5
5
|
if (tree[i].actived == actived) {
|
|
6
6
|
return tree[i];
|
|
@@ -18,7 +18,7 @@ export default (function (sourceOptions) {
|
|
|
18
18
|
var newOptions = JSON.parse(JSON.stringify(sourceOptions));
|
|
19
19
|
newOptions.map(function (item) {
|
|
20
20
|
if (tree.length === 0) {
|
|
21
|
-
return tree = tree.concat(get(item,
|
|
21
|
+
return tree = tree.concat(get(item, "list.1", []));
|
|
22
22
|
}
|
|
23
23
|
Object.keys(item.list).map(function (l) {
|
|
24
24
|
// 在树中找到l对应的节点,将当前数组放到children里面
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1-alpha.0",
|
|
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": {
|
|
24
25
|
"lodash": "^4.17.21",
|
|
25
26
|
"umi-request": "^1.4.0"
|
|
26
27
|
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/jest": "^29.5.1",
|
|
30
|
+
"@types/node": "^20.1.1",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
32
|
+
"@typescript-eslint/parser": "^5.59.2",
|
|
33
|
+
"eslint": "^8.40.0",
|
|
34
|
+
"father": "^4.1.7",
|
|
35
|
+
"jest": "^29.5.0",
|
|
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": "7ad1a590f1f169f979d75636f52a0456343ceeee"
|
|
34
46
|
}
|