@kmkf-fe-packages/services-components 2.0.54-beta.71 → 2.0.54-beta.72

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.
@@ -15,6 +15,7 @@ declare class AsyncSelect implements ComponentInterface {
15
15
  dataType: ComponentInterface["dataType"];
16
16
  asyncOptions?: any[];
17
17
  mode: string;
18
+ maxSelectCount: number | undefined;
18
19
  constructor(options: PickOption);
19
20
  getOptionsAsync(): Promise<any[]>;
20
21
  getValueString: (value: any) => any;
@@ -14,7 +14,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
14
14
  import React from "react";
15
15
  import GetFormItem from "../../GetFormItem";
16
16
  import { AsyncSelect as BasicAsyncSelect } from "@kmkf-fe-packages/basic-components";
17
- import { servers } from "@kmkf-fe-packages/kmkf-utils";
17
+ import { isNull, servers } from "@kmkf-fe-packages/kmkf-utils";
18
18
  import ItemView from "../../../commonComponents/ItemView";
19
19
  import { filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
20
20
  import { SYMBOL } from "../../../constant";
@@ -30,6 +30,26 @@ var typeMap = {
30
30
  name: "旺店通标签",
31
31
  mode: "multiple",
32
32
  api: servers.WDT.getTagsDataAsync,
33
+ //旗舰版暂时限制最多选择一个
34
+ maxSelectCount: function maxSelectCount() {
35
+ var version = "flagship";
36
+ try {
37
+ var userInfo = JSON.parse(localStorage.getItem("reduxData_userInfo") || "{}");
38
+ if (isNull(userInfo)) {
39
+ version = "flagship";
40
+ } else {
41
+ var _userInfo$companyUser, _companyUserConfig, _companyUserConfig$pl, _companyUserConfig$pl2;
42
+ var companyUserConfig = (_userInfo$companyUser = userInfo === null || userInfo === void 0 ? void 0 : userInfo.companyUserConfig) !== null && _userInfo$companyUser !== void 0 ? _userInfo$companyUser : {};
43
+ if (typeof companyUserConfig === "string") {
44
+ companyUserConfig = JSON.parse(companyUserConfig);
45
+ }
46
+ version = ((_companyUserConfig = companyUserConfig) === null || _companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl = _companyUserConfig.plugins) === null || _companyUserConfig$pl === void 0 ? void 0 : (_companyUserConfig$pl2 = _companyUserConfig$pl.wdt) === null || _companyUserConfig$pl2 === void 0 ? void 0 : _companyUserConfig$pl2.version) || "flagship";
47
+ }
48
+ } catch (error) {
49
+ console.error(error);
50
+ }
51
+ if (version === "flagship") return 1;
52
+ },
33
53
  handleOptions: function handleOptions(options) {
34
54
  var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
35
55
  var _ext$componentConfig = ext.componentConfig,
@@ -50,7 +70,9 @@ var AsyncSelect = /*#__PURE__*/function () {
50
70
  var _this = this,
51
71
  _typeMap$options$type,
52
72
  _typeMap$options$type2,
53
- _typeMap$options$type3;
73
+ _typeMap$options$type3,
74
+ _typeMap$options$type4,
75
+ _typeMap$options$type5;
54
76
  _classCallCheck(this, AsyncSelect);
55
77
  _defineProperty(this, "name", void 0);
56
78
  _defineProperty(this, "id", void 0);
@@ -66,13 +88,14 @@ var AsyncSelect = /*#__PURE__*/function () {
66
88
  _defineProperty(this, "dataType", void 0);
67
89
  _defineProperty(this, "asyncOptions", void 0);
68
90
  _defineProperty(this, "mode", void 0);
91
+ _defineProperty(this, "maxSelectCount", void 0);
69
92
  _defineProperty(this, "getValueString", function (value) {
70
93
  var list = _this.asyncOptions || [];
71
94
  if (!_this.mode) {
72
- var seletedItem = list.find(function (item) {
95
+ var selectedItem = list.find(function (item) {
73
96
  return item.value === value;
74
97
  });
75
- return seletedItem ? seletedItem.label : value !== null && value !== void 0 ? value : "--";
98
+ return selectedItem ? selectedItem.label : value !== null && value !== void 0 ? value : "--";
76
99
  } else if (_this.mode === "multiple" && Array.isArray(value)) {
77
100
  var _list$filter$map$join;
78
101
  return (_list$filter$map$join = list.filter(function (item) {
@@ -132,7 +155,8 @@ var AsyncSelect = /*#__PURE__*/function () {
132
155
  mode: _this.mode,
133
156
  placeholder: "\u8BF7\u9009\u62E9".concat(_this.name),
134
157
  getOptionsAsync: _this.getOptionsAsync.bind(_this),
135
- onChange: p === null || p === void 0 ? void 0 : p.onChange
158
+ onChange: p === null || p === void 0 ? void 0 : p.onChange,
159
+ maxSelectCount: _this.maxSelectCount
136
160
  }))
137
161
  });
138
162
  });
@@ -174,6 +198,7 @@ var AsyncSelect = /*#__PURE__*/function () {
174
198
  this.rules = [];
175
199
  this.align = "left";
176
200
  this.mode = (_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.mode;
201
+ this.maxSelectCount = typeof ((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.maxSelectCount) === "function" ? typeMap[options.type].maxSelectCount() : (_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.maxSelectCount;
177
202
  this.getOptionsAsync().then(function (list) {
178
203
  _this.asyncOptions = list;
179
204
  });
@@ -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 | JstSendGood | KmVideo | MsgStatus | 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 | AsyncSelect;
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.71",
3
+ "version": "2.0.54-beta.72",
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.71",
25
- "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.71",
24
+ "@kmkf-fe-packages/basic-components": "2.0.54-beta.72",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.72",
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": "9b51148bda8a490eaae1b17c79543d6cc4d3baec",
44
+ "gitHead": "57029c6ab776b45df269aeb6bf44382d32dafe35",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }