@kmkf-fe-packages/services-components 2.0.73 → 2.0.75
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/components/BS/BsGoods/index.js +41 -5
- package/dist/esm/components/LogisticsInterception/InterceptAddress.d.ts +1 -1
- package/dist/esm/components/LogisticsInterception/InterceptAddress.js +13 -8
- package/dist/esm/components/LogisticsInterception/columnHeader.js +1 -1
- package/dist/esm/components/LogisticsMoreInterception/InterceptAddress.d.ts +6 -6
- package/dist/esm/components/LogisticsMoreInterception/InterceptAddress.js +11 -11
- package/dist/esm/components/LogisticsMoreInterception/columnHeader.js +1 -1
- package/dist/esm/components/LogisticsMoreInterception/index.js +3 -1
- package/dist/esm/factory.d.ts +1 -1
- package/package.json +4 -4
- package/dist/esm/commonComponents/GlobalContext/hook/dist/useGetHasErpData.js +0 -52
- package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpAddressData.js +0 -180
- package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +0 -186
- package/dist/esm/components/BS/BsGoods/dist/index.js +0 -113
- package/dist/esm/components/Common/dist/index.js +0 -1019
|
@@ -13,9 +13,16 @@ import GetFormItem from "../../GetFormItem";
|
|
|
13
13
|
import { BsGoodsTable } from "../../Common";
|
|
14
14
|
import { BsHeaderGood } from "../common/index";
|
|
15
15
|
import ItemView from "../../../commonComponents/ItemView";
|
|
16
|
-
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
|
+
import { isNull, findLabelBySelectValue } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
17
|
import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
18
18
|
import { SYMBOL } from "../../../constant";
|
|
19
|
+
var hasQualityValue = function hasQualityValue(value, componentConfig) {
|
|
20
|
+
var _findLabelBySelectVal, _findLabelBySelectVal2;
|
|
21
|
+
var label = (_findLabelBySelectVal = findLabelBySelectValue(value, componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.options)) === null || _findLabelBySelectVal === void 0 ? void 0 : (_findLabelBySelectVal2 = _findLabelBySelectVal.map(function (item) {
|
|
22
|
+
return item.label;
|
|
23
|
+
})) === null || _findLabelBySelectVal2 === void 0 ? void 0 : _findLabelBySelectVal2[0];
|
|
24
|
+
return label === "质量类";
|
|
25
|
+
};
|
|
19
26
|
var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
20
27
|
var _this = this,
|
|
21
28
|
_this$componentConfig6;
|
|
@@ -109,16 +116,45 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
109
116
|
}));
|
|
110
117
|
this.children = [this.bsGoods];
|
|
111
118
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
112
|
-
this.rules =
|
|
113
|
-
|
|
119
|
+
this.rules = [
|
|
120
|
+
//花西子定制,当自定义问题场景组件值一级为“质量类”时,校验bs商品信息是否存在一行商品标记
|
|
121
|
+
{
|
|
114
122
|
validator: function validator(_, value) {
|
|
115
123
|
var _value$bsGoods;
|
|
116
|
-
if (
|
|
124
|
+
if (value !== null && value !== void 0 && (_value$bsGoods = value.bsGoods) !== null && _value$bsGoods !== void 0 && _value$bsGoods.length) {
|
|
125
|
+
var _options$effects, _options$effects$temp, _options$effects$temp2;
|
|
126
|
+
var specialCascader = "8MIqJOso1j";
|
|
127
|
+
var cascader = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : (_options$effects$temp = _options$effects.templateDetail) === null || _options$effects$temp === void 0 ? void 0 : (_options$effects$temp2 = _options$effects$temp.componentDtoList) === null || _options$effects$temp2 === void 0 ? void 0 : _options$effects$temp2.find(function (item) {
|
|
128
|
+
return specialCascader === (item === null || item === void 0 ? void 0 : item.uniqueKey);
|
|
129
|
+
});
|
|
130
|
+
var hasQuality = false;
|
|
131
|
+
if (cascader !== null && cascader !== void 0 && cascader.componentConfig) {
|
|
132
|
+
var _options$effects2, _options$effects2$for;
|
|
133
|
+
var specialCascaderValue = options === null || options === void 0 ? void 0 : (_options$effects2 = options.effects) === null || _options$effects2 === void 0 ? void 0 : (_options$effects2$for = _options$effects2.form) === null || _options$effects2$for === void 0 ? void 0 : _options$effects2$for.getFieldValue(specialCascader);
|
|
134
|
+
hasQuality = hasQualityValue(specialCascaderValue, cascader === null || cascader === void 0 ? void 0 : cascader.componentConfig);
|
|
135
|
+
}
|
|
136
|
+
if (hasQuality) {
|
|
137
|
+
var _value$bsGoods2;
|
|
138
|
+
var hasOneMark = value === null || value === void 0 ? void 0 : (_value$bsGoods2 = value.bsGoods) === null || _value$bsGoods2 === void 0 ? void 0 : _value$bsGoods2.some(function (good) {
|
|
139
|
+
return good.mark === "是";
|
|
140
|
+
});
|
|
141
|
+
if (!hasOneMark) return Promise.reject(new Error("当【问题场景】组件一级为“质量类”时,商品信息需有一行「商品标记」为“是”"));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return Promise.resolve();
|
|
145
|
+
}
|
|
146
|
+
}];
|
|
147
|
+
(this === null || this === void 0 ? void 0 : (_this$componentConfig6 = this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required) && this.rules.push({
|
|
148
|
+
required: true,
|
|
149
|
+
validator: function validator(_, value) {
|
|
150
|
+
var _value$bsGoods3;
|
|
151
|
+
console.log("111");
|
|
152
|
+
if (!value || !(value !== null && value !== void 0 && (_value$bsGoods3 = value.bsGoods) !== null && _value$bsGoods3 !== void 0 && _value$bsGoods3.length)) {
|
|
117
153
|
return Promise.reject(new Error("请选择bs商品"));
|
|
118
154
|
}
|
|
119
155
|
return Promise.resolve();
|
|
120
156
|
}
|
|
121
|
-
}
|
|
157
|
+
});
|
|
122
158
|
this.dataType = "object";
|
|
123
159
|
});
|
|
124
160
|
export default BsGoods;
|
|
@@ -17,7 +17,7 @@ declare class PaymentTid implements ComponentInterface {
|
|
|
17
17
|
children: ComponentInterface[];
|
|
18
18
|
originId: string;
|
|
19
19
|
addressDateInstance: InstanceType<typeof AddressData>;
|
|
20
|
-
dataType: ComponentInterface[
|
|
20
|
+
dataType: ComponentInterface["dataType"];
|
|
21
21
|
constructor(options: PickOption);
|
|
22
22
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
23
23
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
@@ -11,6 +11,7 @@ import GetFormItem from "../GetFormItem";
|
|
|
11
11
|
import ItemView from "../../commonComponents/ItemView";
|
|
12
12
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
13
13
|
import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
|
+
import CopyText from "../../commonComponents/CopyText";
|
|
14
15
|
var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
15
16
|
var _this = this;
|
|
16
17
|
_classCallCheck(this, PaymentTid);
|
|
@@ -42,11 +43,13 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
42
43
|
return _this.addressDateInstance.getNameByCode(suffix);
|
|
43
44
|
}).join("");
|
|
44
45
|
var hasValue = addressText || detail || name || mobile;
|
|
45
|
-
var value = hasValue ?
|
|
46
|
+
var value = hasValue ? "".concat(addressText).concat(detail, " ").concat(name, " ").concat(mobile) : "";
|
|
46
47
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
47
48
|
id: _this.id,
|
|
48
49
|
label: _this.name,
|
|
49
|
-
value:
|
|
50
|
+
value: /*#__PURE__*/React.createElement(CopyText, {
|
|
51
|
+
text: value
|
|
52
|
+
})
|
|
50
53
|
}) : null;
|
|
51
54
|
});
|
|
52
55
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
@@ -63,7 +66,9 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
63
66
|
var addressText = (_ref2 = [province, city, district]) === null || _ref2 === void 0 ? void 0 : _ref2.map(function (suffix) {
|
|
64
67
|
return _this.addressDateInstance.getNameByCode(suffix);
|
|
65
68
|
}).join("");
|
|
66
|
-
return /*#__PURE__*/React.createElement(
|
|
69
|
+
return /*#__PURE__*/React.createElement(CopyText, {
|
|
70
|
+
text: "".concat(addressText).concat(detail, " ").concat(name, " ").concat(mobile)
|
|
71
|
+
});
|
|
67
72
|
});
|
|
68
73
|
_defineProperty(this, "renderLog", function (r) {
|
|
69
74
|
var _ref3;
|
|
@@ -87,9 +92,9 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
87
92
|
province: r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptProvince")],
|
|
88
93
|
city: r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptCity")],
|
|
89
94
|
district: r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptDistrict")],
|
|
90
|
-
detail: (r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptDetail")]) ||
|
|
91
|
-
name: (r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptReceiverName")]) ||
|
|
92
|
-
mobile: (r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptReceiverMobile")]) ||
|
|
95
|
+
detail: (r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptDetail")]) || "",
|
|
96
|
+
name: (r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptReceiverName")]) || "",
|
|
97
|
+
mobile: (r === null || r === void 0 ? void 0 : r["".concat(_this.originId, "_interceptReceiverMobile")]) || ""
|
|
93
98
|
};
|
|
94
99
|
});
|
|
95
100
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
@@ -118,7 +123,7 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
118
123
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
119
124
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
120
125
|
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,
|
|
121
|
-
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 :
|
|
126
|
+
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 : "",
|
|
122
127
|
component: /*#__PURE__*/React.createElement(ApaasInput, _this.componentConfig)
|
|
123
128
|
});
|
|
124
129
|
});
|
|
@@ -137,7 +142,7 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
137
142
|
this.originId = options.id;
|
|
138
143
|
this.isCombinationComponent = false;
|
|
139
144
|
this.canSort = true;
|
|
140
|
-
this.dataType =
|
|
145
|
+
this.dataType = "object";
|
|
141
146
|
this.children = [];
|
|
142
147
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
143
148
|
this.addressDateInstance = AddressData.getInstance();
|
|
@@ -30,7 +30,7 @@ var ColumnHeader = function ColumnHeader(_ref) {
|
|
|
30
30
|
return setVisible(false);
|
|
31
31
|
},
|
|
32
32
|
footer: null
|
|
33
|
-
}, /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u516C\u53F8\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u516C\u53F8\u540D\u79F0"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u5355\u53F7\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u5355\u53F7"), /*#__PURE__*/React.createElement("p", null, "\u62E6\u622A\u7C7B\u578B\uFF1A\u672C\u6B21\u62E6\u622A\u6240\u8981\u505A\u7684\u52A8\u4F5C\u662F\u4EC0\u4E48\uFF1B\u4F8B\u5982\uFF1A\u662F\u9000\u56DE\u8FD8\u662F\u8F6C\u5BC4"), /*#__PURE__*/React.createElement("div", null, "\u6D3E\u9001\u5730\u5740\uFF1A"), /*#__PURE__*/React.createElement("div", null, "\u4E2D\u901A/\u987A\u4E30\uFF1A\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u8F6C\u5BC4\u7684\u8BDD\uFF0C\u9700\u8981\u586B\u5199\u65B0\u7684\u6D3E\u9001\u5730\u5740\uFF1B\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u9000\u56DE\u5219\u4E0D\u9700\u8981"), /*#__PURE__*/React.createElement("p", null, "\u6781\u5154\uFF1A\u65E0\u8BBA\u54EA\u79CD\u7C7B\u578B\u90FD\u9700\u8981\u586B\u5199\u6D3E\u9001\u5730\u5740"), /*#__PURE__*/React.createElement("p", null, "\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF1A\u5982\u679C\u7269\u6D41\u516C\u53F8\u4E3A\u987A\u4E30\uFF0C\u5219\u9700\u8981\u586B\u5199\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF0C\u7528\u6765\u67E5\u8BE2 \u7269\u6D41\u8F68\u8FF9"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u72B6\u6001\uFF1A\u62E6\u622A\u5F53\u524D\u8FD9\u4E2A\u7269\u6D41\u5355\u53F7\u7684\u7269\u6D41\u8F68\u8FF9\u72B6\u6001\uFF08", /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
}, /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u516C\u53F8\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u516C\u53F8\u540D\u79F0"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u5355\u53F7\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u5355\u53F7"), /*#__PURE__*/React.createElement("p", null, "\u62E6\u622A\u7C7B\u578B\uFF1A\u672C\u6B21\u62E6\u622A\u6240\u8981\u505A\u7684\u52A8\u4F5C\u662F\u4EC0\u4E48\uFF1B\u4F8B\u5982\uFF1A\u662F\u9000\u56DE\u8FD8\u662F\u8F6C\u5BC4"), /*#__PURE__*/React.createElement("div", null, "\u6D3E\u9001\u5730\u5740\uFF1A\u672C\u6B21\u62E6\u622A\u6240\u8981\u4FEE\u6539\u7684\u6D3E\u9001\u5730\u5740"), /*#__PURE__*/React.createElement("div", null, "\u4E2D\u901A/\u987A\u4E30\uFF1A\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u8F6C\u5BC4\u7684\u8BDD\uFF0C\u9700\u8981\u586B\u5199\u65B0\u7684\u6D3E\u9001\u5730\u5740\uFF1B\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u9000\u56DE\u5219\u4E0D\u9700\u8981"), /*#__PURE__*/React.createElement("p", null, "\u6781\u5154\uFF1A\u65E0\u8BBA\u54EA\u79CD\u7C7B\u578B\u90FD\u9700\u8981\u586B\u5199\u6D3E\u9001\u5730\u5740"), /*#__PURE__*/React.createElement("p", null, "\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF1A\u5982\u679C\u7269\u6D41\u516C\u53F8\u4E3A\u987A\u4E30\uFF0C\u5219\u9700\u8981\u586B\u5199\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF0C\u7528\u6765\u67E5\u8BE2 \u7269\u6D41\u8F68\u8FF9"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u72B6\u6001\uFF1A\u62E6\u622A\u5F53\u524D\u8FD9\u4E2A\u7269\u6D41\u5355\u53F7\u7684\u7269\u6D41\u8F68\u8FF9\u72B6\u6001\uFF08", /*#__PURE__*/React.createElement("span", {
|
|
34
34
|
style: {
|
|
35
35
|
color: "#ff4d4f"
|
|
36
36
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ALignType, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { AddressData } from
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
4
4
|
declare class PaymentTid implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
6
6
|
id: string;
|
|
7
7
|
sortField: string;
|
|
8
8
|
type: string;
|
|
9
9
|
rules: any[];
|
|
10
|
-
componentConfig: ComponentInterface[
|
|
11
|
-
effects: ComponentInterface[
|
|
10
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
11
|
+
effects: ComponentInterface["effects"];
|
|
12
12
|
align: ALignType;
|
|
13
13
|
width: number;
|
|
14
14
|
isCombinationComponent: boolean;
|
|
@@ -17,7 +17,7 @@ declare class PaymentTid implements ComponentInterface {
|
|
|
17
17
|
children: ComponentInterface[];
|
|
18
18
|
originId: string;
|
|
19
19
|
addressDateInstance: InstanceType<typeof AddressData>;
|
|
20
|
-
dataType: ComponentInterface[
|
|
20
|
+
dataType: ComponentInterface["dataType"];
|
|
21
21
|
constructor(options: PickOption);
|
|
22
22
|
renderAddress: (record: any) => React.JSX.Element;
|
|
23
23
|
renderClient: () => null;
|
|
@@ -5,9 +5,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
5
5
|
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; }
|
|
6
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
7
|
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); }
|
|
8
|
-
import React from
|
|
9
|
-
import { isNull } from
|
|
10
|
-
import { AddressData } from
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
10
|
+
import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
11
11
|
var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
12
12
|
var _this = this;
|
|
13
13
|
_classCallCheck(this, PaymentTid);
|
|
@@ -33,7 +33,7 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
33
33
|
var _item$interceptAddres;
|
|
34
34
|
var addressText = (_item$interceptAddres = item.interceptAddress) === null || _item$interceptAddres === void 0 ? void 0 : _item$interceptAddres.map(function (suffix) {
|
|
35
35
|
return _this.addressDateInstance.getNameByCode(suffix);
|
|
36
|
-
}).join(
|
|
36
|
+
}).join("");
|
|
37
37
|
return /*#__PURE__*/React.createElement("div", null, "\u5305\u88F9".concat(index + 1, ":"), addressText || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, addressText, item.interceptDetail, item.interceptReceiverName, item.interceptReceiverMobile) : "--");
|
|
38
38
|
}));
|
|
39
39
|
});
|
|
@@ -52,15 +52,15 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
52
52
|
});
|
|
53
53
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
54
54
|
var logisticsInterceptList = record["".concat(_this.originId, "_logisticsInterceptList")] || [];
|
|
55
|
-
console.log(
|
|
55
|
+
console.log("renderExport", record["".concat(_this.originId, "_logisticsInterceptList")]);
|
|
56
56
|
return logisticsInterceptList.reduce(function (prv, item) {
|
|
57
57
|
var _item$interceptAddres2;
|
|
58
58
|
var addressText = (_item$interceptAddres2 = item.interceptAddress) === null || _item$interceptAddres2 === void 0 ? void 0 : _item$interceptAddres2.map(function (suffix) {
|
|
59
59
|
return _this.addressDateInstance.getNameByCode(suffix);
|
|
60
|
-
}).join(
|
|
61
|
-
prv.push("".concat(addressText).concat(item.interceptDetail ||
|
|
60
|
+
}).join("");
|
|
61
|
+
prv.push("".concat(addressText).concat(item.interceptDetail || "", "\n ").concat((item === null || item === void 0 ? void 0 : item.interceptReceiverName) || "", "\n ").concat((item === null || item === void 0 ? void 0 : item.interceptReceiverMobile) || ""));
|
|
62
62
|
return prv;
|
|
63
|
-
}, []).join(
|
|
63
|
+
}, []).join(",");
|
|
64
64
|
});
|
|
65
65
|
_defineProperty(this, "editRender", function () {
|
|
66
66
|
return null;
|
|
@@ -68,19 +68,19 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
68
68
|
_defineProperty(this, "filterConfig", function () {
|
|
69
69
|
return [];
|
|
70
70
|
});
|
|
71
|
-
this.name =
|
|
71
|
+
this.name = "派送地址";
|
|
72
72
|
this.id = "".concat(options.id);
|
|
73
73
|
this.sortField = "".concat(options.id);
|
|
74
74
|
this.formField = "".concat(options.id);
|
|
75
75
|
this.type = options.type;
|
|
76
76
|
this.componentConfig = options.componentConfig;
|
|
77
77
|
this.rules = [];
|
|
78
|
-
this.align =
|
|
78
|
+
this.align = "left";
|
|
79
79
|
this.width = 350;
|
|
80
80
|
this.originId = options.id;
|
|
81
81
|
this.isCombinationComponent = false;
|
|
82
82
|
this.canSort = false;
|
|
83
|
-
this.dataType =
|
|
83
|
+
this.dataType = "object";
|
|
84
84
|
this.children = [];
|
|
85
85
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
86
86
|
this.addressDateInstance = AddressData.getInstance();
|
|
@@ -30,7 +30,7 @@ var ColumnHeader = function ColumnHeader(_ref) {
|
|
|
30
30
|
return setVisible(false);
|
|
31
31
|
},
|
|
32
32
|
footer: null
|
|
33
|
-
}, /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u516C\u53F8\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u516C\u53F8\u540D\u79F0"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u5355\u53F7\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u5355\u53F7"), /*#__PURE__*/React.createElement("p", null, "\u62E6\u622A\u7C7B\u578B\uFF1A\u672C\u6B21\u62E6\u622A\u6240\u8981\u505A\u7684\u52A8\u4F5C\u662F\u4EC0\u4E48\uFF1B\u4F8B\u5982\uFF1A\u662F\u9000\u56DE\u8FD8\u662F\u8F6C\u5BC4"), /*#__PURE__*/React.createElement("div", null, "\u6D3E\u9001\u5730\u5740\uFF1A"), /*#__PURE__*/React.createElement("div", null, "\u4E2D\u901A/\u987A\u4E30\uFF1A\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u8F6C\u5BC4\u7684\u8BDD\uFF0C\u9700\u8981\u586B\u5199\u65B0\u7684\u6D3E\u9001\u5730\u5740\uFF1B\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u9000\u56DE\u5219\u4E0D\u9700\u8981"), /*#__PURE__*/React.createElement("p", null, "\u6781\u5154\uFF1A\u65E0\u8BBA\u54EA\u79CD\u7C7B\u578B\u90FD\u9700\u8981\u586B\u5199\u6D3E\u9001\u5730\u5740"), /*#__PURE__*/React.createElement("p", null, "\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF1A\u5982\u679C\u7269\u6D41\u516C\u53F8\u4E3A\u987A\u4E30\uFF0C\u5219\u9700\u8981\u586B\u5199\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF0C\u7528\u6765\u67E5\u8BE2 \u7269\u6D41\u8F68\u8FF9"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u72B6\u6001\uFF1A\u62E6\u622A\u5F53\u524D\u8FD9\u4E2A\u7269\u6D41\u5355\u53F7\u7684\u7269\u6D41\u8F68\u8FF9\u72B6\u6001\uFF08", /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
}, /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u516C\u53F8\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u516C\u53F8\u540D\u79F0"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u5355\u53F7\uFF1A\u672C\u6B21\u5DE5\u5355\u9700\u8981\u62E6\u622A\u7684\u7269\u6D41\u5355\u53F7"), /*#__PURE__*/React.createElement("p", null, "\u62E6\u622A\u7C7B\u578B\uFF1A\u672C\u6B21\u62E6\u622A\u6240\u8981\u505A\u7684\u52A8\u4F5C\u662F\u4EC0\u4E48\uFF1B\u4F8B\u5982\uFF1A\u662F\u9000\u56DE\u8FD8\u662F\u8F6C\u5BC4"), /*#__PURE__*/React.createElement("div", null, "\u6D3E\u9001\u5730\u5740\uFF1A\u672C\u6B21\u62E6\u622A\u6240\u8981\u4FEE\u6539\u7684\u6D3E\u9001\u5730\u5740"), /*#__PURE__*/React.createElement("div", null, "\u4E2D\u901A/\u987A\u4E30\uFF1A\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u8F6C\u5BC4\u7684\u8BDD\uFF0C\u9700\u8981\u586B\u5199\u65B0\u7684\u6D3E\u9001\u5730\u5740\uFF1B\u5982\u679C\u62E6\u622A\u7C7B\u578B\u4E3A\u9000\u56DE\u5219\u4E0D\u9700\u8981"), /*#__PURE__*/React.createElement("p", null, "\u6781\u5154\uFF1A\u65E0\u8BBA\u54EA\u79CD\u7C7B\u578B\u90FD\u9700\u8981\u586B\u5199\u6D3E\u9001\u5730\u5740"), /*#__PURE__*/React.createElement("p", null, "\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF1A\u5982\u679C\u7269\u6D41\u516C\u53F8\u4E3A\u987A\u4E30\uFF0C\u5219\u9700\u8981\u586B\u5199\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7\uFF0C\u7528\u6765\u67E5\u8BE2 \u7269\u6D41\u8F68\u8FF9"), /*#__PURE__*/React.createElement("p", null, "\u7269\u6D41\u72B6\u6001\uFF1A\u62E6\u622A\u5F53\u524D\u8FD9\u4E2A\u7269\u6D41\u5355\u53F7\u7684\u7269\u6D41\u8F68\u8FF9\u72B6\u6001\uFF08", /*#__PURE__*/React.createElement("span", {
|
|
34
34
|
style: {
|
|
35
35
|
color: "#ff4d4f"
|
|
36
36
|
}
|
|
@@ -73,7 +73,9 @@ function Logistics(options) {
|
|
|
73
73
|
}).join("");
|
|
74
74
|
return /*#__PURE__*/React.createElement("div", null, list.length > 1 ? "\u5305\u88F9".concat(index + 1, ":") : "", item.interceptCompany ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u516C\u53F8\uFF1A", _this.expressDateInstance.getExpressNameByCode(item.interceptCompany) || item.interceptCompany) : null, item.interceptCode ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u5355\u53F7\uFF1A", /*#__PURE__*/React.createElement(CopyText, {
|
|
75
75
|
text: item.interceptCode
|
|
76
|
-
})) : null, (_item$interceptAddres = item.interceptAddress) !== null && _item$interceptAddres !== void 0 && _item$interceptAddres.length || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, "\u6D3E\u4EF6\u4FE1\u606F\uFF1A",
|
|
76
|
+
})) : null, (_item$interceptAddres = item.interceptAddress) !== null && _item$interceptAddres !== void 0 && _item$interceptAddres.length || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, "\u6D3E\u4EF6\u4FE1\u606F\uFF1A", /*#__PURE__*/React.createElement(CopyText, {
|
|
77
|
+
text: "".concat(addressText, "\n ").concat(item.interceptDetail, " ").concat(item.interceptReceiverName, "\n ").concat(item.interceptReceiverMobile)
|
|
78
|
+
})) : null, item.interceptType ? /*#__PURE__*/React.createElement("div", null, "\u62E6\u622A\u7C7B\u578B\uFF1A", _this.expressInterceptInstance.getTypeNameMap()[item.interceptType]) : null, item.interceptLogisticsStatus ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u72B6\u6001\uFF1A", (_this$expressIntercep = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep === void 0 ? void 0 : _this$expressIntercep[item.interceptLogisticsStatus], /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
|
|
77
79
|
modelWidth: 500,
|
|
78
80
|
interceptCompany: item.interceptCompany,
|
|
79
81
|
interceptCode: item.interceptCode,
|
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, 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 | JstSendGood | MsgStatus | BasicPosting | AsyncSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | SubForm | CommonDataTime | TradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder |
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => BsGoods | BuyerNick | JstSendGood | MsgStatus | BasicPosting | AsyncSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | SubForm | CommonDataTime | TradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsE3Goods | PublicGoods | 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 | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | KmVideo | 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.
|
|
3
|
+
"version": "2.0.75",
|
|
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.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "2.0.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "2.0.75",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "2.0.75",
|
|
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": "8a0ed6b8116ac64f521ac9472d5e979e8ba73c18",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var react_redux_1 = require("react-redux");
|
|
6
|
-
var toolkit_1 = require("@reduxjs/toolkit");
|
|
7
|
-
var getTemplate = function getTemplate(companyUserConfig) {
|
|
8
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
9
|
-
return JSON.stringify({
|
|
10
|
-
hasWln: (_c = (_b = (_a = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _a === void 0 ? void 0 : _a.wln) === null || _b === void 0 ? void 0 : _b.show) !== null && _c !== void 0 ? _c : false,
|
|
11
|
-
hasWdt: (_f = (_e = (_d = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _d === void 0 ? void 0 : _d.wdt) === null || _e === void 0 ? void 0 : _e.show) !== null && _f !== void 0 ? _f : false,
|
|
12
|
-
hasBs: (_j = (_h = (_g = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _g === void 0 ? void 0 : _g.bs) === null || _h === void 0 ? void 0 : _h.show) !== null && _j !== void 0 ? _j : false,
|
|
13
|
-
hasE3: (_m = (_l = (_k = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _k === void 0 ? void 0 : _k.bse3) === null || _l === void 0 ? void 0 : _l.show) !== null && _m !== void 0 ? _m : false,
|
|
14
|
-
hasJst: (_q = (_p = (_o = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _o === void 0 ? void 0 : _o.jst) === null || _p === void 0 ? void 0 : _p.show) !== null && _q !== void 0 ? _q : false,
|
|
15
|
-
hasGy: (_t = (_s = (_r = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _r === void 0 ? void 0 : _r.gy) === null || _s === void 0 ? void 0 : _s.show) !== null && _t !== void 0 ? _t : false
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
function useGetHasErpData() {
|
|
19
|
-
var companyUserConfig = react_redux_1.useSelector(toolkit_1.createSelector([function (state) {
|
|
20
|
-
var _a, _b, _c, _d;
|
|
21
|
-
console.log("state--useSelector", state);
|
|
22
|
-
/**
|
|
23
|
-
* pc main
|
|
24
|
-
* 端 workOrder
|
|
25
|
-
* **/
|
|
26
|
-
return (_d = (_b = (_a = state === null || state === void 0 ? void 0 : state.main) === null || _a === void 0 ? void 0 : _a.userInfo) !== null && _b !== void 0 ? _b : (_c = state === null || state === void 0 ? void 0 : state.workOrder) === null || _c === void 0 ? void 0 : _c.userInfo) !== null && _d !== void 0 ? _d : {};
|
|
27
|
-
}], function (state) {
|
|
28
|
-
var _a;
|
|
29
|
-
var companyUserConfig = (_a = state === null || state === void 0 ? void 0 : state.companyUserConfig) !== null && _a !== void 0 ? _a : {};
|
|
30
|
-
if (typeof companyUserConfig === "string") {
|
|
31
|
-
try {
|
|
32
|
-
companyUserConfig = JSON.parse(companyUserConfig);
|
|
33
|
-
} catch (e) {
|
|
34
|
-
console.error("companyUserConfig转换异常", companyUserConfig);
|
|
35
|
-
companyUserConfig = {};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return companyUserConfig;
|
|
39
|
-
}));
|
|
40
|
-
var _a = react_1.useState(getTemplate({})),
|
|
41
|
-
hasErpDataJson = _a[0],
|
|
42
|
-
setHasErpDataJson = _a[1];
|
|
43
|
-
react_1.useEffect(function () {
|
|
44
|
-
setHasErpDataJson(getTemplate(companyUserConfig));
|
|
45
|
-
console.log("companyUserConfig---", companyUserConfig);
|
|
46
|
-
}, [companyUserConfig]);
|
|
47
|
-
var hasErpData = react_1.useMemo(function () {
|
|
48
|
-
return JSON.parse(hasErpDataJson);
|
|
49
|
-
}, [hasErpDataJson]);
|
|
50
|
-
return hasErpData;
|
|
51
|
-
}
|
|
52
|
-
exports["default"] = useGetHasErpData;
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) {
|
|
5
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
6
|
-
resolve(value);
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) {
|
|
11
|
-
try {
|
|
12
|
-
step(generator.next(value));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
reject(e);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function rejected(value) {
|
|
18
|
-
try {
|
|
19
|
-
step(generator["throw"](value));
|
|
20
|
-
} catch (e) {
|
|
21
|
-
reject(e);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function step(result) {
|
|
25
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
|
-
}
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var __generator = this && this.__generator || function (thisArg, body) {
|
|
31
|
-
var _ = {
|
|
32
|
-
label: 0,
|
|
33
|
-
sent: function sent() {
|
|
34
|
-
if (t[0] & 1) throw t[1];
|
|
35
|
-
return t[1];
|
|
36
|
-
},
|
|
37
|
-
trys: [],
|
|
38
|
-
ops: []
|
|
39
|
-
},
|
|
40
|
-
f,
|
|
41
|
-
y,
|
|
42
|
-
t,
|
|
43
|
-
g;
|
|
44
|
-
return g = {
|
|
45
|
-
next: verb(0),
|
|
46
|
-
"throw": verb(1),
|
|
47
|
-
"return": verb(2)
|
|
48
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
49
|
-
return this;
|
|
50
|
-
}), g;
|
|
51
|
-
function verb(n) {
|
|
52
|
-
return function (v) {
|
|
53
|
-
return step([n, v]);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function step(op) {
|
|
57
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
58
|
-
while (_) try {
|
|
59
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
60
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
61
|
-
switch (op[0]) {
|
|
62
|
-
case 0:
|
|
63
|
-
case 1:
|
|
64
|
-
t = op;
|
|
65
|
-
break;
|
|
66
|
-
case 4:
|
|
67
|
-
_.label++;
|
|
68
|
-
return {
|
|
69
|
-
value: op[1],
|
|
70
|
-
done: false
|
|
71
|
-
};
|
|
72
|
-
case 5:
|
|
73
|
-
_.label++;
|
|
74
|
-
y = op[1];
|
|
75
|
-
op = [0];
|
|
76
|
-
continue;
|
|
77
|
-
case 7:
|
|
78
|
-
op = _.ops.pop();
|
|
79
|
-
_.trys.pop();
|
|
80
|
-
continue;
|
|
81
|
-
default:
|
|
82
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
83
|
-
_ = 0;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
87
|
-
_.label = op[1];
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
91
|
-
_.label = t[1];
|
|
92
|
-
t = op;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
if (t && _.label < t[2]) {
|
|
96
|
-
_.label = t[2];
|
|
97
|
-
_.ops.push(op);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
if (t[2]) _.ops.pop();
|
|
101
|
-
_.trys.pop();
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
op = body.call(thisArg, _);
|
|
105
|
-
} catch (e) {
|
|
106
|
-
op = [6, e];
|
|
107
|
-
y = 0;
|
|
108
|
-
} finally {
|
|
109
|
-
f = t = 0;
|
|
110
|
-
}
|
|
111
|
-
if (op[0] & 5) throw op[1];
|
|
112
|
-
return {
|
|
113
|
-
value: op[0] ? op[1] : void 0,
|
|
114
|
-
done: true
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
exports.__esModule = true;
|
|
119
|
-
var react_1 = require("react");
|
|
120
|
-
var useGetHasErpData_1 = require("../hook/useGetHasErpData");
|
|
121
|
-
var ahooks_1 = require("ahooks");
|
|
122
|
-
var kmkf_utils_1 = require("@kmkf-fe-packages/kmkf-utils");
|
|
123
|
-
function useGetErpAddressData(notJudgedErp) {
|
|
124
|
-
var _this = this;
|
|
125
|
-
var _a = react_1.useState("loading"),
|
|
126
|
-
globalState = _a[0],
|
|
127
|
-
setGlobalState = _a[1];
|
|
128
|
-
var hasErpData = useGetHasErpData_1["default"]();
|
|
129
|
-
ahooks_1.useUpdateEffect(function () {
|
|
130
|
-
asyncQueryData(hasErpData, notJudgedErp);
|
|
131
|
-
}, [hasErpData, notJudgedErp]);
|
|
132
|
-
var asyncQueryData = function asyncQueryData(hasErpData, notJudgedErp) {
|
|
133
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
134
|
-
var hasBs, hasWdt, hasGy, promises, e_1;
|
|
135
|
-
return __generator(this, function (_a) {
|
|
136
|
-
switch (_a.label) {
|
|
137
|
-
case 0:
|
|
138
|
-
hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy;
|
|
139
|
-
promises = [];
|
|
140
|
-
if (hasBs || notJudgedErp) promises.push(kmkf_utils_1.servers.queryBsAddressData);
|
|
141
|
-
if (hasWdt || notJudgedErp) promises.push(kmkf_utils_1.servers.queryWdtAddressData);
|
|
142
|
-
if (hasGy || notJudgedErp) promises.push(kmkf_utils_1.servers.queryGyAddressData);
|
|
143
|
-
_a.label = 1;
|
|
144
|
-
case 1:
|
|
145
|
-
_a.trys.push([1, 3,, 4]);
|
|
146
|
-
return [4 /*yield*/, Promise.all(promises.map(function (promise) {
|
|
147
|
-
return promise();
|
|
148
|
-
}))];
|
|
149
|
-
case 2:
|
|
150
|
-
_a.sent();
|
|
151
|
-
setGlobalState("success");
|
|
152
|
-
return [3 /*break*/, 4];
|
|
153
|
-
case 3:
|
|
154
|
-
e_1 = _a.sent();
|
|
155
|
-
setGlobalState("failed");
|
|
156
|
-
return [3 /*break*/, 4];
|
|
157
|
-
case 4:
|
|
158
|
-
return [2 /*return*/];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
var onReload = function onReload() {
|
|
165
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
166
|
-
return __generator(this, function (_a) {
|
|
167
|
-
switch (_a.label) {
|
|
168
|
-
case 0:
|
|
169
|
-
return [4 /*yield*/, asyncQueryData(hasErpData, notJudgedErp)];
|
|
170
|
-
case 1:
|
|
171
|
-
_a.sent();
|
|
172
|
-
return [2 /*return*/];
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
return [globalState, onReload];
|
|
179
|
-
}
|
|
180
|
-
exports["default"] = useGetErpAddressData;
|