@kmkf-fe-packages/services-components 1.0.4 → 1.0.5-rc.1

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.
@@ -0,0 +1,28 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
2
+ import React from "react";
3
+ import { LabelData } from "@kmkf-fe-packages/kmkf-utils";
4
+ declare class Label implements ComponentInterface {
5
+ name: string;
6
+ id: string;
7
+ sortField: string;
8
+ type: string;
9
+ rules: any[];
10
+ componentConfig: ComponentInterface["componentConfig"];
11
+ isCombinationComponent: boolean;
12
+ formField: string;
13
+ canSort: boolean;
14
+ children: ComponentInterface[];
15
+ dataType: ComponentInterface["dataType"];
16
+ options: ComponentInterface["options"];
17
+ labelDateInstance: InstanceType<typeof LabelData>;
18
+ constructor(options: PickOption);
19
+ getComponentValue: (r: Record) => any;
20
+ editRender: (p: any) => React.JSX.Element;
21
+ renderClient: (record: any) => React.JSX.Element | null;
22
+ showDetail: (value: Array<string>) => React.JSX.Element;
23
+ renderPc: (value: any, record: Record) => React.JSX.Element;
24
+ renderLog: (r: Record) => React.JSX.Element;
25
+ renderExport: (value: any, record: Record) => any;
26
+ filterConfig: (item: ColumnConfig) => never[];
27
+ }
28
+ export default Label;
@@ -0,0 +1,132 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
+ import React from "react";
10
+ import { Tag, Select, Space } from 'antd';
11
+ import { LabelData, isNull } from "@kmkf-fe-packages/kmkf-utils";
12
+ import GetFormItem from "../GetFormItem";
13
+ import ItemView from "../../commonComponents/ItemView";
14
+ var EditRenderItem = function EditRenderItem(props) {
15
+ var tagRender = function tagRender(prop) {
16
+ var _props$options, _props$options$find;
17
+ var label = prop.label,
18
+ closable = prop.closable,
19
+ onClose = prop.onClose,
20
+ value = prop.value;
21
+ var color = props === null || props === void 0 ? void 0 : (_props$options = props.options) === null || _props$options === void 0 ? void 0 : (_props$options$find = _props$options.find(function (item) {
22
+ return item.value === value;
23
+ })) === null || _props$options$find === void 0 ? void 0 : _props$options$find.color;
24
+ var onPreventMouseDown = function onPreventMouseDown(event) {
25
+ event.preventDefault();
26
+ event.stopPropagation();
27
+ };
28
+ return /*#__PURE__*/React.createElement(Tag, {
29
+ color: color,
30
+ onMouseDown: onPreventMouseDown,
31
+ closable: closable,
32
+ onClose: onClose,
33
+ style: {
34
+ marginRight: 3
35
+ }
36
+ }, label);
37
+ };
38
+ return /*#__PURE__*/React.createElement(Select, _extends({}, props, {
39
+ mode: "multiple",
40
+ showArrow: true,
41
+ tagRender: tagRender
42
+ }));
43
+ };
44
+ var Label = /*#__PURE__*/_createClass(function Label(options) {
45
+ var _this = this,
46
+ _this$componentConfig3;
47
+ _classCallCheck(this, Label);
48
+ _defineProperty(this, "name", void 0);
49
+ _defineProperty(this, "id", void 0);
50
+ _defineProperty(this, "sortField", void 0);
51
+ _defineProperty(this, "type", void 0);
52
+ _defineProperty(this, "rules", void 0);
53
+ _defineProperty(this, "componentConfig", void 0);
54
+ _defineProperty(this, "isCombinationComponent", void 0);
55
+ _defineProperty(this, "formField", void 0);
56
+ _defineProperty(this, "canSort", void 0);
57
+ _defineProperty(this, "children", void 0);
58
+ _defineProperty(this, "dataType", void 0);
59
+ _defineProperty(this, "options", void 0);
60
+ _defineProperty(this, "labelDateInstance", void 0);
61
+ _defineProperty(this, "getComponentValue", function (r) {
62
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_label")];
63
+ });
64
+ _defineProperty(this, "editRender", function (p) {
65
+ var _this$componentConfig, _this$componentConfig2;
66
+ return /*#__PURE__*/React.createElement(GetFormItem, {
67
+ title: _this.name,
68
+ name: _this.id,
69
+ rules: _this.rules,
70
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
71
+ display: p === null || p === void 0 ? void 0 : p.display,
72
+ 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,
73
+ component: /*#__PURE__*/React.createElement(EditRenderItem, _extends({}, _this.componentConfig, {
74
+ placeholder: "\u7CFB\u7EDF\u81EA\u52A8\u751F\u6210",
75
+ showSearch: true,
76
+ onChange: p === null || p === void 0 ? void 0 : p.onChange,
77
+ options: _this.labelDateInstance.labelData,
78
+ optionFilterProp: "label"
79
+ }))
80
+ });
81
+ });
82
+ _defineProperty(this, "renderClient", function (record) {
83
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
84
+ id: _this.id,
85
+ label: _this.name,
86
+ value: _this.showDetail(record === null || record === void 0 ? void 0 : record["".concat(_this.id)])
87
+ }) : null;
88
+ });
89
+ _defineProperty(this, "showDetail", function (value) {
90
+ return /*#__PURE__*/React.createElement(Space, {
91
+ style: {
92
+ flexWrap: 'wrap'
93
+ }
94
+ }, Array.isArray(value) ? value === null || value === void 0 ? void 0 : value.map(function (v) {
95
+ var _this$labelDateInstan;
96
+ var label = ((_this$labelDateInstan = _this.labelDateInstance.labelData) === null || _this$labelDateInstan === void 0 ? void 0 : _this$labelDateInstan.find(function (item) {
97
+ return item.value === v;
98
+ })) || {};
99
+ if (!isNull(label)) return /*#__PURE__*/React.createElement(Tag, {
100
+ color: label === null || label === void 0 ? void 0 : label.color
101
+ }, label === null || label === void 0 ? void 0 : label.label);
102
+ return null;
103
+ }) : "--");
104
+ });
105
+ _defineProperty(this, "renderPc", function (value, record) {
106
+ return _this.showDetail(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_label")]);
107
+ });
108
+ _defineProperty(this, "renderLog", function (r) {
109
+ return _this.renderPc(undefined, r);
110
+ });
111
+ _defineProperty(this, "renderExport", function (value, record) {
112
+ var _record;
113
+ return record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id, "_label")]) === null || _record === void 0 ? void 0 : _record.join('、');
114
+ });
115
+ _defineProperty(this, "filterConfig", function (item) {
116
+ return [];
117
+ });
118
+ this.name = options.name;
119
+ this.id = options.id;
120
+ this.sortField = options.id;
121
+ this.formField = options.id;
122
+ this.type = options.type;
123
+ this.componentConfig = options.componentConfig;
124
+ this.rules = [];
125
+ this.isCombinationComponent = false;
126
+ this.canSort = false;
127
+ this.children = [];
128
+ this.dataType = "array";
129
+ this.options = ((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.options) || [];
130
+ this.labelDateInstance = LabelData.getInstance();
131
+ });
132
+ export default Label;
@@ -0,0 +1,58 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
+ import React from "react";
3
+ import { BsType, BsMemo, BsHeaderGood, SystemOrderNo } from "../../BS/common/index";
4
+ import CommonHeaderGoods from "../../CommonHeaderGood";
5
+ declare class WdtReissue implements ComponentInterface {
6
+ name: string;
7
+ id: string;
8
+ sortField: string;
9
+ type: string;
10
+ rules: any[];
11
+ componentConfig: ComponentInterface["componentConfig"];
12
+ effects: ComponentInterface["effects"];
13
+ isCombinationComponent: boolean;
14
+ formField: string;
15
+ canSort: boolean;
16
+ children: ComponentInterface[];
17
+ dataType: ComponentInterface["dataType"];
18
+ bsType: BsType;
19
+ bsMemo: BsMemo;
20
+ systemOrderNo: SystemOrderNo;
21
+ reissueGoods: BsHeaderGood | CommonHeaderGoods;
22
+ constructor(options: PickOption);
23
+ renderClient: (record: any) => React.JSX.Element | null;
24
+ renderPc: () => null;
25
+ renderLog: (r: Record) => React.JSX.Element;
26
+ getComponentValue: (r: Record) => {
27
+ [key: string]: any;
28
+ };
29
+ renderExport: () => null;
30
+ editRender: (p: any) => React.JSX.Element;
31
+ filterConfig: (item: ColumnConfig) => ({
32
+ searchDefaultConditions: "in";
33
+ type: string;
34
+ id: string;
35
+ name: string;
36
+ filterComponentType: "Cascader";
37
+ props: {
38
+ options: any[] | undefined;
39
+ fieldNames: {
40
+ label: string;
41
+ value: string;
42
+ children: string;
43
+ };
44
+ };
45
+ formatFilterValue: (val: Array<string>) => string[] | undefined;
46
+ filterFn: (value: string) => (i: Record) => boolean;
47
+ } | {
48
+ searchDefaultConditions: "like";
49
+ type: string;
50
+ id: string;
51
+ name: string;
52
+ filterComponentType: "Input";
53
+ props?: undefined;
54
+ formatFilterValue?: undefined;
55
+ filterFn?: undefined;
56
+ })[];
57
+ }
58
+ export default WdtReissue;
@@ -0,0 +1,191 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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 "react";
12
+ import GetFormItem from "../../GetFormItem";
13
+ import ItemView from "../../../commonComponents/ItemView";
14
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
15
+ import { WdtReissue as Reissue } from "@kmkf-fe-packages/basic-components";
16
+ import { SYMBOL } from "../../../constant";
17
+ import { BsGoodsTable } from "../../Common/index";
18
+ import { BsType, BsMemo, BsHeaderGood, SystemOrderNo } from "../../BS/common/index";
19
+ import CommonHeaderGoods from "../../CommonHeaderGood";
20
+ var typeMap = {
21
+ WDT_REISSUE_GOODS: {
22
+ key: "wdtReissueGoods",
23
+ name: "旺店通",
24
+ typeName: "wdtReissueType",
25
+ remark: "wdtReissueType_memo",
26
+ systemOrderNo: "wdtSystemOrderNo",
27
+ errMsg: "请选择旺店通补发商品"
28
+ }
29
+ };
30
+ var WdtReissue = /*#__PURE__*/_createClass(function WdtReissue(options) {
31
+ var _this = this,
32
+ _typeMap$options$type,
33
+ _typeMap$options$type2,
34
+ _typeMap$options$type3,
35
+ _typeMap$options$type4,
36
+ _typeMap$options$type5,
37
+ _this$componentConfig4;
38
+ _classCallCheck(this, WdtReissue);
39
+ _defineProperty(this, "name", void 0);
40
+ _defineProperty(this, "id", void 0);
41
+ _defineProperty(this, "sortField", void 0);
42
+ _defineProperty(this, "type", void 0);
43
+ _defineProperty(this, "rules", void 0);
44
+ _defineProperty(this, "componentConfig", void 0);
45
+ _defineProperty(this, "effects", void 0);
46
+ _defineProperty(this, "isCombinationComponent", void 0);
47
+ _defineProperty(this, "formField", void 0);
48
+ _defineProperty(this, "canSort", void 0);
49
+ _defineProperty(this, "children", void 0);
50
+ _defineProperty(this, "dataType", void 0);
51
+ _defineProperty(this, "bsType", void 0);
52
+ _defineProperty(this, "bsMemo", void 0);
53
+ _defineProperty(this, "systemOrderNo", void 0);
54
+ _defineProperty(this, "reissueGoods", void 0);
55
+ _defineProperty(this, "renderClient", function (record) {
56
+ var _record, _typeMap$_this$type, _record2, _typeMap$_this$type2, _this$componentConfig;
57
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, _this.bsType.renderClient(record), _this.bsMemo.renderClient(record), _this.systemOrderNo.renderClient(record), record !== null && record !== void 0 && (_record = record["".concat(_this.id)]) !== null && _record !== void 0 && _record[(_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.key].length ? /*#__PURE__*/React.createElement(ItemView, {
58
+ id: _this.id,
59
+ label: _this.name,
60
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
61
+ list: (record === null || record === void 0 ? void 0 : (_record2 = record["".concat(_this.id)]) === null || _record2 === void 0 ? void 0 : _record2["".concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)]) || [],
62
+ showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || [],
63
+ type: _this.type
64
+ })
65
+ }) : null) : null;
66
+ });
67
+ _defineProperty(this, "renderPc", function () {
68
+ return null;
69
+ });
70
+ _defineProperty(this, "renderLog", function (r) {
71
+ var _r, _typeMap$_this$type3, _typeMap$_this$type4, _r2, _typeMap$_this$type5, _typeMap$_this$type6, _this$componentConfig2;
72
+ return /*#__PURE__*/React.createElement(React.Fragment, null, r !== null && r !== void 0 && (_r = r["".concat(_this.id, "_").concat((_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.typeName)]) !== null && _r !== void 0 && _r.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u7C7B\u578B:", _this.bsType.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u4FE1\u606F:", _this.bsMemo.renderLog(r))) : null, r !== null && r !== void 0 && r["".concat(_this.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.systemOrderNo)] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u7CFB\u7EDF\u8BA2\u5355\u53F7:", _this.systemOrderNo.renderLog(r))) : null, r !== null && r !== void 0 && (_r2 = r["".concat(_this.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.key)]) !== null && _r2 !== void 0 && _r2.length ? /*#__PURE__*/React.createElement("div", null, "\u8865\u53D1\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
73
+ list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key)]) || [],
74
+ showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || [],
75
+ type: _this.type
76
+ })) : null, r !== null && r !== void 0 && r["".concat(_this.id, "_shopCode")] ? /*#__PURE__*/React.createElement("div", null, "\u5E97\u94FAid:", r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_shopCode")]) : null);
77
+ });
78
+ _defineProperty(this, "getComponentValue", function (r) {
79
+ var _typeMap$_this$type7, _typeMap$_this$type8, _typeMap$_this$type9, _typeMap$_this$type10, _typeMap$_this$type11, _typeMap$_this$type12;
80
+ var obj = {};
81
+ obj["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.typeName)] = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.typeName)];
82
+ obj["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.key)] = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.key)];
83
+ obj["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$_this$type11 = typeMap[_this.type]) === null || _typeMap$_this$type11 === void 0 ? void 0 : _typeMap$_this$type11.systemOrderNo)] = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type12 = typeMap[_this.type]) === null || _typeMap$_this$type12 === void 0 ? void 0 : _typeMap$_this$type12.systemOrderNo)];
84
+ return obj;
85
+ });
86
+ _defineProperty(this, "renderExport", function () {
87
+ return null;
88
+ });
89
+ _defineProperty(this, "editRender", function (p) {
90
+ var _this$componentConfig3, _this$effects, _this$effects2, _this$effects3;
91
+ return /*#__PURE__*/React.createElement(GetFormItem, {
92
+ title: _this.name,
93
+ name: _this.id,
94
+ rules: _this.rules,
95
+ required: false,
96
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
97
+ display: p === null || p === void 0 ? void 0 : p.display,
98
+ component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
99
+ maxLength: ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.maxLength) || 20,
100
+ shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
101
+ shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
102
+ companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
103
+ width: "90%",
104
+ type: _this.type
105
+ }))
106
+ });
107
+ });
108
+ _defineProperty(this, "filterConfig", function (item) {
109
+ var _item$templateConfig;
110
+ return [{
111
+ searchDefaultConditions: SYMBOL.in,
112
+ type: item.type,
113
+ id: "".concat(item.id, "_").concat(typeMap[_this.type].typeName),
114
+ name: "".concat(item.name, "-\u8865\u53D1\u7C7B\u578B"),
115
+ filterComponentType: "Cascader",
116
+ props: {
117
+ options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
118
+ fieldNames: {
119
+ label: "label",
120
+ value: "value",
121
+ children: "children"
122
+ }
123
+ },
124
+ formatFilterValue: function formatFilterValue(val) {
125
+ if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
126
+ return [val[val.length - 1]];
127
+ }
128
+ },
129
+ filterFn: function filterFn(value) {
130
+ return function (i) {
131
+ var _typeMap$_this$type13;
132
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "".concat((_typeMap$_this$type13 = typeMap[_this.type]) === null || _typeMap$_this$type13 === void 0 ? void 0 : _typeMap$_this$type13.typeName)), value);
133
+ };
134
+ }
135
+ }, {
136
+ searchDefaultConditions: SYMBOL.like,
137
+ type: item.type,
138
+ id: "".concat(item.id, "_").concat(typeMap[_this.type].systemOrderNo),
139
+ name: "".concat(item.name, "-\u8865\u53D1\u7CFB\u7EDF\u8BA2\u5355\u53F7"),
140
+ filterComponentType: "Input"
141
+ }, {
142
+ searchDefaultConditions: SYMBOL.like,
143
+ type: item.type,
144
+ id: "".concat(item.id, "_").concat(typeMap[_this.type].key),
145
+ name: "".concat(_this.name),
146
+ filterComponentType: "Input"
147
+ }];
148
+ });
149
+ this.name = options.name;
150
+ this.id = options.id;
151
+ this.sortField = "".concat(options.id);
152
+ this.formField = "".concat(options.id);
153
+ this.type = options.type;
154
+ this.effects = options === null || options === void 0 ? void 0 : options.effects;
155
+ this.isCombinationComponent = true;
156
+ this.canSort = false;
157
+ this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
158
+ id: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.typeName),
159
+ name: "补发类型"
160
+ }));
161
+ this.systemOrderNo = new SystemOrderNo(_objectSpread(_objectSpread({}, options), {}, {
162
+ id: "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.systemOrderNo),
163
+ name: "补发系统订单号"
164
+ }));
165
+ this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
166
+ id: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.remark),
167
+ name: "补发备注"
168
+ }));
169
+ this.reissueGoods = this.type === "BS_REISSUE_GOODS" ? new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
170
+ id: "".concat(options.id, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.key),
171
+ name: "商品信息"
172
+ })) : new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
173
+ id: "".concat(options.id, "_").concat((_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.key),
174
+ name: "商品信息"
175
+ }));
176
+ this.children = [this.bsType, this.systemOrderNo, this.bsMemo, this.reissueGoods];
177
+ this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
178
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
179
+ required: true,
180
+ validator: function validator(_, value) {
181
+ var _value, _typeMap$options$type6;
182
+ if (!value || !(value !== null && value !== void 0 && (_value = value["".concat((_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.key)]) !== null && _value !== void 0 && _value.length)) {
183
+ var _typeMap$options$type7;
184
+ return Promise.reject(new Error("".concat((_typeMap$options$type7 = typeMap[options.type]) === null || _typeMap$options$type7 === void 0 ? void 0 : _typeMap$options$type7.errMsg)));
185
+ }
186
+ return Promise.resolve();
187
+ }
188
+ }] : [];
189
+ this.dataType = "object";
190
+ });
191
+ export default WdtReissue;
@@ -1,3 +1,3 @@
1
- import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, 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, CommonInput, PaymentVoucherCode } from "./index";
1
+ import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, 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, CommonInput, PaymentVoucherCode, WdtReissue, Label } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BsLogistics | BsReissue | JstLogistics | JstSendGood | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReturn | 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 | MsgStatus | WdtGoods | CommonInput | PaymentVoucherCode;
3
+ export declare const factory: (type: string, options: PickOption) => AliPay | BsLogistics | BsReissue | JstLogistics | JstSendGood | Label | LogisticsInterception | WdtReissue | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReturn | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | CommonInput | PaymentVoucherCode;
@@ -1,6 +1,6 @@
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, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect,
2
2
  // CommonTradeId,
