@kmkf-fe-packages/services-components 2.10.28 → 2.10.29
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/dist/esm/Hooks/useColumnsConfig.d.ts +1 -1
- package/dist/esm/commonComponents/GlobalContext/hook/dist/useGetHasErpData.js +49 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpAddressData.js +180 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +186 -0
- package/dist/esm/components/BS/BsGoods/dist/index.js +110 -0
- package/dist/esm/components/Common/dist/index.js +1017 -0
- package/dist/esm/components/PostIng/index.d.ts +1 -1
- package/dist/esm/components/Public/AsyncSelect/index.js +21 -20
- package/dist/esm/components/Public/Goods/index.js +23 -6
- package/dist/esm/factory.d.ts +1 -1
- package/package.json +4 -4
|
@@ -31,7 +31,7 @@ declare class BasicPosting implements ComponentInterface {
|
|
|
31
31
|
sortColumns: SortColumnsField;
|
|
32
32
|
headerProvince: boolean;
|
|
33
33
|
constructor(options: PickOption);
|
|
34
|
-
getChildren: () => (
|
|
34
|
+
getChildren: () => (Province | City | District | Detail | ReceiverName | ReceiverMobile | undefined)[];
|
|
35
35
|
getSortColumns: (sortColumns: string | undefined) => SortColumnsField;
|
|
36
36
|
renderPc: (value: any, record: Record) => React.JSX.Element | null;
|
|
37
37
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -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 {
|
|
17
|
+
import { 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,24 +30,6 @@ 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
|
-
if (version === "flagship") return 1;
|
|
50
|
-
},
|
|
51
33
|
handleOptions: function handleOptions(options) {
|
|
52
34
|
var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
53
35
|
var _ext$componentConfig = ext.componentConfig,
|
|
@@ -61,6 +43,25 @@ var typeMap = {
|
|
|
61
43
|
}
|
|
62
44
|
}
|
|
63
45
|
};
|
|
46
|
+
var getWdtVersion = function getWdtVersion() {
|
|
47
|
+
try {
|
|
48
|
+
var _userInfo$companyUser, _companyUserConfig, _companyUserConfig$pl, _companyUserConfig$pl2;
|
|
49
|
+
var userInfo = JSON.parse(localStorage.getItem("reduxData_userInfo") || "{}");
|
|
50
|
+
var companyUserConfig = (_userInfo$companyUser = userInfo === null || userInfo === void 0 ? void 0 : userInfo.companyUserConfig) !== null && _userInfo$companyUser !== void 0 ? _userInfo$companyUser : {};
|
|
51
|
+
if (typeof companyUserConfig === "string") {
|
|
52
|
+
companyUserConfig = JSON.parse(companyUserConfig);
|
|
53
|
+
}
|
|
54
|
+
return ((_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";
|
|
55
|
+
} catch (error) {
|
|
56
|
+
return "flagship";
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var getWdtTagsMaxSelectCount = function getWdtTagsMaxSelectCount() {
|
|
60
|
+
var componentConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
61
|
+
if (componentConfig.selectMode === "single") return 1;
|
|
62
|
+
if (componentConfig.selectMode === "multiple") return undefined;
|
|
63
|
+
return getWdtVersion() === "flagship" ? 1 : undefined;
|
|
64
|
+
};
|
|
64
65
|
var AsyncSelect = /*#__PURE__*/function () {
|
|
65
66
|
// options: ComponentInterface["options"];
|
|
66
67
|
|
|
@@ -196,7 +197,7 @@ var AsyncSelect = /*#__PURE__*/function () {
|
|
|
196
197
|
this.rules = [];
|
|
197
198
|
this.align = "left";
|
|
198
199
|
this.mode = (_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.mode;
|
|
199
|
-
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;
|
|
200
|
+
this.maxSelectCount = options.type === "WDT_TAGS" ? getWdtTagsMaxSelectCount(this.componentConfig) : 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;
|
|
200
201
|
this.getOptionsAsync().then(function (list) {
|
|
201
202
|
_this.asyncOptions = list;
|
|
202
203
|
});
|
|
@@ -14,7 +14,7 @@ import { BsGoodsTable } from "../../Common";
|
|
|
14
14
|
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
15
15
|
import ItemView from "../../../commonComponents/ItemView";
|
|
16
16
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
|
-
import { CommonGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
17
|
+
import { CommonGoods as Goods, erpFormValidator } from "@kmkf-fe-packages/basic-components";
|
|
18
18
|
import { getGoodsSortChildFields } from "../../Common/constants/columnsBaseInfoMap";
|
|
19
19
|
import { SYMBOL } from "../../../constant";
|
|
20
20
|
var CONFIG_MAP = {
|
|
@@ -41,7 +41,15 @@ var CONFIG_MAP = {
|
|
|
41
41
|
},
|
|
42
42
|
DXD_SUPPLIERS: {
|
|
43
43
|
name: "大希地供应商",
|
|
44
|
-
key: "dxdSuppliers"
|
|
44
|
+
key: "dxdSuppliers",
|
|
45
|
+
validator: function validator(_rule, value, type, componentConfig) {
|
|
46
|
+
if (!_rule.required) return Promise.resolve();
|
|
47
|
+
var validatorResult = erpFormValidator(_rule, value, type, componentConfig);
|
|
48
|
+
if (validatorResult) {
|
|
49
|
+
return validatorResult;
|
|
50
|
+
}
|
|
51
|
+
return Promise.resolve();
|
|
52
|
+
}
|
|
45
53
|
},
|
|
46
54
|
TTX_GOODS: {
|
|
47
55
|
name: "通天晓",
|
|
@@ -163,17 +171,26 @@ var PublicGoods = /*#__PURE__*/_createClass(function PublicGoods(options) {
|
|
|
163
171
|
}));
|
|
164
172
|
this.children = [this.headers];
|
|
165
173
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
var isRequired = !!(this !== null && this !== void 0 && (_this$componentConfig6 = this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required);
|
|
175
|
+
this.rules = [{
|
|
176
|
+
required: isRequired,
|
|
168
177
|
validator: function validator(_, value) {
|
|
169
178
|
var _value$key;
|
|
170
|
-
if (!value || !(value !== null && value !== void 0 && (_value$key = value[key]) !== null && _value$key !== void 0 && _value$key.length)) {
|
|
179
|
+
if (isRequired && (!value || !(value !== null && value !== void 0 && (_value$key = value[key]) !== null && _value$key !== void 0 && _value$key.length))) {
|
|
171
180
|
var _CONFIG_MAP$_this$typ6;
|
|
172
181
|
return Promise.reject(new Error("\u8BF7\u9009\u62E9".concat((_CONFIG_MAP$_this$typ6 = CONFIG_MAP[_this.type]) === null || _CONFIG_MAP$_this$typ6 === void 0 ? void 0 : _CONFIG_MAP$_this$typ6.name, "\u5546\u54C1")));
|
|
173
182
|
}
|
|
174
183
|
return Promise.resolve();
|
|
175
184
|
}
|
|
176
|
-
}
|
|
185
|
+
}, {
|
|
186
|
+
required: isRequired,
|
|
187
|
+
validator: function validator(_rule, value) {
|
|
188
|
+
var _CONFIG_MAP$_this$typ7, _CONFIG_MAP$_this$typ8;
|
|
189
|
+
return ((_CONFIG_MAP$_this$typ7 = CONFIG_MAP[_this.type]) === null || _CONFIG_MAP$_this$typ7 === void 0 ? void 0 : (_CONFIG_MAP$_this$typ8 = _CONFIG_MAP$_this$typ7.validator) === null || _CONFIG_MAP$_this$typ8 === void 0 ? void 0 : _CONFIG_MAP$_this$typ8.call(_CONFIG_MAP$_this$typ7, _rule, value, _this.type, _this.componentConfig)) || function () {
|
|
190
|
+
return Promise.resolve();
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}];
|
|
177
194
|
this.dataType = "object";
|
|
178
195
|
this.sortChildField = this.getSortChildFields();
|
|
179
196
|
this.exampleValue = ((_CONFIG_MAP$this$type2 = CONFIG_MAP[this.type]) === null || _CONFIG_MAP$this$type2 === void 0 ? void 0 : _CONFIG_MAP$this$type2.exampleValue) || "";
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -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, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, DxdShopSelect, KmVideo, BasicTypeInput, SkxIdInputSelect, SkxGoods, BasicSelectOption, OrderSubForm, FlowOverallStatusSelect, ReturnWarehouse, KmExchange } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) =>
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => CommonMultiStatus | JstSendGood | AsyncSelect | PublicGoods | BasicInput | BasicTypeInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicSelectOption | 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 | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicReissueGoods | 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 | CommonSystemOrder | NodeDeadLine | HandlerDeadLine | NodeStayDuration | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | DxdShopSelect | KmVideo | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | ReturnWarehouse | GyGoods | KmExchange | GyReissue | GyReturn | SkxIdInputSelect | SkxGoods | OrderSubForm | FlowOverallStatusSelect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.29",
|
|
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.10.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "2.10.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "2.10.29",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "2.10.29",
|
|
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": "
|
|
44
|
+
"gitHead": "bc7629679c5254fa413acb1b6bb74c06aae65cba",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|