@kmkf-fe-packages/services-components 0.24.0-alpha.2 → 0.24.0-alpha.6

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.
@@ -1,6 +1,5 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
2
- import React from "react";
3
- import { BsHeaderGood } from "../BS/common/index";
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../type';
2
+ import React from 'react';
4
3
  declare class EItemEncode implements ComponentInterface {
5
4
  name: string;
6
5
  id: string;
@@ -13,16 +12,13 @@ declare class EItemEncode implements ComponentInterface {
13
12
  formField: string;
14
13
  canSort: boolean;
15
14
  children: ComponentInterface[];
16
- goods: BsHeaderGood;
17
- dataType: ComponentInterface["dataType"];
18
- showHeader: string[];
19
- platform?: ComponentInterface["platform"];
15
+ dataType: ComponentInterface['dataType'];
20
16
  constructor(options: PickOption);
21
17
  renderClient: (record: any) => React.JSX.Element | null;
22
- renderPc: (value: unknown, record: Record) => React.JSX.Element | null;
18
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
23
19
  renderLog: (r: Record) => React.JSX.Element | null;
24
20
  getComponentValue: (r: Record) => any;
25
- renderExport: () => null;
21
+ renderExport: (value: unknown, record: Record) => any;
26
22
  editRender: (p: any) => React.JSX.Element;
27
23
  filterConfig: (item: ColumnConfig) => {
28
24
  searchDefaultConditions: "like";
@@ -30,6 +26,7 @@ declare class EItemEncode implements ComponentInterface {
30
26
  id: string;
31
27
  name: string;
32
28
  filterComponentType: "Input";
33
- }[];
29
+ filterFn: (value: string) => (i: Record) => any;
30
+ };
34
31
  }
35
32
  export default EItemEncode;
@@ -1,6 +1,4 @@
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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; }
@@ -8,18 +6,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
6
  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; }
9
7
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
8
  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); }
11
- import React from "react";
9
+ import React from 'react';
12
10
  import GetFormItem from "../GetFormItem";
13
11
  import ItemEncode from "./ItemEncode";
14
- import { GoodImage, TBGoodTable } from "../Common";
15
- import { BsHeaderGood } from "../BS/common/index";
12
+ import { GoodImage } from "../Common";
16
13
  import ItemView from "../../commonComponents/ItemView";
17
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
14
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
18
15
  import { SYMBOL } from "../../constant";
19
16
  var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
20
17
  var _this = this,
21
- _this$componentConfig,
22
- _this$componentConfig2;
18
+ _this$componentConfig;
23
19
  _classCallCheck(this, EItemEncode);
24
20
  _defineProperty(this, "name", void 0);
25
21
  _defineProperty(this, "id", void 0);
@@ -32,49 +28,43 @@ var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
32
28
  _defineProperty(this, "formField", void 0);
33
29
  _defineProperty(this, "canSort", void 0);
34
30
  _defineProperty(this, "children", void 0);
35
- _defineProperty(this, "goods", void 0);
36
31
  _defineProperty(this, "dataType", void 0);
37
- _defineProperty(this, "showHeader", void 0);
38
- _defineProperty(this, "platform", void 0);
39
32
  _defineProperty(this, "renderClient", function (record) {
40
- if (isNull(record === null || record === void 0 ? void 0 : record[_this.id])) return null;
41
- return /*#__PURE__*/React.createElement(ItemView, {
33
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
42
34
  id: _this.id,
43
35
  label: _this.name,
44
36
  value: /*#__PURE__*/React.createElement(GoodImage, {
45
37
  list: record === null || record === void 0 ? void 0 : record[_this.id],
46
- showHeader: _this.showHeader,
47
38
  type: "itemCode"
48
39
  })
49
- });
40
+ }) : null;
50
41
  });
51
42
  _defineProperty(this, "renderPc", function (value, record) {
52
- return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
53
- id: _this.id,
54
- label: _this.name,
55
- value: /*#__PURE__*/React.createElement(TBGoodTable, {
56
- list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || [],
57
- showHeader: _this.showHeader
58
- })
59
- })) : null;
43
+ if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_itemList")]) === undefined) {
44
+ return /*#__PURE__*/React.createElement("span", null, "--");
45
+ }
46
+ //兼容多个商品
47
+ return /*#__PURE__*/React.createElement("span", {
48
+ onClick: function onClick(e) {
49
+ return e.stopPropagation();
50
+ }
51
+ }, /*#__PURE__*/React.createElement(GoodImage, {
52
+ list: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_itemList")],
53
+ type: "itemCode"
54
+ }));
60
55
  });
