@kmkf-fe-packages/services-components 2.0.74 → 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.
|
@@ -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;
|
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) =>
|
|
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
|
}
|