@kmkf-fe-packages/services-components 0.11.0-alpha.13 → 0.11.0-alpha.15
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,8 +1,8 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { ExpressData } from
|
|
4
|
-
import ExpressCompany from
|
|
5
|
-
import ExpressCode from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
4
|
+
import ExpressCompany from "../common/expressCompany";
|
|
5
|
+
import ExpressCode from "../common/expressCode";
|
|
6
6
|
declare class BsLogistics implements ComponentInterface {
|
|
7
7
|
name: string;
|
|
8
8
|
id: string;
|
|
@@ -15,13 +15,13 @@ declare class BsLogistics implements ComponentInterface {
|
|
|
15
15
|
}[];
|
|
16
16
|
type: string;
|
|
17
17
|
rules: any[];
|
|
18
|
-
componentConfig: ComponentInterface[
|
|
18
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
19
19
|
expressDateInstance: InstanceType<typeof ExpressData>;
|
|
20
20
|
isCombinationComponent: boolean;
|
|
21
21
|
formField: string;
|
|
22
22
|
canSort: boolean;
|
|
23
23
|
children: ComponentInterface[];
|
|
24
|
-
dataType: ComponentInterface[
|
|
24
|
+
dataType: ComponentInterface["dataType"];
|
|
25
25
|
expressCompany: ExpressCompany;
|
|
26
26
|
expressCode: ExpressCode;
|
|
27
27
|
constructor(options: PickOption);
|
|
@@ -8,28 +8,28 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
8
8
|
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
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
10
|
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
|
|
12
|
-
import { ExpressData } from
|
|
13
|
-
import some from
|
|
11
|
+
import React from "react";
|
|
12
|
+
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
13
|
+
import some from "lodash/some";
|
|
14
14
|
import GetFormItem from "../../GetFormItem";
|
|
15
15
|
import { JstGoodImage } from "../../Common";
|
|
16
|
-
import { JstGoods } from
|
|
16
|
+
import { JstGoods } from "@kmkf-fe-packages/basic-components";
|
|
17
17
|
import ItemView from "../../../commonComponents/ItemView";
|
|
18
|
-
import { isNull } from
|
|
18
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
19
19
|
import ExpressCompany from "../common/expressCompany";
|
|
20
20
|
import ExpressCode from "../common/expressCode";
|
|
21
21
|
var typeMap = {
|
|
22
22
|
BS_LOGISTICS: {
|
|
23
|
-
key:
|
|
24
|
-
name:
|
|
25
|
-
company:
|
|
26
|
-
code:
|
|
23
|
+
key: "bsLogisticsList",
|
|
24
|
+
name: "bs",
|
|
25
|
+
company: "bsLogisticsCompany",
|
|
26
|
+
code: "bsLogisticsCode"
|
|
27
27
|
},
|
|
28
28
|
WLN_LOGISTICS: {
|
|
29
|
-
key:
|
|
30
|
-
name:
|
|
31
|
-
company:
|
|
32
|
-
code:
|
|
29
|
+
key: "wlnLogisticsList",
|
|
30
|
+
name: "万里牛",
|
|
31
|
+
company: "wlnLogisticsCompany",
|
|
32
|
+
code: "wlnLogisticsCode"
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
|
|
@@ -131,24 +131,31 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
|
|
|
131
131
|
this.isCombinationComponent = true;
|
|
132
132
|
this.canSort = false;
|
|
133
133
|
this.expressCompany = new ExpressCompany(_objectSpread(_objectSpread({}, options), {}, {
|
|
134
|
-
name:
|
|
134
|
+
name: "物流公司",
|
|
135
135
|
parentName: (_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.name,
|
|
136
136
|
id: "".concat(options.id, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.key, "_").concat((_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.company),
|
|
137
137
|
width: 200
|
|
138
138
|
}));
|
|
139
139
|
this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
140
|
-
name:
|
|
140
|
+
name: "物流单号",
|
|
141
141
|
parentName: (_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.name,
|
|
142
142
|
id: "".concat(options.id, "_").concat((_typeMap$options$type7 = typeMap[options.type]) === null || _typeMap$options$type7 === void 0 ? void 0 : _typeMap$options$type7.key, "_").concat((_typeMap$options$type8 = typeMap[options.type]) === null || _typeMap$options$type8 === void 0 ? void 0 : _typeMap$options$type8.code),
|
|
143
143
|
width: 200
|
|
144
144
|
}));
|
|
145
145
|
this.children = [this.expressCompany, this.expressCode];
|
|
146
|
-
this.dataType =
|
|
146
|
+
this.dataType = "object";
|
|
147
147
|
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
148
148
|
required: true,
|
|
149
149
|
validator: function validator(_, value) {
|
|
150
|
+
var showField = _this.componentConfig.showField;
|
|
150
151
|
var hasNo = (value || []).some(function (item) {
|
|
151
|
-
|
|
152
|
+
if (showField === "logisticsCompany") {
|
|
153
|
+
return item.logisticsCompany;
|
|
154
|
+
} else if (showField === "logisticsCode") {
|
|
155
|
+
return item.logisticsCode;
|
|
156
|
+
} else {
|
|
157
|
+
return item.logisticsCompany && item.logisticsCode;
|
|
158
|
+
}
|
|
152
159
|
});
|
|
153
160
|
if (!hasNo) {
|
|
154
161
|
return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u7269\u6D41\u4FE1\u606F"));
|
|
@@ -158,14 +165,14 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
|
|
|
158
165
|
}] : [];
|
|
159
166
|
this.expressDateInstance = ExpressData.getInstance();
|
|
160
167
|
this.sortChildField = [{
|
|
161
|
-
name:
|
|
168
|
+
name: "物流公司",
|
|
162
169
|
key: "".concat(options.id, "_").concat((_typeMap$options$type9 = typeMap[options.type]) === null || _typeMap$options$type9 === void 0 ? void 0 : _typeMap$options$type9.company),
|
|
163
170
|
options: this.expressDateInstance.getExpressData(),
|
|
164
|
-
dataType:
|
|
171
|
+
dataType: "string"
|
|
165
172
|
}, {
|
|
166
|
-
name:
|
|
173
|
+
name: "物流单号",
|
|
167
174
|
key: "".concat(options.id, "_").concat((_typeMap$options$type10 = typeMap[options.type]) === null || _typeMap$options$type10 === void 0 ? void 0 : _typeMap$options$type10.code),
|
|
168
|
-
dataType:
|
|
175
|
+
dataType: "string"
|
|
169
176
|
}];
|
|
170
177
|
});
|
|
171
178
|
export default BsLogistics;
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -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, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods } 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) => BsGoods | BsLogistics | BsSystemOrder | CommonMultiStatus | CommonSystemOrder | CompletedUser | FlowMarkSelect | Handler | BasicInput | JstSendGood | PlatForm | ShopInput | StatusSelect | Submitter | WlnGoods | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSupply | BsExchange | BsReissue | BsReturn | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | FlowWorkOrderId | Calculation | NodeDeadLine | HandlerDeadLine | NodeStayDuration;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "0.11.0-alpha.
|
|
3
|
+
"version": "0.11.0-alpha.15",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"father": "^4.1.7"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@kmkf-fe-packages/basic-components": "^0.11.0-alpha.
|
|
29
|
+
"@kmkf-fe-packages/basic-components": "^0.11.0-alpha.15",
|
|
30
30
|
"@kmkf-fe-packages/kmkf-utils": "^0.11.0-alpha.8"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"gitHooks": {
|
|
41
41
|
"pre-commit": "lint-staged"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "884d0bdb26faabcabff679bede4eb2577943a77a"
|
|
44
44
|
}
|