@kmkf-fe-packages/services-components 0.28.1 → 0.28.2-alpha.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/dist/esm/commonComponents/ErpContext/index.d.ts +16 -0
- package/dist/esm/commonComponents/ErpContext/index.js +68 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/communication.d.ts +2 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/communication.js +23 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/index.d.ts +3 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/index.js +161 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/index.module.scss +30 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/noImage.png +0 -0
- package/dist/esm/components/ErpTradeId/index.MD +1 -0
- package/dist/esm/components/ErpTradeId/index.d.ts +2 -29
- package/dist/esm/components/ErpTradeId/index.js +33 -104
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +3 -1
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { SetStateAction } from 'react';
|
|
2
|
+
import { Dispatch } from 'react';
|
|
3
|
+
declare const ErpContext: React.Context<{
|
|
4
|
+
subOrderList: Array<any>;
|
|
5
|
+
setSubOrderList: Dispatch<SetStateAction<Array<never>>>;
|
|
6
|
+
currentOrderDetail: Record<string, any>;
|
|
7
|
+
setCurrentOrderDetail: Dispatch<SetStateAction<Record<string, any>>>;
|
|
8
|
+
buyerId: string;
|
|
9
|
+
setBuyerId: Dispatch<SetStateAction<string>>;
|
|
10
|
+
subOrderListVisible: boolean;
|
|
11
|
+
setSubOrderListVisible: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
globalLoading: boolean;
|
|
13
|
+
setGlobalLoading: Dispatch<SetStateAction<boolean>>;
|
|
14
|
+
}>;
|
|
15
|
+
declare const ErpProvider: ({ children }: React.PropsWithChildren) => React.JSX.Element;
|
|
16
|
+
export { ErpContext, ErpProvider };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { createContext, useState } from 'react';
|
|
8
|
+
// 配合着ErpTradeId 组件使用
|
|
9
|
+
var ErpContext = /*#__PURE__*/createContext({
|
|
10
|
+
subOrderList: [],
|
|
11
|
+
setSubOrderList: function setSubOrderList() {
|
|
12
|
+
return [];
|
|
13
|
+
},
|
|
14
|
+
currentOrderDetail: {},
|
|
15
|
+
setCurrentOrderDetail: function setCurrentOrderDetail() {
|
|
16
|
+
return void 0;
|
|
17
|
+
},
|
|
18
|
+
buyerId: '',
|
|
19
|
+
setBuyerId: function setBuyerId() {
|
|
20
|
+
return '';
|
|
21
|
+
},
|
|
22
|
+
subOrderListVisible: false,
|
|
23
|
+
setSubOrderListVisible: function setSubOrderListVisible() {
|
|
24
|
+
return false;
|
|
25
|
+
},
|
|
26
|
+
globalLoading: false,
|
|
27
|
+
setGlobalLoading: function setGlobalLoading() {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var ErpProvider = function ErpProvider(_ref) {
|
|
32
|
+
var children = _ref.children;
|
|
33
|
+
var _useState = useState([]),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
subOrderList = _useState2[0],
|
|
36
|
+
setSubOrderList = _useState2[1];
|
|
37
|
+
var _useState3 = useState({}),
|
|
38
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
+
currentOrderDetail = _useState4[0],
|
|
40
|
+
setCurrentOrderDetail = _useState4[1];
|
|
41
|
+
var _useState5 = useState(''),
|
|
42
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
43
|
+
buyerId = _useState6[0],
|
|
44
|
+
setBuyerId = _useState6[1];
|
|
45
|
+
var _useState7 = useState(false),
|
|
46
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
47
|
+
subOrderListVisible = _useState8[0],
|
|
48
|
+
setSubOrderListVisible = _useState8[1];
|
|
49
|
+
var _useState9 = useState(false),
|
|
50
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
51
|
+
globalLoading = _useState10[0],
|
|
52
|
+
setGlobalLoading = _useState10[1];
|
|
53
|
+
return /*#__PURE__*/React.createElement(ErpContext.Provider, {
|
|
54
|
+
value: {
|
|
55
|
+
subOrderList: subOrderList,
|
|
56
|
+
setSubOrderList: setSubOrderList,
|
|
57
|
+
currentOrderDetail: currentOrderDetail,
|
|
58
|
+
setCurrentOrderDetail: setCurrentOrderDetail,
|
|
59
|
+
buyerId: buyerId,
|
|
60
|
+
setBuyerId: setBuyerId,
|
|
61
|
+
subOrderListVisible: subOrderListVisible,
|
|
62
|
+
setSubOrderListVisible: setSubOrderListVisible,
|
|
63
|
+
globalLoading: globalLoading,
|
|
64
|
+
setGlobalLoading: setGlobalLoading
|
|
65
|
+
}
|
|
66
|
+
}, children);
|
|
67
|
+
};
|
|
68
|
+
export { ErpContext, ErpProvider };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// 查询订单详情
|
|
2
|
+
export var queryOrderDetail = function queryOrderDetail(tid) {
|
|
3
|
+
var _window, _window$parent;
|
|
4
|
+
console.log('请求ERP订单详情', tid);
|
|
5
|
+
(_window = window) === null || _window === void 0 ? void 0 : (_window$parent = _window.parent) === null || _window$parent === void 0 ? void 0 : _window$parent.postMessage({
|
|
6
|
+
method: 'queryOrder',
|
|
7
|
+
data: {
|
|
8
|
+
tid: tid
|
|
9
|
+
}
|
|
10
|
+
}, '*');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// 查询抖店openId
|
|
14
|
+
export var queryDouDianOpenId = function queryDouDianOpenId(originTid) {
|
|
15
|
+
var _window2, _window2$parent;
|
|
16
|
+
console.log('查询抖音店铺买家id', originTid);
|
|
17
|
+
(_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$parent = _window2.parent) === null || _window2$parent === void 0 ? void 0 : _window2$parent.postMessage({
|
|
18
|
+
method: 'queryDouDianOpenId',
|
|
19
|
+
data: {
|
|
20
|
+
originTid: originTid
|
|
21
|
+
}
|
|
22
|
+
}, '*');
|
|
23
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
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 _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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
/*
|
|
14
|
+
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
|
15
|
+
* @Date: 2022-11-15 15:39:26
|
|
16
|
+
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
|
17
|
+
* @LastEditTime: 2022-12-07 19:47:07
|
|
18
|
+
* @FilePath: /kefu/packages/enterprise/src/app/pages/ErpWorkOrder/components/OrderNum/index.tsx
|
|
19
|
+
* @Description:
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
|
22
|
+
*/
|
|
23
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
24
|
+
import { Button, Input, Popover, Radio, Image } from 'antd';
|
|
25
|
+
import get from 'lodash/get';
|
|
26
|
+
import { ErpScenes } from "../../../../index";
|
|
27
|
+
import { queryOrderDetail, queryDouDianOpenId } from "./communication";
|
|
28
|
+
import noImage from "./noImage.png";
|
|
29
|
+
import styles from "./index.module.scss";
|
|
30
|
+
var Card = function Card(_ref) {
|
|
31
|
+
var tid = _ref.tid,
|
|
32
|
+
sid = _ref.sid,
|
|
33
|
+
itemList = _ref.itemList,
|
|
34
|
+
sysStatusName = _ref.sysStatusName;
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: styles.card
|
|
37
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
style: {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center'
|
|
41
|
+
}
|
|
42
|
+
}, sysStatusName && /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: styles.tag
|
|
44
|
+
}, sysStatusName), /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
style: {
|
|
46
|
+
marginLeft: '8px',
|
|
47
|
+
flexDirection: 'column',
|
|
48
|
+
display: 'flex'
|
|
49
|
+
}
|
|
50
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u7CFB\u7EDF\u5355\u53F7: ", /*#__PURE__*/React.createElement("b", null, sid)), /*#__PURE__*/React.createElement("span", null, "\u5E73\u53F0\u5355\u53F7: ", /*#__PURE__*/React.createElement("b", null, tid)))), itemList.map(function (item) {
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: styles.good
|
|
53
|
+
}, item.picUrl ? /*#__PURE__*/React.createElement(Image, {
|
|
54
|
+
width: 56,
|
|
55
|
+
src: item.picUrl
|
|
56
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
57
|
+
src: noImage,
|
|
58
|
+
alt: "\u65E0\u5546\u54C1\u56FE\u7247",
|
|
59
|
+
style: {
|
|
60
|
+
width: '56px',
|
|
61
|
+
height: '56px'
|
|
62
|
+
}
|
|
63
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
className: styles.content
|
|
65
|
+
}, /*#__PURE__*/React.createElement("span", null, item.title), /*#__PURE__*/React.createElement("span", null, item.productCode)), /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: styles.price
|
|
67
|
+
}, item.price && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", {
|
|
68
|
+
style: {
|
|
69
|
+
color: '#ff7a45',
|
|
70
|
+
fontSize: '16px'
|
|
71
|
+
}
|
|
72
|
+
}, item.price), ' ', "* 1")));
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
var SubOrderList = function SubOrderList(_ref2) {
|
|
76
|
+
var subList = _ref2.subList;
|
|
77
|
+
var _useContext = useContext(ErpScenes.ErpContext),
|
|
78
|
+
subOrderList = _useContext.subOrderList,
|
|
79
|
+
setGlobalLoading = _useContext.setGlobalLoading,
|
|
80
|
+
setBuyerId = _useContext.setBuyerId,
|
|
81
|
+
setCurrentOrderDetail = _useContext.setCurrentOrderDetail;
|
|
82
|
+
var _useState = useState(),
|
|
83
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
+
value = _useState2[0],
|
|
85
|
+
setValue = _useState2[1];
|
|
86
|
+
var handleChange = function handleChange(e) {
|
|
87
|
+
setValue(e.target.value);
|
|
88
|
+
var selectOrder = get(subOrderList, "orderList.".concat(e.target.value), {});
|
|
89
|
+
// 如果是抖音的订单,需要根据这个订单号去获取买家id
|
|
90
|
+
if (selectOrder.shopSource === 'fxg') {
|
|
91
|
+
setGlobalLoading(true);
|
|
92
|
+
queryDouDianOpenId(selectOrder.originTid);
|
|
93
|
+
} else {
|
|
94
|
+
setBuyerId('');
|
|
95
|
+
}
|
|
96
|
+
setCurrentOrderDetail(_objectSpread({}, selectOrder));
|
|
97
|
+
};
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
style: {
|
|
100
|
+
height: '300px',
|
|
101
|
+
overflowY: 'auto'
|
|
102
|
+
},
|
|
103
|
+
className: styles.itemWrap,
|
|
104
|
+
onClick: function onClick(e) {
|
|
105
|
+
return e.stopPropagation();
|
|
106
|
+
}
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
108
|
+
value: value,
|
|
109
|
+
onChange: handleChange
|
|
110
|
+
}, subList.map(function (subOrder, index) {
|
|
111
|
+
return /*#__PURE__*/React.createElement(Radio, {
|
|
112
|
+
value: index
|
|
113
|
+
}, /*#__PURE__*/React.createElement(Card, subOrder));
|
|
114
|
+
})));
|
|
115
|
+
};
|
|
116
|
+
var OrderNum = function OrderNum(_ref3) {
|
|
117
|
+
var value = _ref3.value,
|
|
118
|
+
onChange = _ref3.onChange;
|
|
119
|
+
var _useContext2 = useContext(ErpScenes.ErpContext),
|
|
120
|
+
visible = _useContext2.subOrderListVisible,
|
|
121
|
+
subList = _useContext2.subOrderList,
|
|
122
|
+
setGlobalLoading = _useContext2.setGlobalLoading,
|
|
123
|
+
setSubOrderListVisible = _useContext2.setSubOrderListVisible;
|
|
124
|
+
var handleQueryOrderDetail = function handleQueryOrderDetail() {
|
|
125
|
+
if (!value) return;
|
|
126
|
+
setGlobalLoading(true);
|
|
127
|
+
queryOrderDetail(value);
|
|
128
|
+
};
|
|
129
|
+
useEffect(function () {
|
|
130
|
+
document.body.addEventListener('click', function () {
|
|
131
|
+
setSubOrderListVisible(false);
|
|
132
|
+
});
|
|
133
|
+
return document.body.removeEventListener('click', function () {
|
|
134
|
+
setSubOrderListVisible(false);
|
|
135
|
+
});
|
|
136
|
+
}, []);
|
|
137
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
138
|
+
visible: visible,
|
|
139
|
+
placement: "bottom",
|
|
140
|
+
content: /*#__PURE__*/React.createElement(SubOrderList, {
|
|
141
|
+
subList: subList
|
|
142
|
+
}),
|
|
143
|
+
trigger: "manually"
|
|
144
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
style: {
|
|
146
|
+
display: 'inline-flex',
|
|
147
|
+
width: '100%',
|
|
148
|
+
alignItems: 'center'
|
|
149
|
+
},
|
|
150
|
+
onClick: function onClick(e) {
|
|
151
|
+
return e.stopPropagation();
|
|
152
|
+
}
|
|
153
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
154
|
+
value: value,
|
|
155
|
+
onChange: onChange
|
|
156
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
157
|
+
type: "primary",
|
|
158
|
+
onClick: handleQueryOrderDetail
|
|
159
|
+
}, "\u67E5\u8BE2\u8BA2\u5355")));
|
|
160
|
+
};
|
|
161
|
+
export default OrderNum;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.itemWrap {
|
|
2
|
+
width: 420px;
|
|
3
|
+
}
|
|
4
|
+
.card {
|
|
5
|
+
margin-bottom: 16px;
|
|
6
|
+
.tag {
|
|
7
|
+
padding: 2px;
|
|
8
|
+
background: #bae7ff;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
height: 24px;
|
|
11
|
+
line-height: 21px;
|
|
12
|
+
}
|
|
13
|
+
.good {
|
|
14
|
+
margin-top: 8px;
|
|
15
|
+
width: 380px;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
.content {
|
|
19
|
+
flex: 1;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
margin-left: 8px;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
.price {
|
|
26
|
+
flex: 0 0 100px;
|
|
27
|
+
align-self: flex-end;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
### 该组件只能在ERP录入工单场景下使用,并且需要配合 ErpContext 这个上下文一起使用
|
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../type';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
constructor(options: PickOption);
|
|
16
|
-
renderClient: (record: any) => React.JSX.Element | null;
|
|
17
|
-
copyHandle: (text: string) => void;
|
|
18
|
-
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
19
|
-
renderLog: (r: Record) => React.JSX.Element | null;
|
|
20
|
-
getComponentValue: (r: Record) => any;
|
|
21
|
-
renderExport: (value: any, record: Record) => any;
|
|
2
|
+
import TradeId from '../TradeId';
|
|
3
|
+
declare class ErpTradeId extends TradeId {
|
|
22
4
|
editRender: (p: any) => React.JSX.Element;
|
|
23
|
-
filterConfig: (item: ColumnConfig) => {
|
|
24
|
-
searchDefaultConditions: "in";
|
|
25
|
-
type: string;
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
filterComponentType: "Input";
|
|
29
|
-
filterFn: (value: string) => (i: Record) => boolean;
|
|
30
|
-
formatFilterValue: (input: string) => string[];
|
|
31
|
-
};
|
|
32
5
|
}
|
|
33
6
|
export default ErpTradeId;
|
|
@@ -2,115 +2,44 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
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
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
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
6
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
9
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
5
12
|
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
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
14
|
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
15
|
import React from 'react';
|
|
9
|
-
import { TradeId } from '@kmkf-fe-packages/basic-components';
|
|
10
|
-
import copy from 'copy-to-clipboard';
|
|
11
|
-
import { message } from 'antd';
|
|
12
|
-
import { CopyOutlined } from '@ant-design/icons';
|
|
13
16
|
import GetFormItem from "../GetFormItem";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_defineProperty(this, "rules", void 0);
|
|
25
|
-
_defineProperty(this, "componentConfig", void 0);
|
|
26
|
-
_defineProperty(this, "isCombinationComponent", void 0);
|
|
27
|
-
_defineProperty(this, "formField", void 0);
|
|
28
|
-
_defineProperty(this, "canSort", void 0);
|
|
29
|
-
_defineProperty(this, "children", void 0);
|
|
30
|
-
_defineProperty(this, "dataType", void 0);
|
|
31
|
-
_defineProperty(this, "renderClient", function (record) {
|
|
32
|
-
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
33
|
-
id: _this.id,
|
|
34
|
-
label: _this.name,
|
|
35
|
-
value: record === null || record === void 0 ? void 0 : record[_this.id]
|
|
36
|
-
}) : null;
|
|
37
|
-
});
|
|
38
|
-
_defineProperty(this, "copyHandle", function (text) {
|
|
39
|
-
copy(text);
|
|
40
|
-
message.success('复制成功');
|
|
41
|
-
});
|
|
42
|
-
_defineProperty(this, "renderPc", function (value, record) {
|
|
43
|
-
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_tradeId")]) === undefined) {
|
|
44
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, "--");
|
|
17
|
+
import TradeId from "../TradeId";
|
|
18
|
+
import OrderNo from "./components/OrderNum";
|
|
19
|
+
var ErpTradeId = /*#__PURE__*/function (_TradeId) {
|
|
20
|
+
_inherits(ErpTradeId, _TradeId);
|
|
21
|
+
var _super = _createSuper(ErpTradeId);
|
|
22
|
+
function ErpTradeId() {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, ErpTradeId);
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
45
27
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
cursor: 'pointer'
|
|
59
|
-
}
|
|
60
|
-
}, /*#__PURE__*/React.createElement(CopyOutlined, null)))));
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(this, "renderLog", function (r) {
|
|
63
|
-
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_tradeId")])) return null;
|
|
64
|
-
return _this.renderPc(undefined, r);
|
|
65
|
-
});
|
|
66
|
-
_defineProperty(this, "getComponentValue", function (r) {
|
|
67
|
-
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_tradeId")];
|
|
68
|
-
});
|
|
69
|
-
_defineProperty(this, "renderExport", function (value, record) {
|
|
70
|
-
var _record;
|
|
71
|
-
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_tradeId")]) !== null && _record !== void 0 ? _record : '--';
|
|
72
|
-
});
|
|
73
|
-
_defineProperty(this, "editRender", function (p) {
|
|
74
|
-
var _this$componentConfig, _this$componentConfig2;
|
|
75
|
-
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
76
|
-
title: _this.name,
|
|
77
|
-
name: _this.id,
|
|
78
|
-
rules: _this.rules,
|
|
79
|
-
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
80
|
-
display: p === null || p === void 0 ? void 0 : p.display,
|
|
81
|
-
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,
|
|
82
|
-
component: /*#__PURE__*/React.createElement(TradeId, null)
|
|
28
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "editRender", function (p) {
|
|
30
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
31
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
32
|
+
title: _this.name,
|
|
33
|
+
name: _this.id,
|
|
34
|
+
rules: _this.rules,
|
|
35
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
36
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
37
|
+
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,
|
|
38
|
+
component: /*#__PURE__*/React.createElement(OrderNo, null)
|
|
39
|
+
});
|
|
83
40
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
type: item.type,
|
|
89
|
-
id: "".concat(item.id, "_tradeId"),
|
|
90
|
-
// 过滤组件id
|
|
91
|
-
name: item.name,
|
|
92
|
-
// 过滤组件名称
|
|
93
|
-
filterComponentType: 'Input',
|
|
94
|
-
filterFn: function filterFn(value) {
|
|
95
|
-
return function (i) {
|
|
96
|
-
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, 'tradeId'), value);
|
|
97
|
-
};
|
|
98
|
-
},
|
|
99
|
-
formatFilterValue: function formatFilterValue(input) {
|
|
100
|
-
return input.split(/[,|,]/);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
this.name = options.name;
|
|
105
|
-
this.id = options.id;
|
|
106
|
-
this.sortField = "".concat(options.id, "_tradeId");
|
|
107
|
-
this.formField = "".concat(options.id, "_tradeId");
|
|
108
|
-
this.type = options.type;
|
|
109
|
-
this.componentConfig = options.componentConfig;
|
|
110
|
-
this.rules = [];
|
|
111
|
-
this.isCombinationComponent = false;
|
|
112
|
-
this.canSort = true;
|
|
113
|
-
this.children = [];
|
|
114
|
-
this.dataType = 'string';
|
|
115
|
-
});
|
|
41
|
+
return _this;
|
|
42
|
+
}
|
|
43
|
+
return _createClass(ErpTradeId);
|
|
44
|
+
}(TradeId);
|
|
116
45
|
export default ErpTradeId;
|
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, CommonDataTime, TradeId, ShopName,
|
|
1
|
+
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, CommonInput, PaymentVoucherCode } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) =>
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | CommonInput | PaymentVoucherCode;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -84,3 +84,4 @@ export { default as ShopList } from "./commonComponents/ShopList";
|
|
|
84
84
|
export { default as OperationLog } from "./commonComponents/OperationLog";
|
|
85
85
|
export { default as GetFormItem } from "./components/GetFormItem";
|
|
86
86
|
export { default as Global } from "./commonComponents/GlobalContext";
|
|
87
|
+
export * as ErpScenes from "./commonComponents/ErpContext";
|
package/dist/esm/index.js
CHANGED
|
@@ -83,4 +83,6 @@ export { default as PlatBuyer } from "./commonComponents/PlatBuyer";
|
|
|
83
83
|
export { default as ShopList } from "./commonComponents/ShopList";
|
|
84
84
|
export { default as OperationLog } from "./commonComponents/OperationLog";
|
|
85
85
|
export { default as GetFormItem } from "./components/GetFormItem";
|
|
86
|
-
export { default as Global } from "./commonComponents/GlobalContext";
|
|
86
|
+
export { default as Global } from "./commonComponents/GlobalContext";
|
|
87
|
+
import * as _ErpScenes from "./commonComponents/ErpContext";
|
|
88
|
+
export { _ErpScenes as ErpScenes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "0.28.1",
|
|
3
|
+
"version": "0.28.2-alpha.1",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "e05898cc93b5d09d48e1eb82ee39e45bfcd23af8",
|
|
41
41
|
"gitHooks": {
|
|
42
42
|
"pre-commit": "lint-staged"
|
|
43
43
|
}
|