61
56
  _defineProperty(this, "renderLog", function (r) {
62
57
  if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_itemList")])) return null;
63
- return /*#__PURE__*/React.createElement(ItemView, {
64
- id: _this.id,
65
- label: _this.name,
66
- value: /*#__PURE__*/React.createElement(GoodImage, {
67
- list: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_itemList")],
68
- showHeader: _this.showHeader,
69
- type: "itemCode"
70
- })
71
- });
58
+ return _this.renderPc(undefined, r);
72
59
  });
73
60
  _defineProperty(this, "getComponentValue", function (r) {
74
61
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_itemList")];
75
62
  });
76
- _defineProperty(this, "renderExport", function () {
77
- return null;
63
+ _defineProperty(this, "renderExport", function (value, record) {
64
+ var _ref;
65
+ return (_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_itemList")]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (item) {
66
+ return item.outerId;
67
+ }).join(' ');
78
68
  });
79
69
  _defineProperty(this, "editRender", function (p) {
80
70
  var _this$effects, _this$effects2;
@@ -84,9 +74,7 @@ var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
84
74
  rules: _this.rules,
85
75
  required: false,
86
76
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
87
- component: /*#__PURE__*/React.createElement(ItemEncode, _extends({
88
- isSingleRow: _this.platform === 'pc'
89
- }, _this.componentConfig, {
77
+ component: /*#__PURE__*/React.createElement(ItemEncode, _extends({}, _this.componentConfig, {
90
78
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
91
79
  shopList: (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList,
92
80
  width: "90%"
@@ -94,62 +82,50 @@ var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
94
82
  });
95
83
  });
96
84
  _defineProperty(this, "filterConfig", function (item) {
97
- return [{
85
+ return {
98
86
  searchDefaultConditions: SYMBOL.like,
99
87
  type: item.type,
100
88
  id: "".concat(item.id, "_itemList"),
101
89
  // 过滤组件id
102
90
  name: item.name,
103
91
  // 过滤组件名称
104
- filterComponentType: "Input"
105
- }];
92
+ filterComponentType: 'Input',
93
+ filterFn: function filterFn(value) {
94
+ return function (i) {
95
+ var _ref2;
96
+ return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, 'itemList') || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
97
+ var _String;
98
+ return item !== null && item !== void 0 && item.outerId ? (_String = String(item === null || item === void 0 ? void 0 : item.outerId)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
99
+ });
100
+ };
101
+ }
102
+ };
106
103
  });
107
104
  this.name = options.name;
108
105
  this.id = options.id;
109
- this.platform = options.platform;
110
106
  this.sortField = "".concat(options.id, "_itemList");
111
107
  this.formField = "".concat(options.id, "_itemList");
112
108
  this.type = options.type;
113
109
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
114
110
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
115
- this.showHeader = ((_this$componentConfig = this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || ["title",
116
- // 商品名称
117
- "outerId",
118
- // 商品编码
119
- "picUrl",
120
- // 图片
121
- "numIid",
122
- // 商品id
123
- "skuId",
124
- // skuId
125
- "outerSkuId",
126
- // sku编码
127
- "propertiesName" // sku 信息
128
- ];
129
-
130
- this.isCombinationComponent = true;
111
+ this.isCombinationComponent = false;
131
112
  this.canSort = false;
132
- this.goods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
133
- id: "".concat(options.id, "_itemList"),
134
- name: "商品信息"
135
- }));
136
- this.children = [this.goods];
137
- this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
113
+ this.children = [];
114
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig = this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? [{
138
115
  required: true,
139
116
  validator: function validator(_, value) {
140
117
  if (!value || !value.length) {
141
- return Promise.reject(new Error("请选择宝贝"));
118
+ return Promise.reject(new Error('请选择宝贝'));
142
119
  }
143
- // 如果配置了商品编码不可见,则跳过商品编码校验
144
- var hasNotId = !_this.showHeader.includes("outerId") && (value || []).some(function (item) {
120
+ var hasNotId = (value || []).some(function (item) {
145
121
  return !item.outerId;
146
122
  });
147
123
  if (hasNotId) {
148
- return Promise.reject(new Error("请输入商品编码"));
124
+ return Promise.reject(new Error('请输入商品编码'));
149
125
  }
150
126
  return Promise.resolve();
151
127
  }
152
128
  }] : [];
153
- this.dataType = "object";
129
+ this.dataType = 'object';
154
130
  });
155
131
  export default EItemEncode;
@@ -169,7 +169,7 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
169
169
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
170
170
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
171
171
  component: /*#__PURE__*/React.createElement(ApaasPosting, _extends({}, _this.componentConfig, {
172
- type: _this.type === "POSTING" || ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) === "workOrder" ? "workOrder" : "bs"
172
+ type: _this.type === "BS_POSTING" ? "bs" : (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField
173
173
  }))
174
174
  });
175
175
  });
