@kmkf-fe-packages/kmkf-utils 0.5.2-alpha.2 → 0.5.2-alpha.8

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.
@@ -26,6 +26,10 @@ export default class PlatData {
26
26
  platMap: {
27
27
  [prop in string]: string;
28
28
  };
29
+ platSelectList: {
30
+ label: string;
31
+ value: string;
32
+ }[];
29
33
  constructor();
30
34
  initData: () => void;
31
35
  getPlatData: () => PlatInterface[];
@@ -35,6 +39,14 @@ export default class PlatData {
35
39
  getPlatMap: () => {
36
40
  [x: string]: string;
37
41
  };
42
+ /**
43
+ * 获取平台选择列表
44
+ * @returns
45
+ */
46
+ getPlatSelectList: () => {
47
+ label: string;
48
+ value: string;
49
+ }[];
38
50
  static getInstance(): PlatData;
39
51
  }
40
52
  export declare type PlatDataClass = PlatData;
@@ -18,6 +18,7 @@ var PlatData = /*#__PURE__*/function () {
18
18
  _classCallCheck(this, PlatData);
19
19
  _defineProperty(this, "platTypeList", void 0);
20
20
  _defineProperty(this, "platMap", void 0);
21
+ _defineProperty(this, "platSelectList", void 0);
21
22
  _defineProperty(this, "initData", function () {
22
23
  var _this$platTypeList;
23
24
  if (((_this$platTypeList = _this.platTypeList) === null || _this$platTypeList === void 0 ? void 0 : _this$platTypeList.length) > 0) return;
@@ -37,6 +38,13 @@ var PlatData = /*#__PURE__*/function () {
37
38
  return cur;
38
39
  }, {});
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;
40
48
  }
41
49
  });
42
50
  });
@@ -46,8 +54,12 @@ var PlatData = /*#__PURE__*/function () {
46
54
  _defineProperty(this, "getPlatMap", function () {
47
55
  return _this.platMap;
48
56
  });
57
+ _defineProperty(this, "getPlatSelectList", function () {
58
+ return _this.platSelectList;
59
+ });
49
60
  this.platTypeList = [];
50
61
  this.platMap = {};
62
+ this.platSelectList = [];
51
63
  this.initData();
52
64
  }
53
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 };
@@ -3,3 +3,4 @@ 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';
@@ -2,4 +2,6 @@ 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
+ import * as _filterFn from "./filterFn";
7
+ export { _filterFn as filterFn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "0.5.2-alpha.2",
3
+ "version": "0.5.2-alpha.8",
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": "b27e9baf87f3bc49ebb799a1681bf85439940edb"
33
+ "gitHead": "cf25f40d0d3240c1569c6969c78c1f555b17f378"
34
34
  }