@kmkf-fe-packages/services-components 1.6.0-beta.3 → 1.6.0-beta.4
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.
|
@@ -5,8 +5,8 @@ declare class Handler implements ComponentInterface {
|
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
|
-
componentConfig: ComponentInterface[
|
|
9
|
-
effects: ComponentInterface[
|
|
8
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
9
|
+
effects: ComponentInterface['effects'];
|
|
10
10
|
isCombinationComponent: boolean;
|
|
11
11
|
formField: string;
|
|
12
12
|
canSort: boolean;
|
|
@@ -14,6 +14,10 @@ declare class Handler implements ComponentInterface {
|
|
|
14
14
|
dataType: ComponentInterface['dataType'];
|
|
15
15
|
options: ComponentInterface['options'];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
|
+
newOptions: () => {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
17
21
|
renderPc: (v: unknown, record: Record) => React.JSX.Element;
|
|
18
22
|
renderLog: () => null;
|
|
19
23
|
getComponentValue: (r: Record) => any;
|
|
@@ -35,6 +39,7 @@ declare class Handler implements ComponentInterface {
|
|
|
35
39
|
}[];
|
|
36
40
|
};
|
|
37
41
|
filterFn: (value: string) => (i: Record) => boolean;
|
|
42
|
+
formatFilterValue: (value: any) => any;
|
|
38
43
|
};
|
|
39
44
|
}
|
|
40
45
|
export default Handler;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
5
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
6
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
2
14
|
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
15
|
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
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -11,7 +23,7 @@ import { filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
|
11
23
|
import { SYMBOL } from "../../constant";
|
|
12
24
|
var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
13
25
|
var _this = this,
|
|
14
|
-
_this$
|
|
26
|
+
_this$effects4;
|
|
15
27
|
_classCallCheck(this, Handler);
|
|
16
28
|
_defineProperty(this, "name", void 0);
|
|
17
29
|
_defineProperty(this, "id", void 0);
|
|
@@ -25,6 +37,15 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
25
37
|
_defineProperty(this, "children", void 0);
|
|
26
38
|
_defineProperty(this, "dataType", void 0);
|
|
27
39
|
_defineProperty(this, "options", void 0);
|
|
40
|
+
_defineProperty(this, "newOptions", function () {
|
|
41
|
+
var _this$effects, _this$effects2;
|
|
42
|
+
var groupList = (((_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.groupList) || []).map(function (item) {
|
|
43
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
44
|
+
value: "".concat(item.value, ":group")
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
return [].concat(_toConsumableArray(groupList), _toConsumableArray(((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.userList) || []));
|
|
48
|
+
});
|
|
28
49
|
_defineProperty(this, "renderPc", function (v, record) {
|
|
29
50
|
var _value$map$join, _value$map;
|
|
30
51
|
var value = record === null || record === void 0 ? void 0 : record[_this.id];
|
|
@@ -52,7 +73,6 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
52
73
|
return null;
|
|
53
74
|
});
|
|
54
75
|
_defineProperty(this, "filterConfig", function (item) {
|
|
55
|
-
var _this$effects;
|
|
56
76
|
return {
|
|
57
77
|
searchDefaultConditions: SYMBOL.in,
|
|
58
78
|
type: item.type,
|
|
@@ -62,7 +82,7 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
62
82
|
// 过滤组件名称
|
|
63
83
|
filterComponentType: 'MultipleSelect',
|
|
64
84
|
props: {
|
|
65
|
-
options:
|
|
85
|
+
options: _this.newOptions() || []
|
|
66
86
|
},
|
|
67
87
|
filterFn: function filterFn(value) {
|
|
68
88
|
return function (i) {
|
|
@@ -71,19 +91,39 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
71
91
|
return item === null || item === void 0 ? void 0 : item.account;
|
|
72
92
|
})).length > 0;
|
|
73
93
|
};
|
|
94
|
+
},
|
|
95
|
+
formatFilterValue: function formatFilterValue(value) {
|
|
96
|
+
return value.reduce(function (prv, next) {
|
|
97
|
+
var _next$split = next.split(':'),
|
|
98
|
+
_next$split2 = _slicedToArray(_next$split, 2),
|
|
99
|
+
val = _next$split2[0],
|
|
100
|
+
groupText = _next$split2[1];
|
|
101
|
+
if (groupText) {
|
|
102
|
+
var _this$effects3, _this$effects3$groupL;
|
|
103
|
+
var groupItem = (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : (_this$effects3$groupL = _this$effects3.groupList) === null || _this$effects3$groupL === void 0 ? void 0 : _this$effects3$groupL.find(function (item) {
|
|
104
|
+
return item.value === val;
|
|
105
|
+
});
|
|
106
|
+
groupItem && prv.push.apply(prv, _toConsumableArray(groupItem.relationUserList.map(function (t) {
|
|
107
|
+
return t.userKey;
|
|
108
|
+
})));
|
|
109
|
+
} else {
|
|
110
|
+
prv.push(next);
|
|
111
|
+
}
|
|
112
|
+
return prv;
|
|
113
|
+
}, []);
|
|
74
114
|
}
|
|
75
115
|
};
|
|
76
116
|
});
|
|
77
|
-
this.name = (options === null || options === void 0 ? void 0 : options.name) ||
|
|
78
|
-
this.id = (options === null || options === void 0 ? void 0 : options.id) ||
|
|
79
|
-
this.sortField =
|
|
80
|
-
this.formField =
|
|
81
|
-
this.type =
|
|
117
|
+
this.name = (options === null || options === void 0 ? void 0 : options.name) || '处理人';
|
|
118
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || 'handlerList';
|
|
119
|
+
this.sortField = 'handlerList';
|
|
120
|
+
this.formField = 'handlerList';
|
|
121
|
+
this.type = 'HANDLER_INPUT';
|
|
82
122
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
83
123
|
this.isCombinationComponent = false;
|
|
84
124
|
this.canSort = false;
|
|
85
125
|
this.children = [];
|
|
86
126
|
this.dataType = 'string';
|
|
87
|
-
this.options = ((_this$
|
|
127
|
+
this.options = ((_this$effects4 = this.effects) === null || _this$effects4 === void 0 ? void 0 : _this$effects4.userList) || [];
|
|
88
128
|
});
|
|
89
129
|
export default Handler;
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, 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, KmErpSendGood, AfterSalesOrderId } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | AfterSalesOrderId | AliPay | BsExchange | BsGoods | BsLogistics | BsPosting | BsReissue | BsReturn | BsSystemOrder | BuyerNick | Calculation | BasicCascader | BasicCheckbox | CommonInput | CommonMultiStatus | CommonSystemOrder | BasicDataTime | ItemEnCode | ItemId | ItemSelect |
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | AfterSalesOrderId | AliPay | BsExchange | BsGoods | BsLogistics | BsPosting | BsReissue | BsReturn | BsSystemOrder | BuyerNick | Calculation | BasicCascader | BasicCheckbox | CommonDataTime | CommonInput | CommonMultiStatus | CommonSystemOrder | CompletedUser | BasicDataTime | ItemEnCode | ItemId | ItemSelect | BasicInput | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | TradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ERemark | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | FlowWorkOrderId | StatusSelect | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | PaymentVoucherCode | Label | KmErpSendGood;
|
package/dist/esm/type.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FormInstance } from
|
|
3
|
-
import { SYMBOL } from
|
|
4
|
-
export declare type DataType =
|
|
5
|
-
export declare type ALignType =
|
|
2
|
+
import type { FormInstance } from 'antd';
|
|
3
|
+
import { SYMBOL } from './constant';
|
|
4
|
+
export declare type DataType = 'string' | 'number' | 'array' | 'dateArray' | 'date' | 'tradeId';
|
|
5
|
+
export declare type ALignType = 'left' | 'right' | 'center';
|
|
6
6
|
export declare type QuerySymbol = keyof typeof SYMBOL;
|
|
7
7
|
export declare type Record = {
|
|
8
8
|
[props in string]: any;
|
|
@@ -27,7 +27,7 @@ export declare type FilterConfigType = {
|
|
|
27
27
|
filterFn?: (p: any) => (r: Record) => unknown;
|
|
28
28
|
formatFilterValue?: (p: any) => any;
|
|
29
29
|
};
|
|
30
|
-
export declare type FilterComponentType =
|
|
30
|
+
export declare type FilterComponentType = 'MultipleSelect' | 'Input' | 'Date' | 'Cascader' | 'ShopList' | 'Rate' | 'SelectInput';
|
|
31
31
|
export interface ComponentInterface {
|
|
32
32
|
id: string;
|
|
33
33
|
sortField: string;
|
|
@@ -47,8 +47,8 @@ export interface ComponentInterface {
|
|
|
47
47
|
rules?: any[];
|
|
48
48
|
width?: number;
|
|
49
49
|
align?: ALignType;
|
|
50
|
-
dataType:
|
|
51
|
-
format?:
|
|
50
|
+
dataType: 'string' | 'number' | 'boolean' | 'array' | 'range' | 'object';
|
|
51
|
+
format?: 'dateTime' | 'date' | 'time' | 'cascader' | 'shopInput' | 'staffGroup';
|
|
52
52
|
options?: Array<any>;
|
|
53
53
|
templateId?: string;
|
|
54
54
|
flowTemplateKey?: string;
|
|
@@ -84,7 +84,7 @@ export interface ComponentInterface {
|
|
|
84
84
|
/**
|
|
85
85
|
* @description 显示字段名称
|
|
86
86
|
*/
|
|
87
|
-
showField?:
|
|
87
|
+
showField?: 'EXPRESS_COMPANY' | 'EXPRESS_WAYBILL_CODE' | 'EXPRESS_SNAPSHOT' | 'all' | 'bs' | 'workOrder' | 'logisticsCompany' | 'logisticsCode';
|
|
88
88
|
/**
|
|
89
89
|
* @description 是否选择SKU
|
|
90
90
|
*/
|
|
@@ -104,7 +104,7 @@ export interface ComponentInterface {
|
|
|
104
104
|
/**
|
|
105
105
|
* @description 备注状态
|
|
106
106
|
*/
|
|
107
|
-
associatedType?:
|
|
107
|
+
associatedType?: 'APPEND';
|
|
108
108
|
isAssociated?: boolean;
|
|
109
109
|
isShowFlag?: boolean;
|
|
110
110
|
/**
|
|
@@ -145,7 +145,7 @@ export interface ComponentInterface {
|
|
|
145
145
|
* @description 时间初始值
|
|
146
146
|
*/
|
|
147
147
|
dateTime?: string;
|
|
148
|
-
dateType?:
|
|
148
|
+
dateType?: 'DATE' | 'DATE_TIME' | 'DATE_RANGE' | 'DATE_TIME_RANGE';
|
|
149
149
|
maxSize?: number;
|
|
150
150
|
basicGrade?: number;
|
|
151
151
|
range?: number;
|
|
@@ -199,6 +199,11 @@ export interface ComponentInterface {
|
|
|
199
199
|
label: string;
|
|
200
200
|
value: string;
|
|
201
201
|
}[];
|
|
202
|
+
groupList?: {
|
|
203
|
+
label: string;
|
|
204
|
+
value: string;
|
|
205
|
+
[key: string]: any;
|
|
206
|
+
}[];
|
|
202
207
|
tbAppKey?: string;
|
|
203
208
|
companyKey?: string;
|
|
204
209
|
env?: PlatForm;
|
|
@@ -253,13 +258,13 @@ export interface ComponentInterface {
|
|
|
253
258
|
getComponentValue: (r: Record) => any;
|
|
254
259
|
formDataTransform?: (r: any) => any;
|
|
255
260
|
}
|
|
256
|
-
export declare type PickOption = Pick<ComponentInterface,
|
|
261
|
+
export declare type PickOption = Pick<ComponentInterface, 'name' | 'id' | 'type' | 'componentConfig' | 'effects' | 'columnHeader' | 'templateId' | 'workOrderUniqueKey' | 'platform' | 'parentName' | 'width' | 'flowTemplateKey'>;
|
|
257
262
|
export declare type ColumnConfig = {
|
|
258
263
|
id: string;
|
|
259
264
|
name: string;
|
|
260
265
|
type: string;
|
|
261
266
|
subKey?: string;
|
|
262
|
-
mode?:
|
|
263
|
-
config?: ComponentInterface[
|
|
264
|
-
templateConfig?: ComponentInterface[
|
|
267
|
+
mode?: 'multiple';
|
|
268
|
+
config?: ComponentInterface['componentConfig'];
|
|
269
|
+
templateConfig?: ComponentInterface['componentConfig'];
|
|
265
270
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.4",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "57177ce07a6fb96596050e26373817a82b5bb4fc",
|
|
42
42
|
"gitHooks": {
|
|
43
43
|
"pre-commit": "lint-staged"
|
|
44
44
|
}
|