@kmkf-fe-packages/services-components 0.3.1-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/commonComponents/ItemView/index.d.ts +7 -0
- package/dist/esm/commonComponents/ItemView/index.js +15 -0
- package/dist/esm/commonComponents/ItemView/index.module.scss +20 -0
- package/dist/esm/commonComponents/PlatBuyer/index.d.ts +9 -0
- package/dist/esm/commonComponents/PlatBuyer/index.js +45 -0
- package/dist/esm/commonComponents/Wangwang/img/wang.gif +0 -0
- package/dist/esm/commonComponents/Wangwang/index.d.ts +7 -0
- package/dist/esm/commonComponents/Wangwang/index.js +31 -0
- package/dist/esm/components/ActualPayment/index.d.ts +27 -0
- package/dist/esm/components/ActualPayment/index.js +82 -0
- package/dist/esm/components/Address/index.d.ts +37 -0
- package/dist/esm/components/Address/index.js +112 -0
- package/dist/esm/components/Alipay/index.d.ts +36 -0
- package/dist/esm/components/Alipay/index.js +88 -0
- package/dist/esm/components/AlipayAccount/index.d.ts +31 -0
- package/dist/esm/components/AlipayAccount/index.js +90 -0
- package/dist/esm/components/AlipayName/index.d.ts +31 -0
- package/dist/esm/components/AlipayName/index.js +89 -0
- package/dist/esm/components/BuyerNick/index.d.ts +31 -0
- package/dist/esm/components/BuyerNick/index.js +103 -0
- package/dist/esm/components/Cascader/index.d.ts +45 -0
- package/dist/esm/components/Cascader/index.js +112 -0
- package/dist/esm/components/Checkbox/index.d.ts +31 -0
- package/dist/esm/components/Checkbox/index.js +102 -0
- package/dist/esm/components/Common/img/default-img.png +0 -0
- package/dist/esm/components/Common/index.d.ts +18 -0
- package/dist/esm/components/Common/index.js +223 -0
- package/dist/esm/components/Common/index.module.less +8 -0
- package/dist/esm/components/CommonDataTime/index.d.ts +30 -0
- package/dist/esm/components/CommonDataTime/index.js +79 -0
- package/dist/esm/components/DataTime/ApaasDate.d.ts +9 -0
- package/dist/esm/components/DataTime/ApaasDate.js +22 -0
- package/dist/esm/components/DataTime/index.d.ts +29 -0
- package/dist/esm/components/DataTime/index.js +103 -0
- package/dist/esm/components/EItemEnCode/ItemEncode.d.ts +3 -0
- package/dist/esm/components/EItemEnCode/ItemEncode.js +26 -0
- package/dist/esm/components/EItemEnCode/index.d.ts +27 -0
- package/dist/esm/components/EItemEnCode/index.js +109 -0
- package/dist/esm/components/EItemId/ItemId.d.ts +4 -0
- package/dist/esm/components/EItemId/ItemId.js +26 -0
- package/dist/esm/components/EItemId/index.d.ts +27 -0
- package/dist/esm/components/EItemId/index.js +110 -0
- package/dist/esm/components/EItemSelect/ItemSelect.d.ts +4 -0
- package/dist/esm/components/EItemSelect/ItemSelect.js +27 -0
- package/dist/esm/components/EItemSelect/index.d.ts +27 -0
- package/dist/esm/components/EItemSelect/index.js +92 -0
- package/dist/esm/components/ErpTradeId/index.d.ts +27 -0
- package/dist/esm/components/ErpTradeId/index.js +76 -0
- package/dist/esm/components/Express/index.d.ts +33 -0
- package/dist/esm/components/Express/index.js +94 -0
- package/dist/esm/components/ExpressCode/index.d.ts +30 -0
- package/dist/esm/components/ExpressCode/index.js +87 -0
- package/dist/esm/components/ExpressCompany/index.d.ts +3 -0
- package/dist/esm/components/ExpressCompany/index.js +20 -0
- package/dist/esm/components/FlowStatusSelect/index.d.ts +51 -0
- package/dist/esm/components/FlowStatusSelect/index.js +124 -0
- package/dist/esm/components/GetFormItem/index.d.ts +10 -0
- package/dist/esm/components/GetFormItem/index.js +28 -0
- package/dist/esm/components/Grade/index.d.ts +26 -0
- package/dist/esm/components/Grade/index.js +75 -0
- package/dist/esm/components/Input/index.d.ts +27 -0
- package/dist/esm/components/Input/index.js +84 -0
- package/dist/esm/components/JstItemSelect/index.d.ts +29 -0
- package/dist/esm/components/JstItemSelect/index.js +115 -0
- package/dist/esm/components/JstLogistics/index.d.ts +29 -0
- package/dist/esm/components/JstLogistics/index.js +107 -0
- package/dist/esm/components/JstSendGood/index.d.ts +27 -0
- package/dist/esm/components/JstSendGood/index.js +112 -0
- package/dist/esm/components/JstSupply/index.d.ts +27 -0
- package/dist/esm/components/JstSupply/index.js +113 -0
- package/dist/esm/components/Logistics/index.d.ts +44 -0
- package/dist/esm/components/Logistics/index.js +107 -0
- package/dist/esm/components/MultSelect/index.d.ts +27 -0
- package/dist/esm/components/MultSelect/index.js +84 -0
- package/dist/esm/components/Ordinary/OrdinaryHeader.d.ts +39 -0
- package/dist/esm/components/Ordinary/OrdinaryHeader.js +93 -0
- package/dist/esm/components/Ordinary/OrdinaryMoney.d.ts +39 -0
- package/dist/esm/components/Ordinary/OrdinaryMoney.js +93 -0
- package/dist/esm/components/Ordinary/OrdinarySerial.d.ts +39 -0
- package/dist/esm/components/Ordinary/OrdinarySerial.js +86 -0
- package/dist/esm/components/Ordinary/index.d.ts +46 -0
- package/dist/esm/components/Ordinary/index.js +90 -0
- package/dist/esm/components/OrdinaryHeader/index.d.ts +7 -0
- package/dist/esm/components/OrdinaryHeader/index.js +157 -0
- package/dist/esm/components/OrdinaryHeader/index.module.less +46 -0
- package/dist/esm/components/Payment/AlipayNick.d.ts +39 -0
- package/dist/esm/components/Payment/AlipayNick.js +94 -0
- package/dist/esm/components/Payment/AlipayNo.d.ts +38 -0
- package/dist/esm/components/Payment/AlipayNo.js +101 -0
- package/dist/esm/components/Payment/AlipayTime.d.ts +39 -0
- package/dist/esm/components/Payment/AlipayTime.js +93 -0
- package/dist/esm/components/Payment/BuyerNick.d.ts +39 -0
- package/dist/esm/components/Payment/BuyerNick.js +112 -0
- package/dist/esm/components/Payment/PaymentAmount.d.ts +38 -0
- package/dist/esm/components/Payment/PaymentAmount.js +91 -0
- package/dist/esm/components/Payment/PaymentStatus.d.ts +50 -0
- package/dist/esm/components/Payment/PaymentStatus.js +96 -0
- package/dist/esm/components/Payment/PaymentTid.d.ts +38 -0
- package/dist/esm/components/Payment/PaymentTid.js +84 -0
- package/dist/esm/components/Payment/index.d.ts +120 -0
- package/dist/esm/components/Payment/index.js +118 -0
- package/dist/esm/components/Picture/index.d.ts +31 -0
- package/dist/esm/components/Picture/index.js +118 -0
- package/dist/esm/components/Popover/index.d.ts +3 -0
- package/dist/esm/components/Popover/index.js +51 -0
- package/dist/esm/components/Popover/index.module.less +22 -0
- package/dist/esm/components/Radio/index.d.ts +30 -0
- package/dist/esm/components/Radio/index.js +93 -0
- package/dist/esm/components/Rate/index.d.ts +34 -0
- package/dist/esm/components/Rate/index.js +158 -0
- package/dist/esm/components/ReceiverAddress/index.d.ts +35 -0
- package/dist/esm/components/ReceiverAddress/index.js +133 -0
- package/dist/esm/components/ReceiverMobile/index.d.ts +28 -0
- package/dist/esm/components/ReceiverMobile/index.js +91 -0
- package/dist/esm/components/ReceiverName/index.d.ts +28 -0
- package/dist/esm/components/ReceiverName/index.js +88 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-0.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-1.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-2.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-3.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-4.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-5.png +0 -0
- package/dist/esm/components/Remark/index.d.ts +33 -0
- package/dist/esm/components/Remark/index.js +113 -0
- package/dist/esm/components/ReturnLogistics/index.d.ts +44 -0
- package/dist/esm/components/ReturnLogistics/index.js +107 -0
- package/dist/esm/components/Select/index.d.ts +26 -0
- package/dist/esm/components/Select/index.js +79 -0
- package/dist/esm/components/ShopName/index.d.ts +27 -0
- package/dist/esm/components/ShopName/index.js +78 -0
- package/dist/esm/components/SystemOrderNo/index.d.ts +28 -0
- package/dist/esm/components/SystemOrderNo/index.js +81 -0
- package/dist/esm/components/TemplateSelect/index.d.ts +28 -0
- package/dist/esm/components/TemplateSelect/index.js +79 -0
- package/dist/esm/components/TextArea/index.d.ts +26 -0
- package/dist/esm/components/TextArea/index.js +78 -0
- package/dist/esm/components/ThirdItemSelect/ItemEncode.d.ts +4 -0
- package/dist/esm/components/ThirdItemSelect/ItemEncode.js +31 -0
- package/dist/esm/components/ThirdItemSelect/index.d.ts +27 -0
- package/dist/esm/components/ThirdItemSelect/index.js +120 -0
- package/dist/esm/components/TradeDateTime/index.d.ts +27 -0
- package/dist/esm/components/TradeDateTime/index.js +92 -0
- package/dist/esm/components/TradeId/index.d.ts +28 -0
- package/dist/esm/components/TradeId/index.js +89 -0
- package/dist/esm/components/WorkOrderId/img/repeat.png +0 -0
- package/dist/esm/components/WorkOrderId/index.d.ts +28 -0
- package/dist/esm/components/WorkOrderId/index.js +98 -0
- package/dist/esm/index.d.ts +40 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/type.d.ts +174 -0
- package/dist/esm/type.js +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,113 @@
|
|
|
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 { JstGoodImage } from "../Common";
|
|
14
|
+
import { JstGoods } from '@kmkf-fe-packages/basic-components';
|
|
15
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
16
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
17
|
+
var JstSupply = /*#__PURE__*/_createClass(function JstSupply(options) {
|
|
18
|
+
var _this = this,
|
|
19
|
+
_this$componentConfig;
|
|
20
|
+
_classCallCheck(this, JstSupply);
|
|
21
|
+
_defineProperty(this, "name", void 0);
|
|
22
|
+
_defineProperty(this, "id", void 0);
|
|
23
|
+
_defineProperty(this, "type", void 0);
|
|
24
|
+
_defineProperty(this, "rules", void 0);
|
|
25
|
+
_defineProperty(this, "canFilter", void 0);
|
|
26
|
+
_defineProperty(this, "canGroup", void 0);
|
|
27
|
+
_defineProperty(this, "canHidden", void 0);
|
|
28
|
+
_defineProperty(this, "dataType", void 0);
|
|
29
|
+
_defineProperty(this, "showContains", void 0);
|
|
30
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
31
|
+
_defineProperty(this, "align", void 0);
|
|
32
|
+
_defineProperty(this, "render", function (value) {
|
|
33
|
+
//兼容多个商品
|
|
34
|
+
return /*#__PURE__*/React.createElement(JstGoodImage, {
|
|
35
|
+
list: value,
|
|
36
|
+
type: 2
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
40
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
41
|
+
id: _this.id,
|
|
42
|
+
label: _this.name,
|
|
43
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
|
|
44
|
+
}) : null;
|
|
45
|
+
});
|
|
46
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
47
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_jstItemList")];
|
|
48
|
+
//兼容多个商品
|
|
49
|
+
return /*#__PURE__*/React.createElement(JstGoodImage, {
|
|
50
|
+
list: list,
|
|
51
|
+
type: 2
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
55
|
+
var list = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_jstItemList")]) || [];
|
|
56
|
+
return list.map(function (item) {
|
|
57
|
+
return "\n".concat(item.supplyId || '', "/").concat(item.supplyName || '');
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
_defineProperty(this, "editRender", function () {
|
|
61
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
62
|
+
title: _this.name,
|
|
63
|
+
name: _this.id,
|
|
64
|
+
rules: _this.rules,
|
|
65
|
+
required: false,
|
|
66
|
+
component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
|
|
67
|
+
type: 2
|
|
68
|
+
}))
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
_defineProperty(this, "getColumns", function () {
|
|
72
|
+
return _objectSpread(_objectSpread({}, _this), {}, {
|
|
73
|
+
dataIndex: _this.id,
|
|
74
|
+
title: _this.name,
|
|
75
|
+
renderExport: _this.renderExport
|
|
76
|
+
});
|
|
77
|
+
;
|
|
78
|
+
});
|
|
79
|
+
this.name = options.name;
|
|
80
|
+
this.id = options.id;
|
|
81
|
+
this.type = options.type;
|
|
82
|
+
this.canFilter = false;
|
|
83
|
+
this.canGroup = false;
|
|
84
|
+
this.canHidden = true;
|
|
85
|
+
this.showContains = false;
|
|
86
|
+
this.dataType = 'string';
|
|
87
|
+
this.componentConfig = options.componentConfig;
|
|
88
|
+
this.rules = (_this$componentConfig = this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? [{
|
|
89
|
+
required: true,
|
|
90
|
+
validator: function validator(_, value) {
|
|
91
|
+
var _this$componentConfig2;
|
|
92
|
+
var showField = (_this === null || _this === void 0 ? void 0 : (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showField) || '';
|
|
93
|
+
if (!value || !value.length) {
|
|
94
|
+
return Promise.reject(new Error('请选择宝贝'));
|
|
95
|
+
}
|
|
96
|
+
var hasNo = (value || []).some(function (item) {
|
|
97
|
+
if (['supplyName'].includes(showField)) {
|
|
98
|
+
return item.supplyName;
|
|
99
|
+
} else if (['supplyId'].includes(showField)) {
|
|
100
|
+
return item.supplyId;
|
|
101
|
+
} else {
|
|
102
|
+
return item.supplyId && item.supplyName;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
if (!hasNo) {
|
|
106
|
+
return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u4F9B\u9500\u5546\u4FE1\u606F"));
|
|
107
|
+
}
|
|
108
|
+
return Promise.resolve();
|
|
109
|
+
}
|
|
110
|
+
}] : [];
|
|
111
|
+
this.align = 'left';
|
|
112
|
+
});
|
|
113
|
+
export default JstSupply;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, Record } from '../../type';
|
|
3
|
+
import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
4
|
+
import Express from '../Express';
|
|
5
|
+
import ExpressCode from '../ExpressCode';
|
|
6
|
+
declare class Logistics implements ComponentInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
type: string;
|
|
10
|
+
rules: any[];
|
|
11
|
+
canFilter: boolean;
|
|
12
|
+
canGroup: boolean;
|
|
13
|
+
canHidden: boolean;
|
|
14
|
+
dataType: DataType;
|
|
15
|
+
showContains: boolean;
|
|
16
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
17
|
+
expressDateInstance: ExpressData;
|
|
18
|
+
express: Express;
|
|
19
|
+
expressCode: ExpressCode;
|
|
20
|
+
constructor(options: PickOption);
|
|
21
|
+
render: () => null;
|
|
22
|
+
editRender: (value: any) => JSX.Element;
|
|
23
|
+
renderClient: (record: Record) => JSX.Element;
|
|
24
|
+
renderPc: () => null;
|
|
25
|
+
renderExport: () => null;
|
|
26
|
+
getColumns: () => {
|
|
27
|
+
title: string;
|
|
28
|
+
children: ((Express & {
|
|
29
|
+
dataIndex: string;
|
|
30
|
+
title: string;
|
|
31
|
+
widget: JSX.Element;
|
|
32
|
+
groupFieldPath: string;
|
|
33
|
+
renderExport: (value: string, record: Record) => string | number;
|
|
34
|
+
}) | (ExpressCode & {
|
|
35
|
+
dataIndex: string;
|
|
36
|
+
title: string;
|
|
37
|
+
groupFieldPath: string;
|
|
38
|
+
renderExport: (value: string, record: Record) => string;
|
|
39
|
+
}))[];
|
|
40
|
+
canHidden: boolean;
|
|
41
|
+
dataIndex: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export default Logistics;
|
|
@@ -0,0 +1,107 @@
|
|
|
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 { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
13
|
+
import { ExpressLogistics } from '@kmkf-fe-packages/basic-components';
|
|
14
|
+
import Express from "../Express";
|
|
15
|
+
import ExpressCode from "../ExpressCode";
|
|
16
|
+
import GetFormItem from "../GetFormItem";
|
|
17
|
+
var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
18
|
+
var _this = this,
|
|
19
|
+
_this$componentConfig3;
|
|
20
|
+
_classCallCheck(this, Logistics);
|
|
21
|
+
_defineProperty(this, "name", void 0);
|
|
22
|
+
_defineProperty(this, "id", void 0);
|
|
23
|
+
_defineProperty(this, "type", void 0);
|
|
24
|
+
_defineProperty(this, "rules", void 0);
|
|
25
|
+
_defineProperty(this, "canFilter", void 0);
|
|
26
|
+
_defineProperty(this, "canGroup", void 0);
|
|
27
|
+
_defineProperty(this, "canHidden", void 0);
|
|
28
|
+
_defineProperty(this, "dataType", void 0);
|
|
29
|
+
_defineProperty(this, "showContains", void 0);
|
|
30
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
31
|
+
_defineProperty(this, "expressDateInstance", void 0);
|
|
32
|
+
_defineProperty(this, "express", void 0);
|
|
33
|
+
_defineProperty(this, "expressCode", void 0);
|
|
34
|
+
_defineProperty(this, "render", function () {
|
|
35
|
+
return null;
|
|
36
|
+
});
|
|
37
|
+
_defineProperty(this, "editRender", function (value) {
|
|
38
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
39
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
40
|
+
title: _this.name,
|
|
41
|
+
name: _this.id,
|
|
42
|
+
rules: _this.rules,
|
|
43
|
+
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,
|
|
44
|
+
component: /*#__PURE__*/React.createElement(ExpressLogistics, _extends({}, _this.componentConfig, {
|
|
45
|
+
options: _this.expressDateInstance.getExpressData(),
|
|
46
|
+
onBlur: value === null || value === void 0 ? void 0 : value.onBlur
|
|
47
|
+
}))
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
51
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderClient(record), _this.expressCode.renderClient(record));
|
|
52
|
+
});
|
|
53
|
+
_defineProperty(this, "renderPc", function () {
|
|
54
|
+
return null;
|
|
55
|
+
});
|
|
56
|
+
_defineProperty(this, "renderExport", function () {
|
|
57
|
+
return null;
|
|
58
|
+
});
|
|
59
|
+
_defineProperty(this, "getColumns", function () {
|
|
60
|
+
return {
|
|
61
|
+
title: _this.name,
|
|
62
|
+
children: [_this.express.getColumns(), _this.expressCode.getColumns()],
|
|
63
|
+
canHidden: _this.canHidden,
|
|
64
|
+
dataIndex: _this.id
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
this.name = options.name;
|
|
68
|
+
this.id = options.id;
|
|
69
|
+
this.type = options.type;
|
|
70
|
+
this.canFilter = false;
|
|
71
|
+
this.canGroup = false;
|
|
72
|
+
this.canHidden = true;
|
|
73
|
+
this.showContains = false;
|
|
74
|
+
this.dataType = 'string';
|
|
75
|
+
this.componentConfig = options.componentConfig;
|
|
76
|
+
this.expressDateInstance = ExpressData.getInstance();
|
|
77
|
+
this.express = new Express(_objectSpread(_objectSpread({}, options), {}, {
|
|
78
|
+
name: '快递物流公司',
|
|
79
|
+
id: "".concat(this.id, "_expressLogisticsCompany")
|
|
80
|
+
}));
|
|
81
|
+
this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
82
|
+
name: '快递物流单号',
|
|
83
|
+
id: "".concat(this.id, "_expressLogisticsCode")
|
|
84
|
+
}));
|
|
85
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
86
|
+
validator: function validator(_, value) {
|
|
87
|
+
var _this$componentConfig4;
|
|
88
|
+
if ((_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.isSingle) {
|
|
89
|
+
var _this$componentConfig5, _this$componentConfig6;
|
|
90
|
+
if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showField) === 'EXPRESS_COMPANY' && !(value !== null && value !== void 0 && value.company)) {
|
|
91
|
+
return Promise.reject(new Error('请选择物流公司'));
|
|
92
|
+
} else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showField) === 'EXPRESS_WAYBILL_CODE' && !(value !== null && value !== void 0 && value.order)) {
|
|
93
|
+
return Promise.reject(new Error('请输入物流单号'));
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
if (!(value !== null && value !== void 0 && value.company)) {
|
|
97
|
+
return Promise.reject(new Error('请选择物流公司'));
|
|
98
|
+
}
|
|
99
|
+
if (!(value !== null && value !== void 0 && value.order)) {
|
|
100
|
+
return Promise.reject(new Error('请输入物流单号'));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return Promise.resolve();
|
|
104
|
+
}
|
|
105
|
+
}] : [];
|
|
106
|
+
});
|
|
107
|
+
export default Logistics;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, Record } from '../../type';
|
|
3
|
+
declare type Value = string[];
|
|
4
|
+
declare class BasicMultSelect implements ComponentInterface {
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
type: string;
|
|
8
|
+
rules: any[];
|
|
9
|
+
canFilter: boolean;
|
|
10
|
+
canGroup: boolean;
|
|
11
|
+
canHidden: boolean;
|
|
12
|
+
dataType: DataType;
|
|
13
|
+
showContains: boolean;
|
|
14
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
15
|
+
constructor(options: PickOption);
|
|
16
|
+
render: (value: Value) => JSX.Element;
|
|
17
|
+
renderClient: (record: any) => JSX.Element | null;
|
|
18
|
+
renderPc: (value: any, record: Record) => JSX.Element;
|
|
19
|
+
renderExport: (value: any, record: Record) => any;
|
|
20
|
+
editRender: () => JSX.Element;
|
|
21
|
+
getColumns: () => this & {
|
|
22
|
+
dataIndex: string;
|
|
23
|
+
title: string;
|
|
24
|
+
renderExport: (value: any, record: Record) => any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export default BasicMultSelect;
|
|
@@ -0,0 +1,84 @@
|
|
|
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 { ApaasMultipleSelect } from '@kmkf-fe-packages/basic-components';
|
|
13
|
+
import GetFormItem from "../GetFormItem";
|
|
14
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
|
+
var BasicMultSelect = /*#__PURE__*/_createClass(function BasicMultSelect(options) {
|
|
17
|
+
var _this = this;
|
|
18
|
+
_classCallCheck(this, BasicMultSelect);
|
|
19
|
+
_defineProperty(this, "name", void 0);
|
|
20
|
+
_defineProperty(this, "id", void 0);
|
|
21
|
+
_defineProperty(this, "type", void 0);
|
|
22
|
+
_defineProperty(this, "rules", void 0);
|
|
23
|
+
_defineProperty(this, "canFilter", void 0);
|
|
24
|
+
_defineProperty(this, "canGroup", void 0);
|
|
25
|
+
_defineProperty(this, "canHidden", void 0);
|
|
26
|
+
_defineProperty(this, "dataType", void 0);
|
|
27
|
+
_defineProperty(this, "showContains", void 0);
|
|
28
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
29
|
+
_defineProperty(this, "render", function (value) {
|
|
30
|
+
return /*#__PURE__*/React.createElement("span", null, " ", value === null || value === void 0 ? void 0 : value.join(','));
|
|
31
|
+
});
|
|
32
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
33
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
34
|
+
id: _this.id,
|
|
35
|
+
label: _this.name,
|
|
36
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
|
|
37
|
+
}) : null;
|
|
38
|
+
});
|
|
39
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
40
|
+
var _record;
|
|
41
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_basicMultSelect")]) === undefined) {
|
|
42
|
+
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id, "_basicMultSelect")]) === null || _record === void 0 ? void 0 : _record.join(','));
|
|
45
|
+
});
|
|
46
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
47
|
+
var _record2;
|
|
48
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_basicMultSelect")]) === undefined) {
|
|
49
|
+
return '--';
|
|
50
|
+
}
|
|
51
|
+
return record === null || record === void 0 ? void 0 : (_record2 = record["".concat(_this.id, "_basicMultSelect")]) === null || _record2 === void 0 ? void 0 : _record2.join(',');
|
|
52
|
+
});
|
|
53
|
+
_defineProperty(this, "editRender", function () {
|
|
54
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
55
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
56
|
+
title: _this.name,
|
|
57
|
+
name: _this.id,
|
|
58
|
+
rules: _this.rules,
|
|
59
|
+
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,
|
|
60
|
+
component: /*#__PURE__*/React.createElement(ApaasMultipleSelect, _extends({}, _this.componentConfig, {
|
|
61
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(_this.name)
|
|
62
|
+
}))
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(this, "getColumns", function () {
|
|
66
|
+
return _objectSpread(_objectSpread({}, _this), {}, {
|
|
67
|
+
dataIndex: _this.id,
|
|
68
|
+
title: _this.name,
|
|
69
|
+
renderExport: _this.renderExport
|
|
70
|
+
});
|
|
71
|
+
;
|
|
72
|
+
});
|
|
73
|
+
this.name = options.name;
|
|
74
|
+
this.id = options.id;
|
|
75
|
+
this.type = options.type;
|
|
76
|
+
this.canFilter = false;
|
|
77
|
+
this.canGroup = false;
|
|
78
|
+
this.canHidden = true;
|
|
79
|
+
this.showContains = false;
|
|
80
|
+
this.dataType = 'array';
|
|
81
|
+
this.componentConfig = options.componentConfig;
|
|
82
|
+
this.rules = [];
|
|
83
|
+
});
|
|
84
|
+
export default BasicMultSelect;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, ALignType } from '../../type';
|
|
3
|
+
declare class OrdinaryHeader implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
type: string;
|
|
7
|
+
rules: any[];
|
|
8
|
+
canFilter: boolean;
|
|
9
|
+
canGroup: boolean;
|
|
10
|
+
canHidden: boolean;
|
|
11
|
+
dataType: DataType;
|
|
12
|
+
showContains: boolean;
|
|
13
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
14
|
+
effects: ComponentInterface["effects"];
|
|
15
|
+
align: ALignType;
|
|
16
|
+
width: number;
|
|
17
|
+
constructor(options: PickOption);
|
|
18
|
+
render: (value: string) => JSX.Element;
|
|
19
|
+
renderClient: (record: any) => JSX.Element | null;
|
|
20
|
+
renderPc: (value: any) => any;
|
|
21
|
+
renderExport: (value: any) => any;
|
|
22
|
+
editRender: () => JSX.Element;
|
|
23
|
+
getColumns: () => {
|
|
24
|
+
title: string;
|
|
25
|
+
align: ALignType;
|
|
26
|
+
dataIndex: string;
|
|
27
|
+
dataType: DataType;
|
|
28
|
+
canHidden: boolean;
|
|
29
|
+
canFilter: boolean;
|
|
30
|
+
canGroup: boolean;
|
|
31
|
+
type: string;
|
|
32
|
+
render: (value: any) => any;
|
|
33
|
+
componentType: () => JSX.Element;
|
|
34
|
+
showContains: boolean;
|
|
35
|
+
renderExport: (value: any) => any;
|
|
36
|
+
width: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export default OrdinaryHeader;
|
|
@@ -0,0 +1,93 @@
|
|
|
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 _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); }
|
|
3
|
+
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); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
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); }
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import GetFormItem from "../GetFormItem";
|
|
11
|
+
import Header from "../OrdinaryHeader";
|
|
12
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
13
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
14
|
+
var OrdinaryHeader = /*#__PURE__*/_createClass(function OrdinaryHeader(options) {
|
|
15
|
+
var _this = this;
|
|
16
|
+
_classCallCheck(this, OrdinaryHeader);
|
|
17
|
+
_defineProperty(this, "name", void 0);
|
|
18
|
+
_defineProperty(this, "id", void 0);
|
|
19
|
+
_defineProperty(this, "type", void 0);
|
|
20
|
+
_defineProperty(this, "rules", void 0);
|
|
21
|
+
_defineProperty(this, "canFilter", void 0);
|
|
22
|
+
_defineProperty(this, "canGroup", void 0);
|
|
23
|
+
_defineProperty(this, "canHidden", void 0);
|
|
24
|
+
_defineProperty(this, "dataType", void 0);
|
|
25
|
+
_defineProperty(this, "showContains", void 0);
|
|
26
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
27
|
+
_defineProperty(this, "effects", void 0);
|
|
28
|
+
_defineProperty(this, "align", void 0);
|
|
29
|
+
_defineProperty(this, "width", void 0);
|
|
30
|
+
_defineProperty(this, "render", function (value) {
|
|
31
|
+
return /*#__PURE__*/React.createElement("span", null, value);
|
|
32
|
+
});
|
|
33
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
34
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
35
|
+
id: _this.id,
|
|
36
|
+
label: _this.name,
|
|
37
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
|
|
38
|
+
}) : null;
|
|
39
|
+
});
|
|
40
|
+
_defineProperty(this, "renderPc", function (value) {
|
|
41
|
+
return value !== null && value !== void 0 ? value : '--';
|
|
42
|
+
});
|
|
43
|
+
_defineProperty(this, "renderExport", function (value) {
|
|
44
|
+
return value !== null && value !== void 0 ? value : '--';
|
|
45
|
+
});
|
|
46
|
+
_defineProperty(this, "editRender", function () {
|
|
47
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
48
|
+
var handleChangeSerial = function handleChangeSerial(value) {
|
|
49
|
+
var _this$effects, _this$effects$form;
|
|
50
|
+
(_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : (_this$effects$form = _this$effects.form) === null || _this$effects$form === void 0 ? void 0 : _this$effects$form.setFieldsValue(_defineProperty({}, "".concat(_this.id, "_ordinarySerial"), value));
|
|
51
|
+
};
|
|
52
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
53
|
+
title: _this.name,
|
|
54
|
+
name: _this.id,
|
|
55
|
+
rules: _this.rules,
|
|
56
|
+
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,
|
|
57
|
+
component: /*#__PURE__*/React.createElement(Header, _extends({}, _this.componentConfig, {
|
|
58
|
+
handleChangeSerial: handleChangeSerial
|
|
59
|
+
}))
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(this, "getColumns", function () {
|
|
63
|
+
return {
|
|
64
|
+
title: _this.name,
|
|
65
|
+
align: _this.align,
|
|
66
|
+
dataIndex: _this.id,
|
|
67
|
+
dataType: _this.dataType,
|
|
68
|
+
canHidden: _this.canHidden,
|
|
69
|
+
canFilter: _this.canFilter,
|
|
70
|
+
canGroup: _this.canGroup,
|
|
71
|
+
type: _this.type,
|
|
72
|
+
render: _this.renderPc,
|
|
73
|
+
componentType: _this.editRender,
|
|
74
|
+
showContains: _this.showContains,
|
|
75
|
+
renderExport: _this.renderExport,
|
|
76
|
+
width: _this.width
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
this.name = '发票抬头';
|
|
80
|
+
this.id = "".concat(options.id, "_ordinaryTaitou");
|
|
81
|
+
this.type = options.type;
|
|
82
|
+
this.canFilter = true;
|
|
83
|
+
this.canGroup = true;
|
|
84
|
+
this.canHidden = false;
|
|
85
|
+
this.showContains = false;
|
|
86
|
+
this.dataType = 'string';
|
|
87
|
+
this.componentConfig = options.componentConfig;
|
|
88
|
+
this.rules = [];
|
|
89
|
+
this.align = 'left';
|
|
90
|
+
this.effects = options.effects;
|
|
91
|
+
this.width = 200;
|
|
92
|
+
});
|
|
93
|
+
export default OrdinaryHeader;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, ALignType } from '../../type';
|
|
3
|
+
declare class OrdinaryMoney implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
type: string;
|
|
7
|
+
rules: any[];
|
|
8
|
+
canFilter: boolean;
|
|
9
|
+
canGroup: boolean;
|
|
10
|
+
canHidden: boolean;
|
|
11
|
+
dataType: DataType;
|
|
12
|
+
showContains: boolean;
|
|
13
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
14
|
+
effects: ComponentInterface["effects"];
|
|
15
|
+
align: ALignType;
|
|
16
|
+
width: number;
|
|
17
|
+
constructor(options: PickOption);
|
|
18
|
+
render: (value: string) => JSX.Element;
|
|
19
|
+
renderPc: (value: any) => any;
|
|
20
|
+
renderExport: (value: any) => any;
|
|
21
|
+
renderClient: (record: any) => JSX.Element | null;
|
|
22
|
+
editRender: () => JSX.Element;
|
|
23
|
+
getColumns: () => {
|
|
24
|
+
title: string;
|
|
25
|
+
align: ALignType;
|
|
26
|
+
dataIndex: string;
|
|
27
|
+
dataType: DataType;
|
|
28
|
+
canHidden: boolean;
|
|
29
|
+
canFilter: boolean;
|
|
30
|
+
canGroup: boolean;
|
|
31
|
+
type: string;
|
|
32
|
+
render: (value: any) => any;
|
|
33
|
+
componentType: () => JSX.Element;
|
|
34
|
+
showContains: boolean;
|
|
35
|
+
renderExport: (value: any) => any;
|
|
36
|
+
width: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export default OrdinaryMoney;
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
import React from 'react';
|
|
9
|
+
import GetFormItem from "../GetFormItem";
|
|
10
|
+
import { ApaasInput } from '@kmkf-fe-packages/basic-components';
|
|
11
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
12
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
13
|
+
var OrdinaryMoney = /*#__PURE__*/_createClass(function OrdinaryMoney(options) {
|
|
14
|
+
var _this = this;
|
|
15
|
+
_classCallCheck(this, OrdinaryMoney);
|
|
16
|
+
_defineProperty(this, "name", void 0);
|
|
17
|
+
_defineProperty(this, "id", void 0);
|
|
18
|
+
_defineProperty(this, "type", void 0);
|
|
19
|
+
_defineProperty(this, "rules", void 0);
|
|
20
|
+
_defineProperty(this, "canFilter", void 0);
|
|
21
|
+
_defineProperty(this, "canGroup", void 0);
|
|
22
|
+
_defineProperty(this, "canHidden", void 0);
|
|
23
|
+
_defineProperty(this, "dataType", void 0);
|
|
24
|
+
_defineProperty(this, "showContains", void 0);
|
|
25
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
26
|
+
_defineProperty(this, "effects", void 0);
|
|
27
|
+
_defineProperty(this, "align", void 0);
|
|
28
|
+
_defineProperty(this, "width", void 0);
|
|
29
|
+
_defineProperty(this, "render", function (value) {
|
|
30
|
+
return /*#__PURE__*/React.createElement("span", null, value);
|
|
31
|
+
});
|
|
32
|
+
_defineProperty(this, "renderPc", function (value) {
|
|
33
|
+
return value !== null && value !== void 0 ? value : '--';
|
|
34
|
+
});
|
|
35
|
+
_defineProperty(this, "renderExport", function (value) {
|
|
36
|
+
return value !== null && value !== void 0 ? value : '--';
|
|
37
|
+
});
|
|
38
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
39
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
40
|
+
id: _this.id,
|
|
41
|
+
label: _this.name,
|
|
42
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
|
|
43
|
+
}) : null;
|
|
44
|
+
});
|
|
45
|
+
_defineProperty(this, "editRender", function () {
|
|
46
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
47
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
48
|
+
title: _this.name,
|
|
49
|
+
name: _this.id,
|
|
50
|
+
rules: _this.rules,
|
|
51
|
+
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,
|
|
52
|
+
component: /*#__PURE__*/React.createElement(ApaasInput, _this.componentConfig)
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
_defineProperty(this, "getColumns", function () {
|
|
56
|
+
return {
|
|
57
|
+
title: _this.name,
|
|
58
|
+
align: _this.align,
|
|
59
|
+
dataIndex: _this.id,
|
|
60
|
+
dataType: _this.dataType,
|
|
61
|
+
canHidden: _this.canHidden,
|
|
62
|
+
canFilter: _this.canFilter,
|
|
63
|
+
canGroup: _this.canGroup,
|
|
64
|
+
type: _this.type,
|
|
65
|
+
render: _this.renderPc,
|
|
66
|
+
componentType: _this.editRender,
|
|
67
|
+
showContains: _this.showContains,
|
|
68
|
+
renderExport: _this.renderExport,
|
|
69
|
+
width: _this.width
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
this.name = '开票金额';
|
|
73
|
+
this.id = "".concat(options.id, "_ordinaryMoney");
|
|
74
|
+
this.type = options.type;
|
|
75
|
+
this.canFilter = true;
|
|
76
|
+
this.canGroup = true;
|
|
77
|
+
this.canHidden = false;
|
|
78
|
+
this.showContains = false;
|
|
79
|
+
this.dataType = 'number';
|
|
80
|
+
this.componentConfig = options.componentConfig;
|
|
81
|
+
this.rules = [{
|
|
82
|
+
validator: function validator(_, value) {
|
|
83
|
+
if (/^(\d+)(\.\d{0,2})?$/.test(value)) {
|
|
84
|
+
return Promise.resolve();
|
|
85
|
+
}
|
|
86
|
+
return Promise.reject(new Error('开票金额最多支持俩位小数'));
|
|
87
|
+
}
|
|
88
|
+
}];
|
|
89
|
+
this.align = 'left';
|
|
90
|
+
this.effects = options.effects;
|
|
91
|
+
this.width = 200;
|
|
92
|
+
});
|
|
93
|
+
export default OrdinaryMoney;
|