@kmkf-fe-packages/kmkf-utils 0.26.0-alpha.8 → 0.26.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,6 @@ export default class AddressData {
8
8
  addrData: Record<string, [string, string | number]>;
9
9
  addrNameMap: Record<string, string>;
10
10
  addressOptions: TreeOption[];
11
- constructor();
12
- initData: () => void;
13
11
  parseData: (addrCode: string | number) => {
14
12
  label: string;
15
13
  value: string;
@@ -5,9 +5,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
5
5
  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; }
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import request from "../request";
9
- import { toTree } from "../utils";
10
- import get from 'lodash/get';
11
8
  var AddressData = /*#__PURE__*/function () {
12
9
  function AddressData() {
13
10
  var _this = this;
@@ -15,26 +12,6 @@ var AddressData = /*#__PURE__*/function () {
15
12
  _defineProperty(this, "addrData", {});
16
13
  _defineProperty(this, "addrNameMap", {});
17
14
  _defineProperty(this, "addressOptions", []);
18
- _defineProperty(this, "initData", function () {
19
- var _Object$keys;
20
- if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
21
- request({
22
- url: "/qy/gdfw/template/queryAreas",
23
- method: "get",
24
- data: {}
25
- }).then(function (resp) {
26
- var map = {};
27
- var res = {};
28
- var list = resp.data;
29
- for (var i = 0; i < list.length; i++) {
30
- res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
31
- map[list[i]["name"]] = list[i]["id"];
32
- }
33
- _this.addrData = res;
34
- _this.addrNameMap = map;
35
- _this.addressOptions = get(toTree(list, 0), '0.children', []);
36
- });
37
- });
38
15
  _defineProperty(this, "parseData", function (addrCode) {
39
16
  var nameCode = {},
40
17
  arr = [];
@@ -72,7 +49,6 @@ var AddressData = /*#__PURE__*/function () {
72
49
  var _ref;
73
50
  return (_ref = (_this.addrData || {})[code] || []) === null || _ref === void 0 ? void 0 : _ref[0];
74
51
  });
75
- this.initData();
76
52
  }
77
53
  _createClass(AddressData, null, [{
78
54
  key: "getInstance",
@@ -8,8 +8,6 @@ export default class BsAddressData {
8
8
  addrData: Record<string, [string, string | number]>;
9
9
  addrNameMap: Record<string, string>;
10
10
  addressOptions: TreeOption[];
11
- constructor();
12
- initData: () => void;
13
11
  parseData: (addrCode: string | number) => {
14
12
  label: string;
15
13
  value: string;
@@ -5,10 +5,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
5
5
  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; }
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import Monitor from "kmkf-monitor";
9
- import request from "../request";
10
- import { toTree } from "../utils";
11
- import moment from "moment";
12
8
  var BsAddressData = /*#__PURE__*/function () {
13
9
  function BsAddressData() {
14
10
  var _this = this;
@@ -16,56 +12,6 @@ var BsAddressData = /*#__PURE__*/function () {
16
12
  _defineProperty(this, "addrData", {});
17
13
  _defineProperty(this, "addrNameMap", {});
18
14
  _defineProperty(this, "addressOptions", []);
19
- _defineProperty(this, "initData", function () {
20
- // if (Object.keys(this.addrData)?.length > 0) return;
21
- try {
22
- var list = JSON.parse(localStorage.getItem("bsAddressData") || "[]");
23
- var dataTime = localStorage.getItem("bsAddressDataEndTime") ? Number(localStorage.getItem("bsAddressDataEndTime")) : 0;
24
- var isTimeout = dataTime ? (new Date().getTime() - dataTime) / 3600 / 24 > 5 : true;
25
- if (list.length && !isTimeout) {
26
- var map = {};
27
- var res = {};
28
- for (var i = 0; i < list.length; i++) {
29
- res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
30
- map[list[i]["name"]] = list[i]["id"];
31
- }
32
- _this.addrData = res;
33
- _this.addrNameMap = map;
34
- _this.addressOptions = toTree(list, 1);
35
- window.bsAddress = _this;
36
- return;
37
- }
38
- } catch (e) {
39
- var _Object$keys;
40
- if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
41
- }
42
- Monitor.automaticReport({
43
- message: "bs\u5730\u5740-\u5F00\u59CB\u8BF7\u6C42\uFF1A".concat(moment().format("YYYY-MM-DD hh:mm:ss"))
44
- });
45
- request({
46
- url: "/qy/gdfw/template/queryBsAreas",
47
- method: "get",
48
- data: {}
49
- }).then(function (resp) {
50
- var map = {};
51
- var res = {};
52
- var _resp$data = resp.data,
53
- list = _resp$data === void 0 ? [] : _resp$data;
54
- localStorage.setItem("bsAddressData", JSON.stringify(list));
55
- localStorage.setItem("bsAddressDataEndTime", JSON.stringify(new Date().getTime()));
56
- for (var _i = 0; _i < list.length; _i++) {
57
- res[list[_i]["id"]] = [list[_i]["name"], list[_i]["parentId"]];
58
- map[list[_i]["name"]] = list[_i]["id"];
59
- }
60
- _this.addrData = res;
61
- _this.addrNameMap = map;
62
- _this.addressOptions = toTree(list, 1);
63
- window.bsAddress = _this;
64
- Monitor.automaticReport({
65
- message: "bs\u5730\u5740-\u83B7\u53D6\u6570\u636E\uFF1A".concat(moment().format("YYYY-MM-DD hh:mm:ss"))
66
- });
67
- });
68
- });
69
15
  _defineProperty(this, "parseData", function (addrCode) {
70
16
  var nameCode = {},
71
17
  arr = [];
@@ -103,7 +49,6 @@ var BsAddressData = /*#__PURE__*/function () {
103
49
  var _ref;
104
50
  return (_ref = (_this.addrData || {})[code] || []) === null || _ref === void 0 ? void 0 : _ref[0];
105
51
  });
106
- this.initData();
107
52
  }
108
53
  _createClass(BsAddressData, null, [{
109
54
  key: "getInstance",
@@ -10,9 +10,7 @@ interface OptionsItem {
10
10
  export default class ExpressData {
11
11
  private static instance;
12
12
  expressData: OptionsItem[];
13
- constructor();
14
- initData: () => OptionsItem[] | undefined;
15
- getExpressData: () => OptionsItem[] | undefined;
13
+ getExpressData: () => OptionsItem[];
16
14
  setExpressData: (val: OptionsItem[]) => OptionsItem[];
17
15
  getExpressNameByCode: (code: string | number, returnCurrentValue?: boolean) => string | number;
18
16
  getExpressCodeByName: (name: string | number, returnCurrentValue?: boolean) => string | number;
@@ -1,39 +1,17 @@
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; }
4
2
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
3
  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
4
  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
5
  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
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
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); }
10
- import request from "../request";
11
8
  var ExpressData = /*#__PURE__*/function () {
12
9
  function ExpressData() {
13
10
  var _this = this;
14
11
  _classCallCheck(this, ExpressData);
15
12
  _defineProperty(this, "expressData", []);
16
- _defineProperty(this, "initData", function () {
17
- if (_this.expressData.length > 0) return _this.expressData;
18
- request({
19
- url: "/qy/logistics/company/getAllLogisticsCompany",
20
- method: "get",
21
- data: {}
22
- }).then(function (res) {
23
- var data = res.data;
24
- var expressList = data.logisticsCompanyDtoList.map(function (item) {
25
- return _objectSpread(_objectSpread({}, item), {}, {
26
- label: item.name,
27
- value: item.cpCode
28
- });
29
- });
30
- _this.expressData = expressList;
31
- });
32
- });
33
13
  _defineProperty(this, "getExpressData", function () {
34
- var _this$expressData;
35
- if (((_this$expressData = _this.expressData) === null || _this$expressData === void 0 ? void 0 : _this$expressData.length) > 0) return _this.expressData;
36
- _this.initData();
14
+ return _this.expressData;
37
15
  });
38
16
  _defineProperty(this, "setExpressData", function (val) {
39
17
  return _this.expressData = val;
@@ -52,7 +30,6 @@ var ExpressData = /*#__PURE__*/function () {
52
30
  });
53
31
  return item.length ? item[0].value : returnCurrentValue ? name : "";
54
32
  });
55
- this.initData();
56
33
  }
57
34
  _createClass(ExpressData, null, [{
58
35
  key: "getInstance",
@@ -32,9 +32,7 @@ export default class ExpressInterceptData {
32
32
  label: string;
33
33
  value: string;
34
34
  }[];
35
- constructor();
36
- initData: () => OptionsItem[] | undefined;
37
- getExpressData: () => OptionsItem[] | undefined;
35
+ getExpressData: () => OptionsItem[];
38
36
  getShowInterceptionBtn(): any;
39
37
  getTypeNameMap(): any;
40
38
  getStatusNameMap(): any;
@@ -1,37 +1,11 @@
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 _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
2
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
3
  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
4
  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
5
  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
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
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); }
16
- import request from "../request";
17
- var companyTypeMap = {
18
- SF: '顺丰',
19
- ZTO: '中通',
20
- JT: '极兔',
21
- DEFAULT: ''
22
- };
23
8
  var ExpressInterceptData = /*#__PURE__*/function () {
24
- //展示拦截按钮映射
25
- //展示发件人手机号映射
26
- //展示派送地址映射
27
- //退回诶之显示映射
28
- //拦截类型映射
29
- //物流状态映射
30
-
31
- //拦截类型筛选options
32
- // 拦截类型筛选options 顺丰/中通/极兔要拆开
33
- //物流状态筛选options
34
- //物流状态条件选择筛选
35
9
  function ExpressInterceptData() {
36
10
  var _this = this;
37
11
  _classCallCheck(this, ExpressInterceptData);
@@ -46,114 +20,8 @@ var ExpressInterceptData = /*#__PURE__*/function () {
46
20
  _defineProperty(this, "typeConditionOptions", []);
47
21
  _defineProperty(this, "statusOptions", []);
48
22
  _defineProperty(this, "statusConditionOptions", []);
49
- _defineProperty(this, "initData", function () {
50
- if (_this.expressData.length > 0) return _this.expressData;
51
- request({
52
- url: '/qy/logistics/listLogisticsWithInterceptInfo',
53
- method: 'post',
54
- data: {
55
- platformType: 118
56
- }
57
- }).then(function (res) {
58
- var data = res.data;
59
- var expressList = data.map(function (item) {
60
- return _objectSpread(_objectSpread({}, item), {}, {
61
- label: item.name,
62
- value: item.cpCode
63
- });
64
- });
65
- _this.expressData = expressList;
66
- var showBtn = {},
67
- showSender = {},
68
- showAddress = {},
69
- showReturnAddress = {},
70
- typeMap = {},
71
- statusMap = {},
72
- typeObj = {},
73
- statusObj = {};
74
- expressList.forEach(function (item) {
75
- var _item$logisticsStatus, _item$interceptionTyp;
76
- if (item !== null && item !== void 0 && (_item$logisticsStatus = item.logisticsStatusList) !== null && _item$logisticsStatus !== void 0 && _item$logisticsStatus.length) {
77
- item.logisticsStatusList.forEach(function (t) {
78
- statusMap["".concat(t.value)] = t.label;
79
- if (statusObj[t.label]) {
80
- statusObj[t.label] = statusObj[t.label].add(t.value);
81
- } else {
82
- statusObj[t.label] = new Set([t.value]);
83
- }
84
- //todo 取消拦截按钮
85
- if (t !== null && t !== void 0 && t.showInterceptionBtn) {
86
- showBtn["".concat(t.value)] = true;
87
- }
88
- });
89
- }
90
- if (item !== null && item !== void 0 && (_item$interceptionTyp = item.interceptionTypeList) !== null && _item$interceptionTyp !== void 0 && _item$interceptionTyp.length) {
91
- item.interceptionTypeList.forEach(function (t) {
92
- var _t$config, _t$config2, _t$config3;
93
- typeMap["".concat(t.value)] = t.label;
94
- if (typeObj[t.label]) {
95
- typeObj[t.label] = typeObj[t.label].add(t.value);
96
- } else {
97
- typeObj[t.label] = new Set([t.value]);
98
- }
99
- if (t !== null && t !== void 0 && (_t$config = t.config) !== null && _t$config !== void 0 && _t$config.showAddress) {
100
- showAddress["".concat(t.value)] = true;
101
- }
102
- if (t !== null && t !== void 0 && (_t$config2 = t.config) !== null && _t$config2 !== void 0 && _t$config2.showAddressSelect) {
103
- showReturnAddress["".concat(t.value)] = true;
104
- }
105
- if (t !== null && t !== void 0 && (_t$config3 = t.config) !== null && _t$config3 !== void 0 && _t$config3.showSenderMobile) {
106
- showSender["".concat(t.value)] = true;
107
- }
108
- });
109
- }
110
- });
111
- _this.showInterceptionMap = showBtn;
112
- _this.typeNameMap = typeMap;
113
- _this.statusNameMap = statusMap;
114
- _this.showNewAddressMap = showAddress;
115
- _this.showReturnAddressMap = showReturnAddress;
116
- _this.showSenderMobileMap = showSender;
117
- _this.typeOptions = Object.keys(typeObj).map(function (key) {
118
- return {
119
- label: key,
120
- value: _toConsumableArray(typeObj[key]).join(',')
121
- };
122
- });
123
- _this.typeConditionOptions = Object.keys(_this.typeNameMap).map(function (key) {
124
- var type = key.split('|')[0];
125
- return {
126
- label: "".concat(companyTypeMap[type] || '').concat(_this.typeNameMap[key]),
127
- value: key
128
- };
129
- });
130
- _this.statusOptions = Object.keys(statusObj).map(function (key) {
131
- return {
132
- label: key,
133
- value: _toConsumableArray(statusObj[key]).join(',')
134
- };
135
- });
136
- var tempList = [];
137
- var tempObj = {};
138
- Object.keys(_this.statusNameMap).forEach(function (key) {
139
- var type = key.split('|')[1];
140
- if (!tempObj[type]) {
141
- tempList.push({
142
- label: _this.statusNameMap[key],
143
- value: type
144
- });
145
- tempObj[type] = _this.statusNameMap[key];
146
- }
147
- });
148
- _this.statusConditionOptions = tempList;
149
- }).catch(function (e) {
150
- console.log(e);
151
- });
152
- });
153
23
  _defineProperty(this, "getExpressData", function () {
154
- var _this$expressData;
155
- if (((_this$expressData = _this.expressData) === null || _this$expressData === void 0 ? void 0 : _this$expressData.length) > 0) return _this.expressData;
156
- _this.initData();
24
+ return _this.expressData;
157
25
  });
158
26
  _defineProperty(this, "setExpressData", function (val) {
159
27
  return _this.expressData = val;
@@ -164,7 +32,6 @@ var ExpressInterceptData = /*#__PURE__*/function () {
164
32
  });
165
33
  return !!(item !== null && item !== void 0 && item.isInterface);
166
34
  });
167
- this.initData();
168
35
  }
169
36
  _createClass(ExpressInterceptData, [{
170
37
  key: "getShowInterceptionBtn",
@@ -27,7 +27,7 @@ var logisticsAddressData = /*#__PURE__*/function () {
27
27
  _defineProperty(this, "getAddressData", function () {
28
28
  var _this$addressData;
29
29
  if (((_this$addressData = _this.addressData) === null || _this$addressData === void 0 ? void 0 : _this$addressData.length) > 0) return _this.addressData;
30
- _this.initData();
30
+ // this.initData();
31
31
  });
32
32
  _defineProperty(this, "setaddressData", function (val) {
33
33
  return _this.addressData = val;
@@ -37,8 +37,7 @@ var logisticsAddressData = /*#__PURE__*/function () {
37
37
  return item.uk === uk;
38
38
  });
39
39
  });
40
- this.initData();
41
- }
40
+ } // this.initData();
42
41
  _createClass(logisticsAddressData, [{
43
42
  key: "getCpListByCompany",
44
43
  value: function getCpListByCompany(company) {
@@ -29,7 +29,6 @@ export default class PlatData {
29
29
  value: string;
30
30
  }[];
31
31
  constructor();
32
- initData: () => void;
33
32
  getPlatData: () => PlatInterface[];
34
33
  /**
35
34
  * 获取平台类型和平台名称映射关系
@@ -1,17 +1,10 @@
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 _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
2
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
3
  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); } }
10
4
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
5
  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; }
12
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
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); }
14
- import request from "../request";
15
8
  var PlatData = /*#__PURE__*/function () {
16
9
  function PlatData() {
17
10
  var _this = this;
@@ -19,35 +12,6 @@ var PlatData = /*#__PURE__*/function () {
19
12
  _defineProperty(this, "platTypeList", void 0);
20
13
  _defineProperty(this, "platMap", void 0);
21
14
  _defineProperty(this, "platSelectList", void 0);
22
- _defineProperty(this, "initData", function () {
23
- var _this$platTypeList;
24
- if (((_this$platTypeList = _this.platTypeList) === null || _this$platTypeList === void 0 ? void 0 : _this$platTypeList.length) > 0) return;
25
- request({
26
- url: '/qy/platform/listPlatform',
27
- method: 'get',
28
- data: {}
29
- }).then(function (res) {
30
- if (res.success) {
31
- var platType = res.data || {};
32
- platType.alreadyJoinedList = platType.alreadyJoinedList || [];
33
- platType.notJoinList = platType.notJoinList || [];
34
- var list = [].concat(_toConsumableArray(platType.alreadyJoinedList), _toConsumableArray(platType.notJoinList));
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;
48
- }
49
- });
50
- });
51
15
  _defineProperty(this, "getPlatData", function () {
52
16
  return _this.platTypeList;
53
17
  });
@@ -60,7 +24,6 @@ var PlatData = /*#__PURE__*/function () {
60
24
  this.platTypeList = [];
61
25
  this.platMap = {};
62
26
  this.platSelectList = [];
63
- this.initData();
64
27
  }
65
28
  _createClass(PlatData, null, [{
66
29
  key: "getInstance",
@@ -8,8 +8,6 @@ export default class WdtAddressData {
8
8
  addrData: Record<string, [string, string | number]>;
9
9
  addrNameMap: Record<string, string>;
10
10
  addressOptions: TreeOption[];
11
- constructor();
12
- initData: () => void;
13
11
  parseData: (addrCode: string | number) => {
14
12
  label: string;
15
13
  value: string;
@@ -5,8 +5,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
5
5
  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; }
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import request from "../request";
9
- import { toTree } from "../utils";
10
8
  var WdtAddressData = /*#__PURE__*/function () {
11
9
  function WdtAddressData() {
12
10
  var _this = this;
@@ -14,27 +12,6 @@ var WdtAddressData = /*#__PURE__*/function () {
14
12
  _defineProperty(this, "addrData", {});
15
13
  _defineProperty(this, "addrNameMap", {});
16
14
  _defineProperty(this, "addressOptions", []);
17
- _defineProperty(this, "initData", function () {
18
- var _Object$keys;
19
- if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
20
- request({
21
- url: "/qy/gdfw/template/queryWdtAreas",
22
- method: "get",
23
- data: {}
24
- }).then(function (resp) {
25
- var map = {};
26
- var res = {};
27
- var _resp$data = resp.data,
28
- list = _resp$data === void 0 ? [] : _resp$data;
29
- for (var i = 0; i < list.length; i++) {
30
- res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
31
- map[list[i]["name"]] = list[i]["id"];
32
- }
33
- _this.addrData = res;
34
- _this.addrNameMap = map;
35
- _this.addressOptions = toTree(list, 1);
36
- });
37
- });
38
15
  _defineProperty(this, "parseData", function (addrCode) {
39
16
  var nameCode = {},
40
17
  arr = [];
@@ -72,7 +49,6 @@ var WdtAddressData = /*#__PURE__*/function () {
72
49
  var _ref;
73
50
  return (_ref = (_this.addrData || {})[code] || []) === null || _ref === void 0 ? void 0 : _ref[0];
74
51
  });
75
- this.initData();
76
52
  }
77
53
  _createClass(WdtAddressData, null, [{
78
54
  key: "getInstance",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "0.26.0-alpha.8",
3
+ "version": "0.26.1-alpha.1",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -40,7 +40,7 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "f90724cc688f5fd08cf9909a8c63b8d4cebb1a73",
43
+ "gitHead": "82b28b7d1fb02d0a197460143bc023a75c81ddfb",
44
44
  "gitHooks": {
45
45
  "pre-commit": "lint-staged"
46
46
  }