@kmkf-fe-packages/services-components 2.0.79-beta.28 → 2.0.79-beta.30
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/Hooks/index.d.ts +2 -0
- package/dist/esm/Hooks/index.js +2 -0
- package/dist/esm/Hooks/useColumnsConfig.d.ts +26 -0
- package/dist/esm/Hooks/useColumnsConfig.js +241 -0
- package/dist/esm/Hooks/useGoodsSourceFormat.d.ts +29 -0
- package/dist/esm/Hooks/useGoodsSourceFormat.js +322 -0
- package/dist/esm/components/GY/GyGoods/index.js +2 -0
- package/dist/esm/components/GY/GyReissue/index.js +2 -0
- package/dist/esm/components/GY/GyReturn/index.js +2 -0
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/type.d.ts +37 -0
- package/package.json +4 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import LogisticsInterception from "../components/LogisticsInterception";
|
|
2
|
+
import LogisticsMoreInterception from "../components/LogisticsMoreInterception";
|
|
3
|
+
export declare const newRenderColumnItem: (effects: any) => (item: any) => import("../components/AfterSalesOrderId").default | import("../components/BuyerNick").default | import("../components/Checkbox").default | import("../components/CommonMultiStatus").default | import("../components/File").default | import("../components/FlowStatusSelect").default | import("../components/Input").default | import("../components/Address").default | import("../components/Cascader").default | import("../components/DataTime").default | import("../components/Select").default | import("../components/Radio").default | import("../components/TextArea").default | import("../components/Picture").default | import("../components/PicturePro").default | import("../components/MultSelect").default | import("../components/Grade").default | import("../components/Rate").default | import("../components/PostIng").default | import("../components/SubForm").default | import("../components/CommonDataTime").default | import("../components/TradeId").default | import("../components/ShopName").default | import("../components/ReceiverName").default | import("../components/ReceiverMobile").default | import("../components/ReceiverAddress").default | import("../components/TradeDateTime").default | import("../components/Logistics").default | import("../components/ReturnLogistics").default | import("../components/ActualPayment").default | import("../components/Remark").default | import("../components/Alipay").default | import("../components/EItemSelect").default | import("../components/EItemId").default | import("../components/EItemEnCode").default | import("../components/SystemOrderNo").default | import("../components/Ordinary").default | import("../components/ThirdItemSelect").default | import("../components/Payment").default | import("../components/Reissue/Logistics").default | import("../components/JST/JstItemSelect").default | import("../components/JST/JstSendGood").default | import("../components/JST/JstSupply").default | import("../components/BS/BsSystemOrder").default | import("../components/BS/BsGoods").default | import("../components/BsE3/BsGoods").default | import("../components/Public/Goods").default | import("../components/Public/ReissueGoods").default | import("../components/Public/Exchange").default | import("../components/BsE3/BsReissueE3").default | import("../components/BS/BsExchange").default | import("../components/BS/BsReissue").default | import("../components/BS/BsReturn").default | import("../components/BS/BsLogistics").default | import("../components/FlowMarkSelect").default | import("../components/FlowTag").default | import("../components/TemplateSelect").default | import("../components/WorkOrderId").default | LogisticsInterception | LogisticsMoreInterception | import("../components/LogisticsTrajectory").default | import("../components/LogisticsMoreTrajectory").default | import("../components/PlatForm").default | import("../components/ShopInput").default | import("../components/Submitter").default | import("../components/PrevSubmitter").default | import("../components/FlowCreator").default | import("../components/Handler").default | import("../components/CompletedUser").default | import("../components/FlowWorkOrderId").default | import("../components/StatusSelect").default | import("../components/Calculation").default | import("../components/CommonSystemOrder").default | import("../components/NodeDeadLine").default | import("../components/HandlerDeadLine").default | import("../components/NodeStayDuration").default | import("../components/WLN/WlnGoods").default | import("../components/BS/BsPosting").default | import("../components/NodeInput").default | import("../components/FlowWorkOrderStatus").default | import("../components/MsgStatus").default | import("../components/WDT/WdtGoods").default | import("../components/WDT/WdtRessuie").default | import("../components/WDT/WdtReturn").default | import("../components/WDT/WdtExchange").default | import("../components/WDT/WdtShopSelect").default | import("../components/KM/KmVideo").default | import("../components/CommonInput").default | import("../components/PaymentVoucherCode").default | import("../components/Label").default | import("../components/MemberLevel").default | import("../components/GY/GyReissue").default | import("../components/GY/GyReturn").default | import("../components/Public/AsyncSelect").default | import("../components/GY/GyGoods").default;
|
|
4
|
+
export declare const useColumnsConfig: ({ queryWorkOrderDetail, flatTemplateList, shopList, sortState, onChangeSort, handleReset, handleSubmit, handleChangeSingleWorkOrderMark, userList, tbAppKey, isShare, openSingleColumnsFilter, openSingleColumnsSort, }: {
|
|
5
|
+
queryWorkOrderDetail?: ((p: any) => void) | undefined;
|
|
6
|
+
flatTemplateList?: any;
|
|
7
|
+
shopList?: any[] | undefined;
|
|
8
|
+
userList?: any[] | undefined;
|
|
9
|
+
sortState?: {
|
|
10
|
+
id: string;
|
|
11
|
+
sort: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
onChangeSort?: ((p: {
|
|
14
|
+
id: string;
|
|
15
|
+
sort: string;
|
|
16
|
+
}) => void) | undefined;
|
|
17
|
+
handleReset?: ((id: string) => void) | undefined;
|
|
18
|
+
handleSubmit?: (() => void) | undefined;
|
|
19
|
+
handleChangeSingleWorkOrderMark?: ((p: any, v: any) => void) | undefined;
|
|
20
|
+
isShare?: boolean | undefined;
|
|
21
|
+
openSingleColumnsFilter?: boolean | undefined;
|
|
22
|
+
openSingleColumnsSort?: boolean | undefined;
|
|
23
|
+
tbAppKey?: string | undefined;
|
|
24
|
+
}) => {
|
|
25
|
+
tableColumnConfig: (cur: any, nxt: any) => any;
|
|
26
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
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
|
+
import React from "react";
|
|
14
|
+
import { Tooltip } from "antd";
|
|
15
|
+
import { useState, useCallback, useMemo } from "react";
|
|
16
|
+
import { factory } from "../factory";
|
|
17
|
+
import LogisticsInterception from "../components/LogisticsInterception";
|
|
18
|
+
import LogisticsMoreInterception from "../components/LogisticsMoreInterception";
|
|
19
|
+
import { TEMPLATE_TYPE, DATA_SPLIT_COMPONENT_FIELDS_MAP } from "@kmkf-fe-packages/kmkf-utils";
|
|
20
|
+
|
|
21
|
+
//工单列表左对齐
|
|
22
|
+
var workOrderListAlignLeft = ['KM_VIDEO'];
|
|
23
|
+
var cantFilterType = ["CREATED_DATETIME", "UPDATE_DATETIME", "COMPLETED_DATETIME", "JST_LOGISTICS", "JST_ITEM_SELECT_THIRD", "JST_SUPPLY", "JST_SEND_GOOD", "TEXTAREA", "BS_SEND_GOOD", "BS_LOGISTICS", "BS_DELIVERY_NO", "WLN_SEND_GOOD", "WLN_LOGISTICS", "WDT_SEND_GOOD", "WDT_LOGISTICS", "KM_LOGISTICS", "REISSUE_LOGISTICS", "KM_SEND_GOOD", "GY_SEND_GOOD", "GY_LOGISTICS"];
|
|
24
|
+
var cantShareFilterType = ["WORK_ORDER_ID_INPUT", "OPERATOR_INPUT", "HANDLER_INPUT", "COMPLETED_USER_INPUT"];
|
|
25
|
+
//需要拆行的组件
|
|
26
|
+
var SplitRowsType = Object.keys(DATA_SPLIT_COMPONENT_FIELDS_MAP);
|
|
27
|
+
var canFilterFn = function canFilterFn(type, isShare) {
|
|
28
|
+
if (isShare && cantShareFilterType !== null && cantShareFilterType !== void 0 && cantShareFilterType.includes(type)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (cantFilterType !== null && cantFilterType !== void 0 && cantFilterType.includes(type)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return type !== TEMPLATE_TYPE;
|
|
35
|
+
};
|
|
36
|
+
var getChildrenColumnsHoc = function getChildrenColumnsHoc(_ref) {
|
|
37
|
+
var sort = _ref.sort,
|
|
38
|
+
handleReset = _ref.handleReset,
|
|
39
|
+
handleSubmit = _ref.handleSubmit,
|
|
40
|
+
onChangeSort = _ref.onChangeSort,
|
|
41
|
+
isShare = _ref.isShare,
|
|
42
|
+
openSingleColumnsFilter = _ref.openSingleColumnsFilter,
|
|
43
|
+
openSingleColumnsSort = _ref.openSingleColumnsSort;
|
|
44
|
+
return function (instance, nxt) {
|
|
45
|
+
var canFilter = canFilterFn(instance.type, isShare);
|
|
46
|
+
if (instance !== null && instance !== void 0 && instance.isCombinationComponent) {
|
|
47
|
+
var _instance$children;
|
|
48
|
+
var filterOptionList = instance === null || instance === void 0 ? void 0 : instance.filterConfig(nxt);
|
|
49
|
+
return instance === null || instance === void 0 ? void 0 : (_instance$children = instance.children) === null || _instance$children === void 0 ? void 0 : _instance$children.map(function (item) {
|
|
50
|
+
return {
|
|
51
|
+
name: item.name,
|
|
52
|
+
title: item.name,
|
|
53
|
+
dataIndex: item.id,
|
|
54
|
+
id: item.id,
|
|
55
|
+
//todo 单元格合并
|
|
56
|
+
children: getChildrenColumnsHoc({
|
|
57
|
+
sort: sort,
|
|
58
|
+
handleReset: handleReset,
|
|
59
|
+
handleSubmit: handleSubmit,
|
|
60
|
+
onChangeSort: onChangeSort,
|
|
61
|
+
isShare: isShare,
|
|
62
|
+
openSingleColumnsFilter: openSingleColumnsFilter,
|
|
63
|
+
openSingleColumnsSort: openSingleColumnsSort
|
|
64
|
+
})(item, nxt),
|
|
65
|
+
render: function render(text, record) {
|
|
66
|
+
if (["MSG_STATUS"].includes(item === null || item === void 0 ? void 0 : item.type)) return item === null || item === void 0 ? void 0 : item.renderPc(text, record);
|
|
67
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
68
|
+
title: item !== null && item !== void 0 && item.renderPcTooltip ? item === null || item === void 0 ? void 0 : item.renderPcTooltip(text, record) : item === null || item === void 0 ? void 0 : item.renderPc(text, record),
|
|
69
|
+
placement: "topLeft"
|
|
70
|
+
}, item === null || item === void 0 ? void 0 : item.renderPc(text, record));
|
|
71
|
+
},
|
|
72
|
+
width: item === null || item === void 0 ? void 0 : item.width,
|
|
73
|
+
renderExport: item === null || item === void 0 ? void 0 : item.renderExport,
|
|
74
|
+
align: workOrderListAlignLeft.includes(instance === null || instance === void 0 ? void 0 : instance.type) ? "left" : "center",
|
|
75
|
+
features: {
|
|
76
|
+
autoRowSpan: function autoRowSpan(prevValue, value, prevRow, row) {
|
|
77
|
+
var _prevRow$rowKey, _row$rowKey;
|
|
78
|
+
if (SplitRowsType.includes(item.type)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
var _ref2 = (prevRow === null || prevRow === void 0 ? void 0 : (_prevRow$rowKey = prevRow.rowKey) === null || _prevRow$rowKey === void 0 ? void 0 : _prevRow$rowKey.split("-")) || [],
|
|
82
|
+
_ref3 = _slicedToArray(_ref2, 1),
|
|
83
|
+
lastKey = _ref3[0];
|
|
84
|
+
var _ref4 = (row === null || row === void 0 ? void 0 : (_row$rowKey = row.rowKey) === null || _row$rowKey === void 0 ? void 0 : _row$rowKey.split("-")) || [],
|
|
85
|
+
_ref5 = _slicedToArray(_ref4, 1),
|
|
86
|
+
currentKey = _ref5[0];
|
|
87
|
+
return lastKey === currentKey;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return [];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export var newRenderColumnItem = function newRenderColumnItem(effects) {
|
|
97
|
+
return function (item) {
|
|
98
|
+
var instance = factory(item.type, {
|
|
99
|
+
id: item.id,
|
|
100
|
+
name: item.name,
|
|
101
|
+
type: item.type,
|
|
102
|
+
componentConfig: _objectSpread(_objectSpread({}, item === null || item === void 0 ? void 0 : item.config), item === null || item === void 0 ? void 0 : item.templateConfig),
|
|
103
|
+
effects: effects,
|
|
104
|
+
renderExport: function renderExport() {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return instance;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export var useColumnsConfig = function useColumnsConfig(_ref6) {
|
|
112
|
+
var queryWorkOrderDetail = _ref6.queryWorkOrderDetail,
|
|
113
|
+
flatTemplateList = _ref6.flatTemplateList,
|
|
114
|
+
shopList = _ref6.shopList,
|
|
115
|
+
sortState = _ref6.sortState,
|
|
116
|
+
_ref6$onChangeSort = _ref6.onChangeSort,
|
|
117
|
+
onChangeSort = _ref6$onChangeSort === void 0 ? function () {} : _ref6$onChangeSort,
|
|
118
|
+
handleReset = _ref6.handleReset,
|
|
119
|
+
handleSubmit = _ref6.handleSubmit,
|
|
120
|
+
handleChangeSingleWorkOrderMark = _ref6.handleChangeSingleWorkOrderMark,
|
|
121
|
+
userList = _ref6.userList,
|
|
122
|
+
tbAppKey = _ref6.tbAppKey,
|
|
123
|
+
_ref6$isShare = _ref6.isShare,
|
|
124
|
+
isShare = _ref6$isShare === void 0 ? false : _ref6$isShare,
|
|
125
|
+
_ref6$openSingleColum = _ref6.openSingleColumnsFilter,
|
|
126
|
+
openSingleColumnsFilter = _ref6$openSingleColum === void 0 ? true : _ref6$openSingleColum,
|
|
127
|
+
_ref6$openSingleColum2 = _ref6.openSingleColumnsSort,
|
|
128
|
+
openSingleColumnsSort = _ref6$openSingleColum2 === void 0 ? true : _ref6$openSingleColum2;
|
|
129
|
+
var _useState = useState({
|
|
130
|
+
fixedColumns: [],
|
|
131
|
+
nonFixedColumns: []
|
|
132
|
+
}),
|
|
133
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
134
|
+
columnsConfig = _useState2[0],
|
|
135
|
+
setColumnsConfig = _useState2[1];
|
|
136
|
+
var getChildrenColumns = useMemo(function () {
|
|
137
|
+
return getChildrenColumnsHoc({
|
|
138
|
+
sort: sortState,
|
|
139
|
+
handleReset: handleReset,
|
|
140
|
+
handleSubmit: handleSubmit,
|
|
141
|
+
onChangeSort: onChangeSort,
|
|
142
|
+
isShare: isShare,
|
|
143
|
+
openSingleColumnsFilter: openSingleColumnsFilter,
|
|
144
|
+
openSingleColumnsSort: openSingleColumnsSort
|
|
145
|
+
});
|
|
146
|
+
}, [sortState, handleReset, handleSubmit, isShare, openSingleColumnsFilter, openSingleColumnsSort, onChangeSort]);
|
|
147
|
+
var Title = function Title(instance) {
|
|
148
|
+
if (instance instanceof LogisticsInterception || instance instanceof LogisticsMoreInterception) {
|
|
149
|
+
return instance === null || instance === void 0 ? void 0 : instance.columnHeader;
|
|
150
|
+
} else {
|
|
151
|
+
return instance === null || instance === void 0 ? void 0 : instance.name;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
var tableColumnConfig = useCallback(function (fixed) {
|
|
155
|
+
return function (cur, nxt) {
|
|
156
|
+
var canFilter = canFilterFn(nxt.type, isShare);
|
|
157
|
+
var instance = newRenderColumnItem({
|
|
158
|
+
queryWorkOrderDetail: queryWorkOrderDetail,
|
|
159
|
+
templateList: flatTemplateList,
|
|
160
|
+
shopList: shopList,
|
|
161
|
+
handleChangeSingleWorkOrderMark: handleChangeSingleWorkOrderMark,
|
|
162
|
+
userList: userList,
|
|
163
|
+
tbAppKey: tbAppKey
|
|
164
|
+
})(nxt);
|
|
165
|
+
var params = _objectSpread(_objectSpread({}, instance), {}, {
|
|
166
|
+
title: Title(instance),
|
|
167
|
+
dataIndex: instance.id,
|
|
168
|
+
children: getChildrenColumns(instance, nxt),
|
|
169
|
+
width: nxt.width,
|
|
170
|
+
// onHeaderCell: c => {
|
|
171
|
+
// return {
|
|
172
|
+
// width: c.width,
|
|
173
|
+
// onResizeStop: width => {
|
|
174
|
+
// setComponentWidth(c.dataIndex, width);
|
|
175
|
+
// handleResizeStop(c.dataIndex)(width);
|
|
176
|
+
// },
|
|
177
|
+
// };
|
|
178
|
+
// },
|
|
179
|
+
render: function render(text, record) {
|
|
180
|
+
if (["MSG_STATUS"].includes(instance === null || instance === void 0 ? void 0 : instance.type)) return instance === null || instance === void 0 ? void 0 : instance.renderPc(text, record);
|
|
181
|
+
var getToolTipTitle = function getToolTipTitle() {
|
|
182
|
+
if ((instance === null || instance === void 0 ? void 0 : instance.type) === "TEXTAREA") {
|
|
183
|
+
return /*#__PURE__*/React.createElement("div", null, instance === null || instance === void 0 ? void 0 : instance.getComponentValue(record));
|
|
184
|
+
} else {
|
|
185
|
+
return instance !== null && instance !== void 0 && instance.renderPcTooltip ? instance === null || instance === void 0 ? void 0 : instance.renderPcTooltip(text, record) : instance === null || instance === void 0 ? void 0 : instance.renderPc(text, record);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
189
|
+
title: getToolTipTitle(),
|
|
190
|
+
placement: "topLeft"
|
|
191
|
+
}, instance === null || instance === void 0 ? void 0 : instance.renderPc(text, record));
|
|
192
|
+
},
|
|
193
|
+
//todo 合并单元格
|
|
194
|
+
onCell: function onCell(record, rowIndex) {
|
|
195
|
+
if (SplitRowsType.includes(instance.type)) {
|
|
196
|
+
return {
|
|
197
|
+
rowSpan: 1
|
|
198
|
+
};
|
|
199
|
+
} else {
|
|
200
|
+
if (rowIndex === record.startIndex) {
|
|
201
|
+
return {
|
|
202
|
+
rowSpan: record.rowSpan
|
|
203
|
+
};
|
|
204
|
+
} else {
|
|
205
|
+
return {
|
|
206
|
+
rowSpan: 0
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
features: {
|
|
212
|
+
autoRowSpan: function autoRowSpan(prevValue, value, prevRow, row) {
|
|
213
|
+
var _prevRow$rowKey2, _row$rowKey2;
|
|
214
|
+
if (SplitRowsType.includes(instance.type)) {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
var _ref7 = (prevRow === null || prevRow === void 0 ? void 0 : (_prevRow$rowKey2 = prevRow.rowKey) === null || _prevRow$rowKey2 === void 0 ? void 0 : _prevRow$rowKey2.split("-")) || [],
|
|
218
|
+
_ref8 = _slicedToArray(_ref7, 1),
|
|
219
|
+
lastKey = _ref8[0];
|
|
220
|
+
var _ref9 = (row === null || row === void 0 ? void 0 : (_row$rowKey2 = row.rowKey) === null || _row$rowKey2 === void 0 ? void 0 : _row$rowKey2.split("-")) || [],
|
|
221
|
+
_ref10 = _slicedToArray(_ref9, 1),
|
|
222
|
+
currentKey = _ref10[0];
|
|
223
|
+
return lastKey === currentKey;
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
lock: fixed,
|
|
227
|
+
align: workOrderListAlignLeft.includes(instance === null || instance === void 0 ? void 0 : instance.type) ? "left" : "center"
|
|
228
|
+
});
|
|
229
|
+
if (fixed) {
|
|
230
|
+
// @ts-ignore
|
|
231
|
+
params.fixed = "left";
|
|
232
|
+
}
|
|
233
|
+
cur.push(params);
|
|
234
|
+
// console.log(cur);
|
|
235
|
+
return cur;
|
|
236
|
+
};
|
|
237
|
+
}, [flatTemplateList, getChildrenColumns, handleChangeSingleWorkOrderMark, handleReset, handleSubmit, isShare, onChangeSort, openSingleColumnsFilter, openSingleColumnsSort, queryWorkOrderDetail, shopList, sortState, tbAppKey, userList]);
|
|
238
|
+
return {
|
|
239
|
+
tableColumnConfig: tableColumnConfig(false)
|
|
240
|
+
};
|
|
241
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface } from "../type";
|
|
3
|
+
export declare const useGoodsSourceFormat: (goodsSource?: NonNullable<ComponentInterface["componentConfig"]>["goodsSource"]) => {
|
|
4
|
+
flowTemplateKey: string | undefined;
|
|
5
|
+
flowNodeId: string | undefined;
|
|
6
|
+
templateKey: string | undefined;
|
|
7
|
+
filterItems: any[];
|
|
8
|
+
tableColumns: any[];
|
|
9
|
+
ShopList: ({ disabledList, shopList, valueMapping, onChange, setShopId, ...prop }: {
|
|
10
|
+
[prop: string]: any;
|
|
11
|
+
disabledList?: string[] | undefined;
|
|
12
|
+
shopList: {
|
|
13
|
+
auditStatus: number;
|
|
14
|
+
shopId: string;
|
|
15
|
+
shopName: string;
|
|
16
|
+
shopSource: string | number;
|
|
17
|
+
useStatus: number;
|
|
18
|
+
}[];
|
|
19
|
+
}) => import("react").JSX.Element;
|
|
20
|
+
workOrderDataToGoods: (data: any, erp: string) => Record<string, any>;
|
|
21
|
+
queryComponentsConfig: {
|
|
22
|
+
filterType: "some" | "every" | undefined;
|
|
23
|
+
preQueryComponents: {
|
|
24
|
+
key: string;
|
|
25
|
+
symbol: any;
|
|
26
|
+
value: any;
|
|
27
|
+
}[] | undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
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
|
+
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); }
|
|
17
|
+
import { DEFAULT_FIELD_TYPE_LIST, servers, TEMPLATE_ID } from "@kmkf-fe-packages/kmkf-utils";
|
|
18
|
+
import { useEffect, useState } from "react";
|
|
19
|
+
import ShopList from "../commonComponents/ShopList";
|
|
20
|
+
import { factory } from "../factory";
|
|
21
|
+
import { useColumnsConfig } from "./useColumnsConfig";
|
|
22
|
+
var toArray = function toArray(data) {
|
|
23
|
+
if (Array.isArray(data)) return data;
|
|
24
|
+
if (data && _typeof(data) === "object") return [data];
|
|
25
|
+
return [];
|
|
26
|
+
};
|
|
27
|
+
var stringToNumber = function stringToNumber(str) {
|
|
28
|
+
// 检查输入是否为字符串类型
|
|
29
|
+
if (typeof str !== "string") return str;
|
|
30
|
+
|
|
31
|
+
// 去除首尾空白字符
|
|
32
|
+
str = str.trim();
|
|
33
|
+
|
|
34
|
+
// 检查是否为空字符串
|
|
35
|
+
if (str === "") {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
var num = Number(str);
|
|
39
|
+
if (isNaN(num)) {
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
return num;
|
|
43
|
+
};
|
|
44
|
+
var getPublishFlowDetail = function getPublishFlowDetail(flowTemplateKey) {
|
|
45
|
+
return servers.singletonWrap(function () {
|
|
46
|
+
return servers.getPublishFlowDetail(flowTemplateKey);
|
|
47
|
+
}, {
|
|
48
|
+
name: "getPublishFlowDetail",
|
|
49
|
+
key: flowTemplateKey,
|
|
50
|
+
cacheTime: 1000 * 10
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
var queryColumnsConfig = function queryColumnsConfig(params) {
|
|
54
|
+
return servers.singletonWrap(function () {
|
|
55
|
+
return servers.queryColumnsConfig(_objectSpread({
|
|
56
|
+
isGroupNode: false
|
|
57
|
+
}, params));
|
|
58
|
+
}, {
|
|
59
|
+
name: "queryColumnsConfig",
|
|
60
|
+
key: "".concat(params.flowTemplateKey, "_").concat(params.nodeId, "_").concat(params.templateId),
|
|
61
|
+
cacheTime: 1000 * 10
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
var sortArr = function sortArr(arr) {
|
|
65
|
+
return arr.sort(function (_ref, _ref2) {
|
|
66
|
+
var a = _ref.index;
|
|
67
|
+
var b = _ref2.index;
|
|
68
|
+
// 检查 a 和 b 是否为数字
|
|
69
|
+
var aIsNum = typeof a === "number" && !isNaN(a);
|
|
70
|
+
var bIsNum = typeof b === "number" && !isNaN(b);
|
|
71
|
+
if (aIsNum && bIsNum) {
|
|
72
|
+
// 都是数字,按数值大小排序
|
|
73
|
+
return a - b;
|
|
74
|
+
} else if (aIsNum) {
|
|
75
|
+
// a 是数字,b 不是,a 排在前面
|
|
76
|
+
return -1;
|
|
77
|
+
} else if (bIsNum) {
|
|
78
|
+
// b 是数字,a 不是,b 排在前面
|
|
79
|
+
return 1;
|
|
80
|
+
} else {
|
|
81
|
+
// 都不是数字,保持相对顺序(或都排最后)
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
var findIndex = function findIndex(field, dataFilterConfig) {
|
|
87
|
+
var smallest = Number.MAX_VALUE;
|
|
88
|
+
field.children.forEach(function (child) {
|
|
89
|
+
var _child$children, _dataFilterConfig;
|
|
90
|
+
var key = child.dataIndex || child.formField;
|
|
91
|
+
var index = (_child$children = child.children) !== null && _child$children !== void 0 && _child$children.length ? findIndex(child, dataFilterConfig) : (_dataFilterConfig = dataFilterConfig[key]) === null || _dataFilterConfig === void 0 ? void 0 : _dataFilterConfig.index;
|
|
92
|
+
if (typeof index === "number" && index < smallest) {
|
|
93
|
+
smallest = index;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return smallest < Number.MAX_VALUE ? smallest : void 0;
|
|
97
|
+
};
|
|
98
|
+
var filterTableColumn = function filterTableColumn(cols, dataFilterConfig) {
|
|
99
|
+
return cols.filter(function (col) {
|
|
100
|
+
var _col$children;
|
|
101
|
+
if ((_col$children = col.children) !== null && _col$children !== void 0 && _col$children.length) {
|
|
102
|
+
var _col$children2;
|
|
103
|
+
// 如果是复合组件
|
|
104
|
+
col.children = filterTableColumn(col.children, dataFilterConfig);
|
|
105
|
+
return (_col$children2 = col.children) === null || _col$children2 === void 0 ? void 0 : _col$children2.length;
|
|
106
|
+
} else {
|
|
107
|
+
var _dataFilterConfig2;
|
|
108
|
+
var _key = col.dataIndex || col.formField;
|
|
109
|
+
return ((_dataFilterConfig2 = dataFilterConfig[_key]) === null || _dataFilterConfig2 === void 0 ? void 0 : _dataFilterConfig2.isShow) || !col.type || !(DEFAULT_FIELD_TYPE_LIST.includes(col.type) || col.type === TEMPLATE_ID);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
export var useGoodsSourceFormat = function useGoodsSourceFormat(goodsSource) {
|
|
114
|
+
var _goodsSource$sourceSe;
|
|
115
|
+
var _useState = useState([]),
|
|
116
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
117
|
+
filterItems = _useState2[0],
|
|
118
|
+
setFilterItems = _useState2[1];
|
|
119
|
+
var _useState3 = useState([]),
|
|
120
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
121
|
+
allTableColumns = _useState4[0],
|
|
122
|
+
setAllTableColumns = _useState4[1];
|
|
123
|
+
var _useState5 = useState(),
|
|
124
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
125
|
+
flowTemplateKey = _useState6[0],
|
|
126
|
+
setFlowTemplateKey = _useState6[1];
|
|
127
|
+
var _useState7 = useState(),
|
|
128
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
129
|
+
flowNodeId = _useState8[0],
|
|
130
|
+
setFlowNodeId = _useState8[1];
|
|
131
|
+
var _useState9 = useState(),
|
|
132
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
133
|
+
templateKey = _useState10[0],
|
|
134
|
+
setTemplateKey = _useState10[1];
|
|
135
|
+
// 表格展示列头
|
|
136
|
+
var _useState11 = useState([]),
|
|
137
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
138
|
+
tableColumns = _useState12[0],
|
|
139
|
+
setTableColumns = _useState12[1];
|
|
140
|
+
// console.log(`**** 数据源配置:`, { goodsSource, filterItems });
|
|
141
|
+
|
|
142
|
+
var queryComponentsConfig = {
|
|
143
|
+
filterType: goodsSource === null || goodsSource === void 0 ? void 0 : goodsSource.sourceSettings.filterMode,
|
|
144
|
+
preQueryComponents: goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe = goodsSource.sourceSettings.filterRules) === null || _goodsSource$sourceSe === void 0 ? void 0 : _goodsSource$sourceSe.map(function (rule) {
|
|
145
|
+
var _rule$leftValue, _rule$leftValue$split;
|
|
146
|
+
return {
|
|
147
|
+
key: (_rule$leftValue = rule.leftValue) === null || _rule$leftValue === void 0 ? void 0 : (_rule$leftValue$split = _rule$leftValue.split('.')[2]) === null || _rule$leftValue$split === void 0 ? void 0 : _rule$leftValue$split.replace(/#$/, ''),
|
|
148
|
+
symbol: rule.compareSymbol,
|
|
149
|
+
value: rule.rightValue
|
|
150
|
+
};
|
|
151
|
+
})
|
|
152
|
+
};
|
|
153
|
+
var _useColumnsConfig = useColumnsConfig({}),
|
|
154
|
+
tableColumnConfig = _useColumnsConfig.tableColumnConfig;
|
|
155
|
+
var workOrderDataToGoods = function workOrderDataToGoods(data, erp) {
|
|
156
|
+
// gy商品 接口返回,和选中的 都是这个
|
|
157
|
+
// brandName: "小白熊"
|
|
158
|
+
// brandNo: "BRD01"
|
|
159
|
+
// categoryName: "03母乳保存"
|
|
160
|
+
// categoryType: "18"
|
|
161
|
+
// companyKey: "SZF4ZGWZSNW6PYXMCIFEWBXT"
|
|
162
|
+
// costPrice: "13.1802"
|
|
163
|
+
// goodId: "535367779990"
|
|
164
|
+
// goodName: "母乳收集器(2只装)"
|
|
165
|
+
// goodNo: "XCP.01.03.20001"
|
|
166
|
+
// goodPicUrl: ""
|
|
167
|
+
// goodShortName: "08395"
|
|
168
|
+
// id: 162457
|
|
169
|
+
// isGift: false
|
|
170
|
+
// isSkuItem: true
|
|
171
|
+
// isVirtual: false
|
|
172
|
+
// platform: "GY_ERP"
|
|
173
|
+
// retailPrice: "59.0"
|
|
174
|
+
// specBarcode: "6951406983951"
|
|
175
|
+
// specId: "535367763578"
|
|
176
|
+
// specName: "2入装"
|
|
177
|
+
// specNo: "XCP.01.03.20001"
|
|
178
|
+
|
|
179
|
+
// 配置的值 keyMap
|
|
180
|
+
// amount: "adidBRdsfi"
|
|
181
|
+
// amountAfter: "qzBjJj8sfi"
|
|
182
|
+
// cancel: "qzBjJj8sfi"
|
|
183
|
+
// discountFee: "qzBjJj8sfi"
|
|
184
|
+
// goodName: "qzBjJj8sfi"
|
|
185
|
+
// goodNo: "Q8ZZHLWlki"
|
|
186
|
+
// goodShortName: "adidBRdsfi"
|
|
187
|
+
// isGift: "qzBjJj8sfi"
|
|
188
|
+
// originAmount: "qzBjJj8sfi"
|
|
189
|
+
// originPrice: "qzBjJj8sfi"
|
|
190
|
+
// price: "qzBjJj8sfi"
|
|
191
|
+
// qty: "qzBjJj8sfi"
|
|
192
|
+
// skuNote: "qzBjJj8sfi"
|
|
193
|
+
// specName: "qzBjJj8sfi"
|
|
194
|
+
// specNo: "qzBjJj8sfi"
|
|
195
|
+
// console.log("*** 商品 数据转换", {
|
|
196
|
+
// data,
|
|
197
|
+
// erp,
|
|
198
|
+
// keyMap: goodsSource?.sourceSettings.keyMap,
|
|
199
|
+
// });
|
|
200
|
+
var goods = {};
|
|
201
|
+
var keyMap = (goodsSource === null || goodsSource === void 0 ? void 0 : goodsSource.sourceSettings.keyMap) || {};
|
|
202
|
+
var ids = _toConsumableArray(new Set(Object.values(keyMap)));
|
|
203
|
+
var fieldMap = new Map();
|
|
204
|
+
ids.forEach(function (id) {
|
|
205
|
+
var field = allTableColumns.find(function (column) {
|
|
206
|
+
return column.id === id;
|
|
207
|
+
});
|
|
208
|
+
if (field) {
|
|
209
|
+
fieldMap.set(id, field);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
// console.log(`🚀 ~ 组件 ids:`, ids, allTableColumns, fieldMap);
|
|
213
|
+
Object.entries(keyMap).forEach(function (_ref3) {
|
|
214
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
215
|
+
key = _ref4[0],
|
|
216
|
+
id = _ref4[1];
|
|
217
|
+
var field = fieldMap.get(id);
|
|
218
|
+
if (!field) return;
|
|
219
|
+
// PS: 当前只有输入框/多行文本框/单选/下拉单选 所以不用考虑复合组件
|
|
220
|
+
var fillValue = field.formField ? data[field.formField] : void 0;
|
|
221
|
+
if (field.type === "RADIO" && data["".concat(field.id, "_radioOther")]) {
|
|
222
|
+
fillValue = data["".concat(field.id, "_radioOther")];
|
|
223
|
+
}
|
|
224
|
+
if (["isGift", "cancel"].includes(key)) {
|
|
225
|
+
fillValue = fillValue === "是" ? true : fillValue === "否" ? false : void 0;
|
|
226
|
+
}
|
|
227
|
+
goods[key] = ["qty", "price", "amount", "originPrice", "originAmount", "discountFee", "amountAfter"].includes(key) ? stringToNumber(fillValue) : fillValue;
|
|
228
|
+
});
|
|
229
|
+
goods.id = data.id;
|
|
230
|
+
// console.log("***** 转换之后的 values", goods);
|
|
231
|
+
return goods;
|
|
232
|
+
};
|
|
233
|
+
useEffect(function () {
|
|
234
|
+
if ((goodsSource === null || goodsSource === void 0 ? void 0 : goodsSource.source) === "workOrder") {
|
|
235
|
+
var _goodsSource$sourceSe2 = goodsSource.sourceSettings.workOrder,
|
|
236
|
+
_flowTemplateKey = _goodsSource$sourceSe2.flowTemplateKey,
|
|
237
|
+
nodeId = _goodsSource$sourceSe2.nodeId;
|
|
238
|
+
setFilterItems([]);
|
|
239
|
+
setAllTableColumns([]);
|
|
240
|
+
setFlowTemplateKey(_flowTemplateKey);
|
|
241
|
+
setFlowNodeId(nodeId);
|
|
242
|
+
setTemplateKey(undefined);
|
|
243
|
+
setTableColumns([]);
|
|
244
|
+
getPublishFlowDetail(_flowTemplateKey).then(function (_ref5) {
|
|
245
|
+
var _data$flowConfig, _data$flowConfig$node, _currentNodeInfo$rela;
|
|
246
|
+
var data = _ref5.data;
|
|
247
|
+
var currentNodeInfo = data === null || data === void 0 ? void 0 : (_data$flowConfig = data.flowConfig) === null || _data$flowConfig === void 0 ? void 0 : (_data$flowConfig$node = _data$flowConfig.nodes) === null || _data$flowConfig$node === void 0 ? void 0 : _data$flowConfig$node.find(function (node) {
|
|
248
|
+
return node.id === nodeId;
|
|
249
|
+
});
|
|
250
|
+
var workOrderTemplateId = currentNodeInfo === null || currentNodeInfo === void 0 ? void 0 : (_currentNodeInfo$rela = currentNodeInfo.relationEvent) === null || _currentNodeInfo$rela === void 0 ? void 0 : _currentNodeInfo$rela.workOrderTemplateId;
|
|
251
|
+
// console.log("**** in 获取到流程数据", {
|
|
252
|
+
// data,
|
|
253
|
+
// currentNodeInfo,
|
|
254
|
+
// workOrderTemplateId,
|
|
255
|
+
// });
|
|
256
|
+
if (workOrderTemplateId) {
|
|
257
|
+
queryColumnsConfig({
|
|
258
|
+
flowTemplateKey: _flowTemplateKey,
|
|
259
|
+
nodeId: nodeId,
|
|
260
|
+
templateId: workOrderTemplateId
|
|
261
|
+
}).then(function (_ref6) {
|
|
262
|
+
var _data$fixedColumns;
|
|
263
|
+
var data = _ref6.data;
|
|
264
|
+
var columnsList = data === null || data === void 0 ? void 0 : (_data$fixedColumns = data.fixedColumns) === null || _data$fixedColumns === void 0 ? void 0 : _data$fixedColumns.concat(data === null || data === void 0 ? void 0 : data.nonFixedColumns);
|
|
265
|
+
var newFilterItems = [];
|
|
266
|
+
columnsList === null || columnsList === void 0 ? void 0 : columnsList.forEach(function (l) {
|
|
267
|
+
var instance = factory(l.type, {
|
|
268
|
+
id: l.id,
|
|
269
|
+
name: l.name,
|
|
270
|
+
type: l.type,
|
|
271
|
+
componentConfig: _objectSpread(_objectSpread({}, l === null || l === void 0 ? void 0 : l.config), l === null || l === void 0 ? void 0 : l.templateConfig),
|
|
272
|
+
renderExport: function renderExport() {
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
var filterConfigList = toArray(instance === null || instance === void 0 ? void 0 : instance.filterConfig(l)).filter(function (item) {
|
|
277
|
+
var _goodsSource$sourceSe3;
|
|
278
|
+
return ((_goodsSource$sourceSe3 = goodsSource.sourceSettings.dataFilterConfig[item.id]) === null || _goodsSource$sourceSe3 === void 0 ? void 0 : _goodsSource$sourceSe3.isFilter) && !(DEFAULT_FIELD_TYPE_LIST.includes(item.type) || item.type === TEMPLATE_ID);
|
|
279
|
+
});
|
|
280
|
+
newFilterItems = newFilterItems.concat(filterConfigList.map(function (item) {
|
|
281
|
+
var _goodsSource$sourceSe4;
|
|
282
|
+
item.index = (_goodsSource$sourceSe4 = goodsSource.sourceSettings.dataFilterConfig[item.id]) === null || _goodsSource$sourceSe4 === void 0 ? void 0 : _goodsSource$sourceSe4.index;
|
|
283
|
+
return item;
|
|
284
|
+
}));
|
|
285
|
+
});
|
|
286
|
+
var allTableColumns = sortArr(columnsList.reduce(tableColumnConfig, []).map(function (item) {
|
|
287
|
+
var _item$children, _goodsSource$sourceSe5;
|
|
288
|
+
var _index = (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length ? findIndex(item, goodsSource.sourceSettings.dataFilterConfig) : (_goodsSource$sourceSe5 = goodsSource.sourceSettings.dataFilterConfig[item.sortField]) === null || _goodsSource$sourceSe5 === void 0 ? void 0 : _goodsSource$sourceSe5.index;
|
|
289
|
+
item.index = _index;
|
|
290
|
+
return item;
|
|
291
|
+
}));
|
|
292
|
+
var newTableColumns = filterTableColumn(allTableColumns, goodsSource.sourceSettings.dataFilterConfig);
|
|
293
|
+
setTableColumns(newTableColumns);
|
|
294
|
+
setFilterItems(sortArr(newFilterItems));
|
|
295
|
+
setAllTableColumns(allTableColumns);
|
|
296
|
+
setTemplateKey(workOrderTemplateId);
|
|
297
|
+
// console.log("**** in 获取到表头信息", {
|
|
298
|
+
// newTableColumns,
|
|
299
|
+
// data,
|
|
300
|
+
// newFilterItems,
|
|
301
|
+
// allTableColumns,
|
|
302
|
+
// });
|
|
303
|
+
}).catch(function (error) {
|
|
304
|
+
console.log("**** 获取表头信息 error", error);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}).catch(function (error) {
|
|
308
|
+
console.log("**** in 获取流程数据 error", error);
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}, []);
|
|
312
|
+
return {
|
|
313
|
+
flowTemplateKey: flowTemplateKey,
|
|
314
|
+
flowNodeId: flowNodeId,
|
|
315
|
+
templateKey: templateKey,
|
|
316
|
+
filterItems: filterItems,
|
|
317
|
+
tableColumns: tableColumns,
|
|
318
|
+
ShopList: ShopList,
|
|
319
|
+
workOrderDataToGoods: workOrderDataToGoods,
|
|
320
|
+
queryComponentsConfig: queryComponentsConfig
|
|
321
|
+
};
|
|
322
|
+
};
|
|
@@ -16,6 +16,7 @@ import ItemView from "../../../commonComponents/ItemView";
|
|
|
16
16
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
17
|
import { CommonGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
18
18
|
import { SYMBOL } from "../../../constant";
|
|
19
|
+
import { useGoodsSourceFormat } from "../../../Hooks";
|
|
19
20
|
var GyGoods = /*#__PURE__*/_createClass(function GyGoods(options) {
|
|
20
21
|
var _this = this,
|
|
21
22
|
_this$componentConfig6;
|
|
@@ -74,6 +75,7 @@ var GyGoods = /*#__PURE__*/_createClass(function GyGoods(options) {
|
|
|
74
75
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
75
76
|
tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
|
|
76
77
|
component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
|
|
78
|
+
useGoodsSourceFormat: useGoodsSourceFormat,
|
|
77
79
|
maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
|
|
78
80
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
79
81
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
@@ -17,6 +17,7 @@ import { SYMBOL } from "../../../constant";
|
|
|
17
17
|
import { BsGoodsTable } from "../../Common/index";
|
|
18
18
|
import { BsType, BsMemo, SystemOrderNo } from "../../BS/common/index";
|
|
19
19
|
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
20
|
+
import { useGoodsSourceFormat } from "../../../Hooks";
|
|
20
21
|
var typeMap = {
|
|
21
22
|
GY_REISSUE_GOODS: {
|
|
22
23
|
key: "gyReissueGoods",
|
|
@@ -105,6 +106,7 @@ var GyReissue = /*#__PURE__*/_createClass(function GyReissue(options) {
|
|
|
105
106
|
tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
|
|
106
107
|
isGyReissue: true,
|
|
107
108
|
component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
|
|
109
|
+
useGoodsSourceFormat: useGoodsSourceFormat,
|
|
108
110
|
maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
|
|
109
111
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
110
112
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
@@ -17,6 +17,7 @@ import { BsGoodsTable } from "../../Common";
|
|
|
17
17
|
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
18
18
|
import { GyReturn as Return, erpFormValidator } from "@kmkf-fe-packages/basic-components";
|
|
19
19
|
import { BsType, SystemOrderNo } from "../../BS/common/index";
|
|
20
|
+
import { useGoodsSourceFormat } from "../../../Hooks";
|
|
20
21
|
var typeMap = {
|
|
21
22
|
GY_RETURN_GOODS: {
|
|
22
23
|
key: "gyReturnGoods",
|
|
@@ -101,6 +102,7 @@ var GyReturn = /*#__PURE__*/_createClass(function GyReturn(options) {
|
|
|
101
102
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
102
103
|
tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
|
|
103
104
|
component: /*#__PURE__*/React.createElement(Return, _extends({}, _this.componentConfig, {
|
|
105
|
+
useGoodsSourceFormat: useGoodsSourceFormat,
|
|
104
106
|
maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
|
|
105
107
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
106
108
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, KmVideo } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) => AfterSalesOrderId | BuyerNick | BasicCheckbox | CommonMultiStatus | BasicFile | FlowStatusSelect | BasicInput |
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => AfterSalesOrderId | BuyerNick | BasicCheckbox | CommonMultiStatus | BasicFile | FlowStatusSelect | BasicInput | BasicAddress | BasicCascader | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | KmVideo | CommonInput | PaymentVoucherCode | Label | MemberLevel | GyReissue | GyReturn | AsyncSelect | GyGoods;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -108,3 +108,4 @@ export { default as Global } from "./commonComponents/GlobalContext";
|
|
|
108
108
|
export * as ErpScenes from "./commonComponents/ErpContext";
|
|
109
109
|
export * as servers from "./service/api";
|
|
110
110
|
export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
|
|
111
|
+
export * from "./Hooks";
|
package/dist/esm/index.js
CHANGED
|
@@ -110,4 +110,5 @@ import * as _ErpScenes from "./commonComponents/ErpContext";
|
|
|
110
110
|
export { _ErpScenes as ErpScenes };
|
|
111
111
|
import * as _servers from "./service/api";
|
|
112
112
|
export { _servers as servers };
|
|
113
|
-
export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
|
|
113
|
+
export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
|
|
114
|
+
export * from "./Hooks";
|
package/dist/esm/type.d.ts
CHANGED
|
@@ -77,6 +77,34 @@ export interface ComponentInterface {
|
|
|
77
77
|
*/
|
|
78
78
|
formItemIndex?: number;
|
|
79
79
|
componentConfig?: {
|
|
80
|
+
/**
|
|
81
|
+
* @description 商品类组件选择商品来源配置
|
|
82
|
+
*/
|
|
83
|
+
goodsSource?: {
|
|
84
|
+
source: "workOrder" | "erp";
|
|
85
|
+
sourceSettings: {
|
|
86
|
+
filterMode?: "some" | "every";
|
|
87
|
+
filterRules?: {
|
|
88
|
+
leftValue: string;
|
|
89
|
+
compareSymbol: any;
|
|
90
|
+
rightValue?: any;
|
|
91
|
+
}[];
|
|
92
|
+
dataFilterConfig: {
|
|
93
|
+
[cpId: string]: {
|
|
94
|
+
isFilter?: boolean;
|
|
95
|
+
isShow?: boolean;
|
|
96
|
+
index?: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
keyMap: {
|
|
100
|
+
[key: string]: string;
|
|
101
|
+
};
|
|
102
|
+
workOrder: {
|
|
103
|
+
flowTemplateKey: string;
|
|
104
|
+
nodeId: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
80
108
|
/**
|
|
81
109
|
* @description 特殊自定义组件有的值
|
|
82
110
|
*/
|
|
@@ -301,3 +329,12 @@ export declare type ColumnConfig = {
|
|
|
301
329
|
config?: ComponentInterface["componentConfig"];
|
|
302
330
|
templateConfig?: ComponentInterface["componentConfig"];
|
|
303
331
|
};
|
|
332
|
+
export interface ColumnsConfigI {
|
|
333
|
+
show: boolean;
|
|
334
|
+
delete: boolean;
|
|
335
|
+
width: number;
|
|
336
|
+
name: string;
|
|
337
|
+
id: string;
|
|
338
|
+
type: string;
|
|
339
|
+
config?: any;
|
|
340
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "2.0.79-beta.
|
|
3
|
+
"version": "2.0.79-beta.30",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kmkf-fe-packages/basic-components": "2.0.79-beta.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "2.0.79-beta.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "2.0.79-beta.30",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "2.0.79-beta.29",
|
|
26
26
|
"b64-to-blob": "^1.2.19",
|
|
27
27
|
"html2canvas": "^1.4.1",
|
|
28
28
|
"react-pdf-js": "^5.1.0"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "add823fc184b86faa365d1aabf133005c591824e",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|