@kmkf-fe-packages/services-components 2.0.54-beta.65 → 2.0.54-beta.67

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.
@@ -14,8 +14,10 @@ declare class AsyncSelect implements ComponentInterface {
14
14
  children: ComponentInterface[];
15
15
  dataType: ComponentInterface["dataType"];
16
16
  asyncOptions?: any[];
17
+ mode: string;
17
18
  constructor(options: PickOption);
18
19
  getOptionsAsync(): Promise<any[]>;
20
+ getValueString: (value: any) => any;
19
21
  renderClient: (record: any) => React.JSX.Element | null;
20
22
  renderPc: (_value: any, record: Record) => React.JSX.Element;
21
23
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -26,21 +26,20 @@ var typeMap = {
26
26
  api: servers.GY.getTradePaymentDataAsync
27
27
  },
28
28
  WDT_TAGS: {
29
- key: "tags",
29
+ key: "wdtTags",
30
30
  name: "旺店通标签",
31
- api: servers.GY.getTradePaymentDataAsync,
31
+ mode: "multiple",
32
+ api: servers.WDT.getTagsDataAsync,
32
33
  handleOptions: function handleOptions(options) {
33
34
  var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34
35
  var _ext$componentConfig = ext.componentConfig,
35
36
  _ext$componentConfig2 = _ext$componentConfig === void 0 ? {} : _ext$componentConfig,
36
37
  tagsRange = _ext$componentConfig2.tagsRange;
37
- console.log("旺店通标签--", {
38
- options: options,
39
- ext: ext
38
+ if (!tagsRange || tagsRange === "all") return options;
39
+ return options.filter(function (option) {
40
+ if (tagsRange === "builtInTags") return !!option.isBuiltIn;
41
+ return !option.isBuiltIn;
40
42
  });
41
- if (tagsRange === "all") return options;
42
- if (!tagsRange) return options;
43
- return options.filter(Boolean);
44
43
  }
45
44
  }
46
45
  };
@@ -50,7 +49,8 @@ var AsyncSelect = /*#__PURE__*/function () {
50
49
  function AsyncSelect(options) {
51
50
  var _this = this,
52
51
  _typeMap$options$type,
53
- _typeMap$options$type2;
52
+ _typeMap$options$type2,
53
+ _typeMap$options$type3;
54
54
  _classCallCheck(this, AsyncSelect);
55
55
  _defineProperty(this, "name", void 0);
56
56
  _defineProperty(this, "id", void 0);
@@ -65,6 +65,23 @@ var AsyncSelect = /*#__PURE__*/function () {
65
65
  _defineProperty(this, "children", void 0);
66
66
  _defineProperty(this, "dataType", void 0);
67
67
  _defineProperty(this, "asyncOptions", void 0);
68
+ _defineProperty(this, "mode", void 0);
69
+ _defineProperty(this, "getValueString", function (value) {
70
+ var list = _this.asyncOptions || [];
71
+ if (!_this.mode) {
72
+ var seletedItem = list.find(function (item) {
73
+ return item.value === value;
74
+ });
75
+ return seletedItem ? seletedItem.label : value !== null && value !== void 0 ? value : "--";
76
+ } else if (_this.mode === "multiple" && Array.isArray(value)) {
77
+ var _list$filter$map$join;
78
+ return (_list$filter$map$join = list.filter(function (item) {
79
+ return value.includes(item.value);
80
+ }).map(function (item) {
81
+ return item.label;
82
+ }).join(",")) !== null && _list$filter$map$join !== void 0 ? _list$filter$map$join : "--";
83
+ }
84
+ });
68
85
  _defineProperty(this, "renderClient", function (record) {
69
86
  var value = record === null || record === void 0 ? void 0 : record[_this.id];
70
87
  return !isNil(value) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -72,6 +89,7 @@ var AsyncSelect = /*#__PURE__*/function () {
72
89
  label: _this.name,
73
90
  value: /*#__PURE__*/React.createElement(BasicAsyncSelect, {
74
91
  value: value,
92
+ mode: _this.mode,
75
93
  getOptionsAsync: _this.getOptionsAsync.bind(_this),
76
94
  showOnly: true
77
95
  })
@@ -81,6 +99,7 @@ var AsyncSelect = /*#__PURE__*/function () {
81
99
  var value = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[_this.type].key)];
82
100
  return /*#__PURE__*/React.createElement("span", null, isNil(value) ? "--" : /*#__PURE__*/React.createElement(BasicAsyncSelect, {
83
101
  value: value,
102
+ mode: _this.mode,
84
103
  getOptionsAsync: _this.getOptionsAsync.bind(_this),
85
104
  showOnly: true
86
105
  }));
@@ -97,11 +116,7 @@ var AsyncSelect = /*#__PURE__*/function () {
97
116
  });
98
117
  _defineProperty(this, "renderExport", function (value, record) {
99
118
  var val = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[_this.type].key)];
100
- var list = _this.asyncOptions || [];
101
- var seletedItem = list.find(function (item) {
102
- return item.value === val;
103
- });
104
- return seletedItem ? seletedItem.label : val !== null && val !== void 0 ? val : "--";
119
+ return _this.getValueString(val);
105
120
  });
106
121
  _defineProperty(this, "editRender", function (p) {
107
122
  var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4;
@@ -114,6 +129,7 @@ var AsyncSelect = /*#__PURE__*/function () {
114
129
  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,
115
130
  tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
116
131
  component: /*#__PURE__*/React.createElement(BasicAsyncSelect, _extends({}, _this.componentConfig, {
132
+ mode: _this.mode,
117
133
  placeholder: "\u8BF7\u9009\u62E9".concat(_this.name),
118
134
  getOptionsAsync: _this.getOptionsAsync.bind(_this),
119
135
  onChange: p === null || p === void 0 ? void 0 : p.onChange
@@ -157,6 +173,7 @@ var AsyncSelect = /*#__PURE__*/function () {
157
173
  this.dataType = "weakenArray";
158
174
  this.rules = [];
159
175
  this.align = "left";
176
+ this.mode = (_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.mode;
160
177
  this.getOptionsAsync().then(function (list) {
161
178
  _this.asyncOptions = list;
162
179
  });
@@ -1,3 +1,3 @@
1
1
  import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, 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, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, KmVideo } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BuyerNick | CommonSystemOrder | ItemEnCode | JstSendGood | KmVideo | MsgStatus | AsyncSelect | PublicReissueGoods | ThirdItemSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | SystemOrderNo | Ordinary | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn;
3
+ export declare const factory: (type: string, options: PickOption) => BuyerNick | CommonSystemOrder | JstSendGood | KmVideo | MsgStatus | AsyncSelect | PublicReissueGoods | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.0.54-beta.65",
3
+ "version": "2.0.54-beta.67",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "2.0.54-beta.64",
25
- "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.64",
24
+ "@kmkf-fe-packages/basic-components": "2.0.54-beta.67",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.67",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "5a6bfcd7f108feb6de190497b69c7addfa441d38",
44
+ "gitHead": "f1dfe723fbe0b192aca04dcad94323cc87bfaa57",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }