@kmkf-fe-packages/services-components 1.6.0-beta.8 → 1.6.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.
- package/README.md +1 -3
- package/dist/esm/commonComponents/GlobalContext/index.d.ts +1 -1
- package/dist/esm/commonComponents/GlobalContext/index.js +1 -1
- package/dist/esm/components/Common/index.js +3 -5
- package/dist/esm/components/MsgStatus/index.js +1 -3
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +4 -5
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/type.d.ts +18 -22
- package/package.json +6 -6
- package/dist/esm/components/SubForm/index.d.ts +0 -34
- package/dist/esm/components/SubForm/index.js +0 -189
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "
|
|
2
|
+
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryLabel" | "queryWdtLogisticsCompany" | "queryWdtSendData";
|
|
3
3
|
declare const Global: ({ children, requestList, repeatRequestList }: React.PropsWithChildren<{
|
|
4
4
|
requestList?: RequestType[] | undefined;
|
|
5
5
|
repeatRequestList?: Record<string, () => Promise<any>> | undefined;
|
|
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import React, { useEffect, useState } from "react";
|
|
17
17
|
import { Skeleton, Result, Button } from "antd";
|
|
18
|
-
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData,
|
|
18
|
+
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany, queryWdtLogisticsCompany, queryWdtSendData } from "../../service/api";
|
|
19
19
|
import { servers } from '@kmkf-fe-packages/kmkf-utils';
|
|
20
20
|
var Global = function Global(_ref) {
|
|
21
21
|
var children = _ref.children,
|
|
@@ -16,10 +16,10 @@ import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table, message, Ty
|
|
|
16
16
|
import React, { useState, useMemo } from "react";
|
|
17
17
|
import { ExpressData, WdtSendData } from "@kmkf-fe-packages/kmkf-utils";
|
|
18
18
|
import { getAlipayBillReceipt } from "../../service/api";
|
|
19
|
-
import { CopyToClipboard } from
|
|
20
|
-
import CopyText from "../../commonComponents/CopyText";
|
|
19
|
+
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
21
20
|
import styles from "./index.module.less";
|
|
22
21
|
import defaultImg from "./img/default-img.png";
|
|
22
|
+
import CopyText from "../../commonComponents/CopyText";
|
|
23
23
|
var Paragraph = Typography.Paragraph;
|
|
24
24
|
export var getFormItem = function getFormItem(_ref) {
|
|
25
25
|
var name = _ref.name,
|
|
@@ -1058,9 +1058,7 @@ export var MsgContent = function MsgContent(_ref14) {
|
|
|
1058
1058
|
wechat: '微信',
|
|
1059
1059
|
qq: 'QQ',
|
|
1060
1060
|
qywx: '企业微信',
|
|
1061
|
-
YZDKH: '
|
|
1062
|
-
YT: '圆通拦截',
|
|
1063
|
-
feishu: '飞书'
|
|
1061
|
+
YZDKH: '邮政大客户'
|
|
1064
1062
|
};
|
|
1065
1063
|
var detailContent = function detailContent(item) {
|
|
1066
1064
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting,
|
|
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, 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 | TradeId | BasicInput | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting |
|
|
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 | TradeId | BasicInput | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | 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 | CompletedUser | FlowWorkOrderId | StatusSelect | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | PaymentVoucherCode | Label | KmErpSendGood;
|
package/dist/esm/factory.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting,
|
|
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
3
|
CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, KmErpSendGood, AfterSalesOrderId } from "./index";
|
|
4
4
|
export var factory = function factory(type, options) {
|
|
@@ -48,8 +48,6 @@ export var factory = function factory(type, options) {
|
|
|
48
48
|
return new BasicFile(options);
|
|
49
49
|
case "POSTING":
|
|
50
50
|
return new BasicPosting(options);
|
|
51
|
-
case "SUBFORM":
|
|
52
|
-
return new SubForm(options);
|
|
53
51
|
case "SHOP_NAME_INPUT":
|
|
54
52
|
return new ShopName(options);
|
|
55
53
|
case "TRADE_ID_INPUT":
|
|
@@ -141,8 +139,6 @@ export var factory = function factory(type, options) {
|
|
|
141
139
|
return new BsPosting(options);
|
|
142
140
|
case "BS_GOODS":
|
|
143
141
|
return new BsGoods(options);
|
|
144
|
-
case "WDT_GOODS":
|
|
145
|
-
return new WdtGoods(options);
|
|
146
142
|
case "BS_EXCHANGE_GOODS":
|
|
147
143
|
return new BsExchange(options);
|
|
148
144
|
case "WDT_EXCHANGE_GOODS":
|
|
@@ -205,6 +201,9 @@ export var factory = function factory(type, options) {
|
|
|
205
201
|
return new CommonDataTime(options);
|
|
206
202
|
case "FLOW_UPDATE_DATETIME":
|
|
207
203
|
return new CommonDataTime(options);
|
|
204
|
+
case "WDT_GOODS":
|
|
205
|
+
// 万里牛商品
|
|
206
|
+
return new WdtGoods(options);
|
|
208
207
|
case "BUSINESS_ORDER_NO":
|
|
209
208
|
return new CommonInput(options);
|
|
210
209
|
case "PAYMENT_VOUCHER_CODE":
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export { default as BasicGrade } from "./components/Grade";
|
|
|
12
12
|
export { default as BasicRate } from "./components/Rate";
|
|
13
13
|
export { default as BasicFile } from "./components/File";
|
|
14
14
|
export { default as BasicPosting } from "./components/PostIng";
|
|
15
|
-
export { default as SubForm } from "./components/SubForm";
|
|
16
15
|
export { default as CommonDataTime } from "./components/CommonDataTime";
|
|
17
16
|
export { default as TradeId } from "./components/TradeId";
|
|
18
17
|
export { default as ErpTradeId } from "./components/ErpTradeId";
|
package/dist/esm/index.js
CHANGED
|
@@ -12,7 +12,6 @@ export { default as BasicGrade } from "./components/Grade";
|
|
|
12
12
|
export { default as BasicRate } from "./components/Rate";
|
|
13
13
|
export { default as BasicFile } from "./components/File";
|
|
14
14
|
export { default as BasicPosting } from "./components/PostIng";
|
|
15
|
-
export { default as SubForm } from "./components/SubForm";
|
|
16
15
|
export { default as CommonDataTime } from "./components/CommonDataTime";
|
|
17
16
|
export { default as TradeId } from "./components/TradeId";
|
|
18
17
|
export { default as ErpTradeId } from "./components/ErpTradeId";
|
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;
|
|
@@ -173,15 +173,11 @@ export interface ComponentInterface {
|
|
|
173
173
|
rulesOptions?: Array<any>;
|
|
174
174
|
selectRules?: Array<string>;
|
|
175
175
|
logistics?: string;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
nodeId?: string;
|
|
181
|
-
workOrderTemplateId?: string;
|
|
176
|
+
belongType?: string;
|
|
177
|
+
repeatConfig?: {
|
|
178
|
+
repeatRange: string;
|
|
179
|
+
repeatComponents: any[];
|
|
182
180
|
};
|
|
183
|
-
needFilterShopByPermission?: boolean;
|
|
184
|
-
tableHeader?: any;
|
|
185
181
|
};
|
|
186
182
|
effects?: {
|
|
187
183
|
queryWorkOrderDetail?: (r: Record) => void;
|
|
@@ -255,13 +251,13 @@ export interface ComponentInterface {
|
|
|
255
251
|
getComponentValue: (r: Record) => any;
|
|
256
252
|
formDataTransform?: (r: any) => any;
|
|
257
253
|
}
|
|
258
|
-
export declare type PickOption = Pick<ComponentInterface,
|
|
254
|
+
export declare type PickOption = Pick<ComponentInterface, 'name' | 'id' | 'type' | 'componentConfig' | 'effects' | 'columnHeader' | 'templateId' | 'workOrderUniqueKey' | 'platform' | 'parentName' | 'width' | 'flowTemplateKey'>;
|
|
259
255
|
export declare type ColumnConfig = {
|
|
260
256
|
id: string;
|
|
261
257
|
name: string;
|
|
262
258
|
type: string;
|
|
263
259
|
subKey?: string;
|
|
264
|
-
mode?:
|
|
265
|
-
config?: ComponentInterface[
|
|
266
|
-
templateConfig?: ComponentInterface[
|
|
260
|
+
mode?: 'multiple';
|
|
261
|
+
config?: ComponentInterface['componentConfig'];
|
|
262
|
+
templateConfig?: ComponentInterface['componentConfig'];
|
|
267
263
|
};
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
|
+
"sync": "yarn build && yalc push",
|
|
10
11
|
"build": "yarn run lint && father build",
|
|
11
12
|
"lint": "eslint '**/*.{ts,tsx}'",
|
|
12
|
-
"lint:fix": "eslint --fix '**/*.{ts,tsx}'"
|
|
13
|
-
"sync": "yarn build && yalc push"
|
|
13
|
+
"lint:fix": "eslint --fix '**/*.{ts,tsx}'"
|
|
14
14
|
},
|
|
15
15
|
"lint-staged": {
|
|
16
16
|
"*.{js,jsx,less,md,json}": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kmkf-fe-packages/basic-components": "1.6.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "1.6.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "1.6.1",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "1.6.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "6012d491910b54eb0ad306be7ddfc340ab2f5fa5",
|
|
42
42
|
"gitHooks": {
|
|
43
43
|
"pre-commit": "lint-staged"
|
|
44
44
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
|
-
import React from "react";
|
|
3
|
-
declare class SubForm implements ComponentInterface {
|
|
4
|
-
name: string;
|
|
5
|
-
id: string;
|
|
6
|
-
sortField: string;
|
|
7
|
-
type: string;
|
|
8
|
-
rules: any[];
|
|
9
|
-
componentConfig: ComponentInterface["componentConfig"];
|
|
10
|
-
isCombinationComponent: boolean;
|
|
11
|
-
formField: string;
|
|
12
|
-
canSort: boolean;
|
|
13
|
-
children: ComponentInterface[];
|
|
14
|
-
dataType: ComponentInterface["dataType"];
|
|
15
|
-
templateId?: string;
|
|
16
|
-
workOrderUniqueKey?: string;
|
|
17
|
-
constructor(options: PickOption);
|
|
18
|
-
getNewTableHeader: () => any;
|
|
19
|
-
renderTabel: (list: any) => React.JSX.Element;
|
|
20
|
-
renderPc: () => null;
|
|
21
|
-
renderLog: (r: Record) => React.JSX.Element | null;
|
|
22
|
-
getComponentValue: (r: Record) => any;
|
|
23
|
-
renderExport: () => null;
|
|
24
|
-
renderClient: (record: Record) => React.JSX.Element | null;
|
|
25
|
-
editRender: (p: any) => React.JSX.Element;
|
|
26
|
-
filterConfig: (item: ColumnConfig) => {
|
|
27
|
-
searchDefaultConditions: "like";
|
|
28
|
-
type: string;
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
filterComponentType: "Input";
|
|
32
|
-
}[];
|
|
33
|
-
}
|
|
34
|
-
export default SubForm;
|
|
@@ -1,189 +0,0 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
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."); }
|
|
4
|
-
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); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
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; }
|
|
8
|
-
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; }
|
|
9
|
-
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; }
|
|
10
|
-
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); } }
|
|
11
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
-
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; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
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); }
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { Table } from "antd";
|
|
18
|
-
import { SubForm as SubFormComponent } from "@kmkf-fe-packages/basic-components";
|
|
19
|
-
import Input from "../Input";
|
|
20
|
-
import TextArea from "../TextArea";
|
|
21
|
-
import BsHeaderChild from "../BS/common/BsHeaderChild";
|
|
22
|
-
import GetFormItem from "../GetFormItem";
|
|
23
|
-
import ItemView from "../../commonComponents/ItemView";
|
|
24
|
-
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
25
|
-
import { SYMBOL } from "../../constant";
|
|
26
|
-
var WidgetMap = {
|
|
27
|
-
INPUT: Input,
|
|
28
|
-
TEXTAREA: TextArea
|
|
29
|
-
};
|
|
30
|
-
var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
|
|
31
|
-
var _this = this,
|
|
32
|
-
_this$componentConfig9;
|
|
33
|
-
_classCallCheck(this, SubForm);
|
|
34
|
-
_defineProperty(this, "name", void 0);
|
|
35
|
-
_defineProperty(this, "id", void 0);
|
|
36
|
-
_defineProperty(this, "sortField", void 0);
|
|
37
|
-
_defineProperty(this, "type", void 0);
|
|
38
|
-
_defineProperty(this, "rules", void 0);
|
|
39
|
-
_defineProperty(this, "componentConfig", void 0);
|
|
40
|
-
_defineProperty(this, "isCombinationComponent", void 0);
|
|
41
|
-
_defineProperty(this, "formField", void 0);
|
|
42
|
-
_defineProperty(this, "canSort", void 0);
|
|
43
|
-
_defineProperty(this, "children", void 0);
|
|
44
|
-
_defineProperty(this, "dataType", void 0);
|
|
45
|
-
_defineProperty(this, "templateId", void 0);
|
|
46
|
-
_defineProperty(this, "workOrderUniqueKey", void 0);
|
|
47
|
-
_defineProperty(this, "getNewTableHeader", function () {
|
|
48
|
-
var _this$componentConfig, _this$componentConfig2, _this$componentConfig3;
|
|
49
|
-
return (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : (_this$componentConfig2 = _this$componentConfig.subConfig) === null || _this$componentConfig2 === void 0 ? void 0 : (_this$componentConfig3 = _this$componentConfig2.correlationList) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.map(function (item) {
|
|
50
|
-
var _this$componentConfig4;
|
|
51
|
-
var t = ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tableHeader.find(function (v) {
|
|
52
|
-
return v.key === item.key;
|
|
53
|
-
})) || {
|
|
54
|
-
isShow: true,
|
|
55
|
-
isEdit: false,
|
|
56
|
-
isRequired: false,
|
|
57
|
-
isNumber: false,
|
|
58
|
-
precision: "nolimit",
|
|
59
|
-
width: 150
|
|
60
|
-
};
|
|
61
|
-
return _objectSpread(_objectSpread({}, item), t);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
_defineProperty(this, "renderTabel", function (list) {
|
|
65
|
-
var _ref, _ref$filter;
|
|
66
|
-
var columns = [{
|
|
67
|
-
dataIndex: "",
|
|
68
|
-
title: "序号",
|
|
69
|
-
align: "center",
|
|
70
|
-
ellipsis: true,
|
|
71
|
-
width: 50,
|
|
72
|
-
render: function render(val, record, index) {
|
|
73
|
-
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
74
|
-
}
|
|
75
|
-
}].concat(_toConsumableArray(((_ref = _this.getNewTableHeader() || []) === null || _ref === void 0 ? void 0 : (_ref$filter = _ref.filter(function (t) {
|
|
76
|
-
return t.isShow;
|
|
77
|
-
})) === null || _ref$filter === void 0 ? void 0 : _ref$filter.map(function (item) {
|
|
78
|
-
return {
|
|
79
|
-
dataIndex: item.key,
|
|
80
|
-
title: item.name,
|
|
81
|
-
align: "center",
|
|
82
|
-
ellipsis: true,
|
|
83
|
-
width: item.width,
|
|
84
|
-
render: function render(val) {
|
|
85
|
-
return /*#__PURE__*/React.createElement("span", null, val);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
})) || []));
|
|
89
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
90
|
-
columns: columns,
|
|
91
|
-
dataSource: list,
|
|
92
|
-
rowKey: "uuid",
|
|
93
|
-
size: "small",
|
|
94
|
-
pagination: false,
|
|
95
|
-
scroll: {
|
|
96
|
-
x: "100%"
|
|
97
|
-
},
|
|
98
|
-
locale: {
|
|
99
|
-
emptyText: "暂无数据"
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
_defineProperty(this, "renderPc", function () {
|
|
104
|
-
return null;
|
|
105
|
-
});
|
|
106
|
-
_defineProperty(this, "renderLog", function (r) {
|
|
107
|
-
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_productList")])) return null;
|
|
108
|
-
return _this.renderTabel(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_productList")]);
|
|
109
|
-
});
|
|
110
|
-
_defineProperty(this, "getComponentValue", function (r) {
|
|
111
|
-
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_productList")];
|
|
112
|
-
});
|
|
113
|
-
_defineProperty(this, "renderExport", function () {
|
|
114
|
-
return null;
|
|
115
|
-
});
|
|
116
|
-
_defineProperty(this, "renderClient", function (record) {
|
|
117
|
-
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
118
|
-
id: _this.id,
|
|
119
|
-
label: _this.name,
|
|
120
|
-
value: _this.renderTabel(record === null || record === void 0 ? void 0 : record["".concat(_this.id)])
|
|
121
|
-
}) : null;
|
|
122
|
-
});
|
|
123
|
-
_defineProperty(this, "editRender", function (p) {
|
|
124
|
-
var _this$componentConfig5, _this$componentConfig6, _this$componentConfig7, _this$componentConfig8;
|
|
125
|
-
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
126
|
-
title: _this.name,
|
|
127
|
-
name: _this.id,
|
|
128
|
-
rules: _this.rules,
|
|
129
|
-
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
130
|
-
display: p === null || p === void 0 ? void 0 : p.display,
|
|
131
|
-
required: (_this$componentConfig5 = (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required) !== null && _this$componentConfig5 !== void 0 ? _this$componentConfig5 : false,
|
|
132
|
-
tooltip: (_this$componentConfig7 = (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.tooltip) !== null && _this$componentConfig7 !== void 0 ? _this$componentConfig7 : "",
|
|
133
|
-
component: /*#__PURE__*/React.createElement(SubFormComponent, _this.componentConfig)
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
_defineProperty(this, "filterConfig", function (item) {
|
|
137
|
-
return [{
|
|
138
|
-
searchDefaultConditions: SYMBOL.like,
|
|
139
|
-
type: item.type,
|
|
140
|
-
id: "".concat(item.id, "_productList"),
|
|
141
|
-
// 过滤组件id
|
|
142
|
-
name: item.name,
|
|
143
|
-
// 过滤组件名称
|
|
144
|
-
filterComponentType: "Input"
|
|
145
|
-
}];
|
|
146
|
-
});
|
|
147
|
-
this.name = options.name;
|
|
148
|
-
this.id = options.id;
|
|
149
|
-
this.sortField = "".concat(options.id, "_productList");
|
|
150
|
-
this.formField = "".concat(options.id, "_productList");
|
|
151
|
-
this.type = options.type;
|
|
152
|
-
this.templateId = options.templateId;
|
|
153
|
-
this.componentConfig = options.componentConfig;
|
|
154
|
-
this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
|
|
155
|
-
this.rules = [{
|
|
156
|
-
required: (_this$componentConfig9 = this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.required,
|
|
157
|
-
validator: function validator(_, value) {
|
|
158
|
-
var _this$componentConfig10, _this$componentConfig11;
|
|
159
|
-
var result = (_this$componentConfig10 = _this.componentConfig) === null || _this$componentConfig10 === void 0 ? void 0 : (_this$componentConfig11 = _this$componentConfig10.tableHeader) === null || _this$componentConfig11 === void 0 ? void 0 : _this$componentConfig11.reduce(function (prv, next) {
|
|
160
|
-
if (next.isRequired && next.isShow && !next.isEdit) {
|
|
161
|
-
prv[next.key] = "".concat(next.name, "\u4E0D\u80FD\u4E3A\u7A7A");
|
|
162
|
-
}
|
|
163
|
-
return prv;
|
|
164
|
-
}, {});
|
|
165
|
-
var msg = (value || []).reduce(function (prv, next) {
|
|
166
|
-
Object.keys(next).forEach(function (key) {
|
|
167
|
-
if (result[key] && !next[key]) {
|
|
168
|
-
prv = result[key];
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
return prv;
|
|
172
|
-
}, "");
|
|
173
|
-
if (msg) {
|
|
174
|
-
return Promise.reject(new Error(msg));
|
|
175
|
-
}
|
|
176
|
-
return Promise.resolve();
|
|
177
|
-
}
|
|
178
|
-
}];
|
|
179
|
-
this.isCombinationComponent = true;
|
|
180
|
-
this.canSort = false;
|
|
181
|
-
this.children = (this.getNewTableHeader() || []).map(function (item) {
|
|
182
|
-
return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
|
|
183
|
-
name: item.name,
|
|
184
|
-
id: "".concat(options.id, "_productList_").concat(item.key)
|
|
185
|
-
}));
|
|
186
|
-
});
|
|
187
|
-
this.dataType = "object";
|
|
188
|
-
});
|
|
189
|
-
export default SubForm;
|