3
- CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, CommonInput, PaymentVoucherCode } from "./index";
3
+ CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, CommonInput, PaymentVoucherCode, WdtReissue, Label } from "./index";
4
4
  export var factory = function factory(type, options) {
5
5
  var _options$componentCon;
6
6
  switch (type) {
@@ -139,11 +139,14 @@ export var factory = function factory(type, options) {
139
139
  return new BsPosting(options);
140
140
  case "BS_GOODS":
141
141
  return new BsGoods(options);
142
+ case "WDT_GOODS":
143
+ return new WdtGoods(options);
142
144
  case "BS_EXCHANGE_GOODS":
143
145
  return new BsExchange(options);
144
146
  case "BS_REISSUE_GOODS":
145
- case "WDT_REISSUE_GOODS":
146
147
  return new BsReissue(options);
148
+ case "WDT_REISSUE_GOODS":
149
+ return new WdtReissue(options);
147
150
  case "BS_RETURN_GOODS":
148
151
  return new BsReturn(options);
149
152
  case "REISSUE_TRADE_ID":
@@ -196,13 +199,12 @@ export var factory = function factory(type, options) {
196
199
  return new CommonDataTime(options);
197
200
  case "FLOW_UPDATE_DATETIME":
198
201
  return new CommonDataTime(options);
199
- case "WDT_GOODS":
200
- // 万里牛商品
201
- return new WdtGoods(options);
202
202
  case "BUSINESS_ORDER_NO":
203
203
  return new CommonInput(options);
204
204
  case "PAYMENT_VOUCHER_CODE":
205
205
  return new PaymentVoucherCode(options);
206
+ case "LABEL":
207
+ return new Label(options);
206
208
  default:
207
209
  return new BasicInput(options);
208
210
  }
@@ -70,12 +70,14 @@ export { default as HandlerDeadLine } from "./components/HandlerDeadLine";
70
70
  export { default as NodeStayDuration } from "./components/NodeStayDuration";
71
71
  export { default as WlnGoods } from "./components/WLN/WlnGoods";
72
72
  export { default as BsPosting } from "./components/BS/BsPosting";
73
- export { default as NodeInput } from "./components/NodeInput";
74
- export { default as FlowWorkOrderStatus } from "./components/FlowWorkOrderStatus";
75
- export { default as MsgStatus } from "./components/MsgStatus";
73
+ export { default as NodeInput } from './components/NodeInput';
74
+ export { default as FlowWorkOrderStatus } from './components/FlowWorkOrderStatus';
75
+ export { default as MsgStatus } from './components/MsgStatus';
76
76
  export { default as WdtGoods } from "./components/WDT/WdtGoods";
77
+ export { default as WdtReissue } from "./components/WDT/WdtRessuie";
77
78
  export { default as CommonInput } from "./components/CommonInput";
78
79
  export { default as PaymentVoucherCode } from "./components/PaymentVoucherCode";
80
+ export { default as Label } from "./components/Label";
79
81
  export { default as KmErpOrderNum } from "./components/ErpTradeId/components/OrderNum";
80
82
  export { factory } from "./factory";
81
83
  export { default as PlatformAvatar } from "./commonComponents/PlatformAvatar";
package/dist/esm/index.js CHANGED
@@ -74,8 +74,10 @@ export { default as NodeInput } from "./components/NodeInput";
74
74
  export { default as FlowWorkOrderStatus } from "./components/FlowWorkOrderStatus";
75
75
  export { default as MsgStatus } from "./components/MsgStatus";
76
76
  export { default as WdtGoods } from "./components/WDT/WdtGoods";
77
+ export { default as WdtReissue } from "./components/WDT/WdtRessuie";
77
78
  export { default as CommonInput } from "./components/CommonInput";
78
79
  export { default as PaymentVoucherCode } from "./components/PaymentVoucherCode";
80
+ export { default as Label } from "./components/Label";
79
81
  // TODO: ERP 打款工单使用
80
82
  export { default as KmErpOrderNum } from "./components/ErpTradeId/components/OrderNum";
81
83
  export { factory } from "./factory";
@@ -6,4 +6,7 @@ export declare const queryPlatData: () => Promise<void>;
6
6
  export declare const queryExpressInterceptData: () => Promise<void>;
7
7
  export declare const queryLogisticsAddressData: () => Promise<void>;
8
8
  export declare const queryAllLogisticsCompany: () => Promise<void>;
9
+ export declare const queryWdtLogisticsCompany: () => Promise<void>;
10
+ export declare const queryWdtSendData: () => Promise<void>;
9
11
  export declare const getAlipayBillReceipt: (data: any) => Promise<any>;
12
+ export declare const queryLabel: () => Promise<any>;
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
11
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
12
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
- import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData, WdtSendData, servers, WDT, LabelData } from "@kmkf-fe-packages/kmkf-utils";
14
14
  import get from "lodash/get";
15
15
  import request from "./request";
16
16
  // 重复校验
@@ -248,6 +248,18 @@ export var queryAllLogisticsCompany = function queryAllLogisticsCompany() {
248
248
  instance.expressData = expressList;
249
249
  });
250
250
  };