@@ -13,5 +13,10 @@ export var SYMBOL = {
13
13
  notnull: 'notnull'
14
14
  };
15
15
  export var batchInput = function batchInput(val) {
16
- return val ? val.split(/[,|,|\s|\n|\rn]/) : val;
16
+ console.log('batchInput', val);
17
+ return val ? val.split(/[,|,|\s|\n|\rn]/).filter(function (t) {
18
+ return !!t;
19
+ }).map(function (t) {
20
+ return t.trim();
21
+ }) : val;
17
22
  };
@@ -1,3 +1,3 @@
1
1
  import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BsLogistics | BsSystemOrder | CommonMultiStatus | CommonSystemOrder | ItemEnCode | FlowCreator | BasicInput | JstLogistics | Logistics | LogisticsMoreTrajectory | Payment | BasicPosting | TradeId | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | CommonDataTime | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | SystemOrderNo | Ordinary | ThirdItemSelect | JstItemSelect | JstSendGood | JstSupply | BsGoods | BsExchange | BsReissue | BsReturn | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | MsgStatus;
3
+ export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | AliPay | BsExchange | BsGoods | BsLogistics | BsPosting | BsReissue | BsReturn | BsSystemOrder | BuyerNick | Calculation | BasicCascader | BasicCheckbox | CommonDataTime | CommonMultiStatus | CommonSystemOrder | CompletedUser | BasicDataTime | ItemEnCode | ItemId | ItemSelect | ErpTradeId | BasicFile | FlowCreator | FlowMarkSelect | FlowStatusSelect | FlowTag | FlowWorkOrderId | BasicGrade | Handler | HandlerDeadLine | BasicInput | JstItemSelect | JstLogistics | JstSendGood | JstSupply | Logistics | LogisticsInterception | LogisticsMoreTrajectory | LogisticsTrajectory | MsgStatus | BasicMultSelect | NodeDeadLine | NodeStayDuration | Ordinary | Payment | BasicPicture | PlatForm | BasicPosting | PrevSubmitter | BasicRadio | BasicRate | ReceiverAddress | ReceiverMobile | ReceiverName | ERemark | ReturnLogistics | BasicSelect | ShopInput | ShopName | StatusSelect | Submitter | SystemOrderNo | TemplateSelect | BasicTextArea | ThirdItemSelect | TradeDateTime | TradeId | WlnGoods | WorkOrderId;
@@ -52,7 +52,6 @@ export interface ComponentInterface {
52
52
  options?: Array<any>;
53
53
  templateId?: string;
54
54
  workOrderUniqueKey?: string;
55
- platform?: PlatForm;
56
55
  /**
57
56
  * @description 组件下标
58
57
  * @deprecated 已弃用字段,后续版本不在使用
@@ -234,7 +233,7 @@ export interface ComponentInterface {
234
233
  getComponentValue: (r: Record) => any;
235
234
  formDataTransform?: (r: any) => any;
236
235
  }
237
- export declare type PickOption = Pick<ComponentInterface, "name" | "id" | "type" | "componentConfig" | "effects" | "columnHeader" | "templateId" | "workOrderUniqueKey" | "platform">;
236
+ export declare type PickOption = Pick<ComponentInterface, "name" | "id" | "type" | "componentConfig" | "effects" | "columnHeader" | "templateId" | "workOrderUniqueKey">;
238
237
  export declare type ColumnConfig = {
239
238
  id: string;
240
239
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.24.0-alpha.2",
3
+ "version": "0.24.0-alpha.6",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -20,8 +20,8 @@
20
20
  ]
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/basic-components": "^0.24.0-alpha.2",
24
- "@kmkf-fe-packages/kmkf-utils": "^0.24.0-alpha.2"
23
+ "@kmkf-fe-packages/basic-components": "^0.24.0-alpha.6",
24
+ "@kmkf-fe-packages/kmkf-utils": "^0.24.0-alpha.6"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@typescript-eslint/eslint-plugin": "^5.59.2",
@@ -37,7 +37,7 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "489b5efdbb763263102c24650e010df9d72eb75c",
40
+ "gitHead": "6e3d1a99ef237be68f0bb97ca9b597a594a02a68",
41
41
  "gitHooks": {
42
42
  "pre-commit": "lint-staged"
43
43
  }
@@ -1,27 +0,0 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
2
- import React from "react";
3
- declare class BsChildGoodPic implements ComponentInterface {
4
- name: string;
5
- id: string;
6
- sortField: string;
7
- type: string;
8
- componentConfig: ComponentInterface["componentConfig"];
9
- align: ALignType;
10
- width: number;
11
- isCombinationComponent: boolean;
12
- formField: string;
13
- canSort: boolean;
14
- children: ComponentInterface[];
15
- dataType: ComponentInterface["dataType"];
16
- constructor(options: PickOption);
17
- getParentId: () => string;
18
- getNumIid: () => string;
19
- renderClient: (record: any) => React.JSX.Element | null;
20
- renderPc: (value: unknown, record: Record) => React.JSX.Element;
21
- renderLog: (r: Record) => React.JSX.Element | null;
22
- getComponentValue: (r: Record) => any;
23
- renderExport: (value: string, record: Record) => any;
24
- editRender: () => null;
25
- filterConfig: () => never[];
26
- }
27
- export default BsChildGoodPic;
@@ -1,114 +0,0 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure 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 _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; }
6
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- 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); } }
9
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
- 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
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- 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 React from "react";
15
- import { Image } from "antd";
16
- import ItemView from "../../../commonComponents/ItemView";
17
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
18
- var BsChildGoodPic = /*#__PURE__*/_createClass(function BsChildGoodPic(options) {
19
- var _this = this;
20
- _classCallCheck(this, BsChildGoodPic);
21
- _defineProperty(this, "name", void 0);
22
- _defineProperty(this, "id", void 0);
23
- _defineProperty(this, "sortField", void 0);
24
- _defineProperty(this, "type", void 0);
25
- _defineProperty(this, "componentConfig", void 0);
26
- _defineProperty(this, "align", void 0);
27
- _defineProperty(this, "width", void 0);
28
- _defineProperty(this, "isCombinationComponent", void 0);
29
- _defineProperty(this, "formField", void 0);
30
- _defineProperty(this, "canSort", void 0);
31
- _defineProperty(this, "children", void 0);
32
- _defineProperty(this, "dataType", void 0);
33
- _defineProperty(this, "getParentId", function () {
34
- var _this$id$split = _this.id.split("_"),
35
- _this$id$split2 = _slicedToArray(_this$id$split, 3),
36
- key = _this$id$split2[0],
37
- name = _this$id$split2[1],
38
- code = _this$id$split2[2];
39
- return "".concat(key, "_").concat(name);
40
- });
41
- _defineProperty(this, "getNumIid", function () {
42
- var _this$id$split3 = _this.id.split("_"),
43
- _this$id$split4 = _slicedToArray(_this$id$split3, 3),
44
- key = _this$id$split4[0],
45
- name = _this$id$split4[1],
46
- code = _this$id$split4[2];
47
- return "".concat(key, "_").concat(name, "_numIid");
48
- });
49
- _defineProperty(this, "renderClient", function (record) {
50
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
51
- id: _this.id,
52
- label: _this.name,
53
- value: _this.getComponentValue(record)
54
- }) : null;
55
- });
56
- _defineProperty(this, "renderPc", function (value, record) {
57
- var numIid = record === null || record === void 0 ? void 0 : record[_this.getNumIid()];
58
- if (numIid) {
59
- return /*#__PURE__*/React.createElement("span", {
60
- onClick: function onClick(e) {
61
- return e.stopPropagation();
62
- }
63
- }, /*#__PURE__*/React.createElement("a", {
64
- href: "https://item.taobao.com/item.htm?id=".concat(numIid),
65
- target: "__blank"
66
- }, /*#__PURE__*/React.createElement("img", {
67
- width: 60,
68
- src: _this.getComponentValue(record)
69
- })));
70
- }
71
- return /*#__PURE__*/React.createElement("span", {
72
- onClick: function onClick(e) {
73
- return e.stopPropagation();
74
- }
75
- }, /*#__PURE__*/React.createElement(Image, {
76
- width: 60,
77
- src: _this.getComponentValue(record)
78
- }));
79
- // return (
80
-
81
- // );
82
- });
83
- _defineProperty(this, "renderLog", function (r) {
84
- var id = _this.getParentId();
85
- if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
86
- return _this.renderPc(undefined, r);
87
- });
88
- _defineProperty(this, "getComponentValue", function (r) {
89
- return r === null || r === void 0 ? void 0 : r[_this.id];
90
- });
91
- _defineProperty(this, "renderExport", function (value, record) {
92
- var _this$getComponentVal;
93
- return (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--";
94
- });
95
- _defineProperty(this, "editRender", function () {
96
- return null;
97
- });
98
- _defineProperty(this, "filterConfig", function () {
99
- return [];
100
- });
101
- this.name = options.name;
102
- this.id = options.id;
103
- this.sortField = options.id;
104
- this.formField = options.id;
105
- this.type = options.type;
106
- this.componentConfig = options.componentConfig;
107
- this.align = "left";
108
- this.width = 100;
109
- this.isCombinationComponent = false;
110
- this.canSort = false;
111
- this.dataType = "string";
112
- this.children = [];
113
- });
114
- export default BsChildGoodPic;