@kmkf-fe-packages/services-components 0.24.0-beta.0 → 0.24.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 CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  - 针对于自定义组件的后缀,在提交的时候是以组件类型的驼峰式来命名的
4
4
 
5
- ---
5
+ ---
@@ -58,7 +58,8 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
58
58
  });
59
59
  _defineProperty(this, "renderExport", function (value, record) {
60
60
  var _this$getComponentVal2;
61
- return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : '--';
61
+ var val = (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : '--';
62
+ return typeof val === 'number' ? val + '' : val;
62
63
  });
63
64
  _defineProperty(this, "editRender", function () {
64
65
  return null;
@@ -20,7 +20,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
20
20
  import React from "react";
21
21
  import ItemView from "../../../commonComponents/ItemView";
22
22
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
23
- import { BsHeaderPic, BsHeaderChild } from "./index";
23
+ import { BsHeaderPic, BsHeaderChild, BsHeaderGoodPic } from "./index";
24
24
  var HeaderMap = {
25
25
  mark: {
26
26
  component: BsHeaderChild,
@@ -81,7 +81,57 @@ var HeaderMap = {
81
81
  name: "赠品类型",
82
82
  key: "type",
83
83
  width: 150
84
+ },
85
+ title: {
86
+ component: BsHeaderChild,
87
+ name: "商品名称",
88
+ key: "title",
89
+ width: 200
90
+ },
91
+ outerId: {
92
+ component: BsHeaderChild,
93
+ name: "商品编码",
94
+ key: "outerId",
95
+ width: 100
96
+ },
97
+ picUrl: {
98
+ component: BsHeaderGoodPic,
99
+ name: "图片",
100
+ key: "picUrl",
101
+ width: 140
102
+ },
103
+ numIid: {
104
+ component: BsHeaderChild,
105
+ name: "商品id",
106
+ key: "numIid",
107
+ width: 100
108
+ },
109
+ skuId: {
110
+ component: BsHeaderChild,
111
+ name: "SKU ID",
112
+ key: "skuId",
113
+ width: 140
114
+ },
115
+ outerSkuId: {
116
+ component: BsHeaderChild,
117
+ name: "SKU 编码",
118
+ key: "outerSkuId",
119
+ width: 140
120
+ },
121
+ propertiesName: {
122
+ component: BsHeaderChild,
123
+ name: "SKU 信息",
124
+ key: "propertiesName",
125
+ width: 140
84
126
  }
127
+
128
+ // title: '商品名称',
129
+ // outerId: '商品编码',
130
+ // picUrl: '图片',
131
+ // numIid: '商品id',
132
+ // skuId: 'SKU ID',
133
+ // outerSkuId: 'SKU 编码',
134
+ // propertiesName: 'SKU 信息',
85
135
  };
86
136
  var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
87
137
  var _this = this;
@@ -152,7 +202,15 @@ var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
152
202
  this.isCombinationComponent = true;
153
203
  this.canSort = false;
154
204
  this.dataType = "string";
155
- this.itemKey = {
205
+ this.itemKey = options.type === 'ITEM_ENCODE' ? {
206
+ title: '商品名称',
207
+ outerId: '商品编码',
208
+ picUrl: '图片',
209
+ numIid: '商品id',
210
+ skuId: 'SKU ID',
211
+ outerSkuId: 'SKU 编码',
212
+ propertiesName: 'SKU 信息'
213
+ } : {
156
214
  mark: "商品标记",
157
215
  pic: "图片",
158
216
  name: "名称",
@@ -1,24 +1,27 @@
1
- import React from 'react';
2
- import { ComponentInterface, Record, PickOption } from '../../type';
3
- declare class NodeInput implements ComponentInterface {
1
+ import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
2
+ import React from "react";
3
+ declare class BsChildGoodPic implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
6
6
  sortField: string;
7
7
  type: string;
8
8
  componentConfig: ComponentInterface["componentConfig"];
9
+ align: ALignType;
10
+ width: number;
9
11
  isCombinationComponent: boolean;
10
12
  formField: string;
11
13
  canSort: boolean;
12
14
  children: ComponentInterface[];
13
- dataType: ComponentInterface['dataType'];
14
- options: ComponentInterface['options'];
15
+ dataType: ComponentInterface["dataType"];
15
16
  constructor(options: PickOption);
17
+ getParentId: () => string;
18
+ getNumIid: () => string;
19
+ renderClient: (record: any) => React.JSX.Element | null;
16
20
  renderPc: (value: unknown, record: Record) => React.JSX.Element;
17
- renderExport: (value: any, record: Record) => any;
18
21
  renderLog: (r: Record) => React.JSX.Element | null;
19
22
  getComponentValue: (r: Record) => any;
20
- renderClient: () => null;
23
+ renderExport: (value: string, record: Record) => any;
21
24
  editRender: () => null;
22
25
  filterConfig: () => never[];
23
26
  }
24
- export default NodeInput;
27
+ export default BsChildGoodPic;
@@ -0,0 +1,114 @@
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;
@@ -1,5 +1,6 @@
1
1
  export { default as BsType } from "./BsType";
2
2
  export { default as BsMemo } from "./BsMemo";
3
3
  export { default as BsHeaderPic } from "./BsHeaderPic";
4
+ export { default as BsHeaderGoodPic } from "./BsHeaderGoodPic";
4
5
  export { default as BsHeaderChild } from "./BsHeaderChild";
5
6
  export { default as BsHeaderGood } from "./BsHeaderGood";
@@ -1,5 +1,6 @@
1
1
  export { default as BsType } from "./BsType";
2
2
  export { default as BsMemo } from "./BsMemo";
3
3
  export { default as BsHeaderPic } from "./BsHeaderPic";
4
+ export { default as BsHeaderGoodPic } from "./BsHeaderGoodPic";
4
5
  export { default as BsHeaderChild } from "./BsHeaderChild";
5
6
  export { default as BsHeaderGood } from "./BsHeaderGood";
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  declare type getFormItemProps = {
3
3
  name: string;
4
4
  title: string;
@@ -7,13 +7,14 @@ declare type getFormItemProps = {
7
7
  component: JSX.Element | string | null;
8
8
  };
9
9
  export declare const getFormItem: ({ name, title, rules, required, component, }: getFormItemProps) => React.JSX.Element;
10
- export declare const showImage: ({ item, type, index, }: {
10
+ export declare const showImage: ({ item, type, index, showHeader, }: {
11
11
  item: any;
12
12
  type: string;
13
13
  index: number;
14
+ showHeader: string[];
14
15
  }) => React.JSX.Element;
15
- export declare const ShowTotalImage: ({ total, allImage, type }: any) => React.JSX.Element;
16
- export declare const GoodImage: ({ list, type }: any) => React.JSX.Element | null;
16
+ export declare const ShowTotalImage: ({ total, allImage, type, showHeader, }: any) => React.JSX.Element;
17
+ export declare const GoodImage: ({ list, type, showHeader }: any) => React.JSX.Element | null;
17
18
  export declare const JstGoodImage: ({ list, type }: any) => any;
18
19
  export declare const BsExpressRender: ({ list, showField }: any) => any;
19
20
  export declare const CommonOrderContent: ({ list, valueKey, failValue, options, }: any) => any;
@@ -27,6 +28,13 @@ export declare const BsGoodsTable: ({ list, showHeader, text, }: {
27
28
  list: any[];
28
29
  showHeader: string[];
29
30
  text?: string | undefined;
31
+ type?: string | undefined;
32
+ }) => React.JSX.Element;
33
+ export declare const TBGoodTable: ({ list, showHeader, text, }: {
34
+ list: any[];
35
+ showHeader: string[];
36
+ text?: string | undefined;
37
+ type?: string | undefined;
30
38
  }) => React.JSX.Element;
31
39
  export declare const FileRender: ({ fileList, canDownload }: any) => React.JSX.Element;
32
40
  export declare const BsSystemOrderTable: ({ value, type }: any) => React.JSX.Element;