251
+ export var queryWdtLogisticsCompany = function queryWdtLogisticsCompany() {
252
+ var instance = ExpressData.getInstance('wdt');
253
+ return servers.getWdtSellerLogisticsCompanyRelation().then(function (data) {
254
+ instance.expressData = data;
255
+ }).catch(console.log);
256
+ };
257
+ export var queryWdtSendData = function queryWdtSendData() {
258
+ var instance = WdtSendData.getInstance();
259
+ return WDT.getWarehouseDataAsync().then(function (data) {
260
+ instance.wdtSendData = data;
261
+ }).catch(console.log);
262
+ };
251
263
  // 获取支付宝电子回单
252
264
  export var getAlipayBillReceipt = function getAlipayBillReceipt(data) {
253
265
  return request({
@@ -255,4 +267,23 @@ export var getAlipayBillReceipt = function getAlipayBillReceipt(data) {
255
267
  method: "post",
256
268
  data: data
257
269
  });
270
+ };
271
+ export var queryLabel = function queryLabel() {
272
+ return request({
273
+ url: "/qy/diamond/getConfigInfo",
274
+ method: "get",
275
+ data: {
276
+ key: 'RISK_WARING_LABEL_LIST'
277
+ }
278
+ }).then(function (res) {
279
+ var data = res.data;
280
+ var instance = LabelData.getInstance();
281
+ try {
282
+ var finalData = JSON.parse(data);
283
+ instance.labelData = finalData;
284
+ } catch (e) {
285
+ console.error('转换标签数据数据异常');
286
+ instance.labelData = [];
287
+ }
288
+ });
258
289
  };
@@ -53,6 +53,7 @@ export interface ComponentInterface {
53
53
  templateId?: string;
54
54
  workOrderUniqueKey?: string;
55
55
  platform?: PlatForm;
56
+ parentName?: string;
56
57
  /**
57
58
  * @description 组件下标
58
59
  * @deprecated 已弃用字段,后续版本不在使用
@@ -78,7 +79,7 @@ export interface ComponentInterface {
78
79
  /**
79
80
  * @description 显示字段名称
80
81
  */
81
- showField?: "EXPRESS_COMPANY" | "EXPRESS_WAYBILL_CODE" | "EXPRESS_SNAPSHOT" | "all" | "bs" | "workOrder";
82
+ showField?: "EXPRESS_COMPANY" | "EXPRESS_WAYBILL_CODE" | "EXPRESS_SNAPSHOT" | "all" | "bs" | "workOrder" | "logisticsCompany" | "logisticsCode";
82
83
  /**
83
84
  * @description 是否选择SKU
84
85
  */
@@ -166,6 +167,7 @@ export interface ComponentInterface {
166
167
  config?: any;
167
168
  rulesOptions?: Array<any>;
168
169
  selectRules?: Array<string>;
170
+ logistics?: string;
169
171
  };
170
172
  effects?: {
171
173
  queryWorkOrderDetail?: (r: Record) => void;
@@ -234,7 +236,7 @@ export interface ComponentInterface {
234
236
  getComponentValue: (r: Record) => any;
235
237
  formDataTransform?: (r: any) => any;
236
238
  }
237
- export declare type PickOption = Pick<ComponentInterface, "name" | "id" | "type" | "componentConfig" | "effects" | "columnHeader" | "templateId" | "workOrderUniqueKey" | "platform">;
239
+ export declare type PickOption = Pick<ComponentInterface, "name" | "id" | "type" | "componentConfig" | "effects" | "columnHeader" | "templateId" | "workOrderUniqueKey" | "platform" | "parentName" | "width">;
238
240
  export declare type ColumnConfig = {
239
241
  id: string;
240
242
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "1.0.4",
3
+ "version": "1.0.5-rc.1",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -20,8 +20,8 @@
20
20
  ]
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/basic-components": "^1.0.4",
24
- "@kmkf-fe-packages/kmkf-utils": "^1.0.4"
23
+ "@kmkf-fe-packages/basic-components": "^1.0.5-rc.1",
24
+ "@kmkf-fe-packages/kmkf-utils": "^1.0.5-rc.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@typescript-eslint/eslint-plugin": "^5.59.2",
@@ -37,7 +37,7 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "da6e92200086765ca3d63004ee1a8ebba88c8188",
40
+ "gitHead": "0a562034b4786ad102fd408e07be073dd1e9d616",
41
41
  "gitHooks": {
42
42
  "pre-commit": "lint-staged"
43
43
  }