kmkf-work-order-service-component 0.4.0-alpha.1 → 0.4.0-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/FormRender/index.d.ts +3 -1
- package/dist/esm/FormRender/index.js +104 -40
- package/dist/esm/FormRender/index.less +6 -0
- package/dist/esm/ShopList/index.d.ts +19 -0
- package/dist/esm/ShopList/index.js +88 -0
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.js +11 -3
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.less +83 -0
- package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.d.ts +1 -2
- package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.js +2 -16
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/model/customizeWorkOrder/api.d.ts +6 -1
- package/dist/esm/model/customizeWorkOrder/api.js +26 -0
- package/dist/esm/model/customizeWorkOrder/types.d.ts +5 -0
- package/package.json +1 -1
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeFormModal/index.d.ts +0 -17
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeFormModal/index.js +0 -681
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeFormModal/index.less +0 -134
@@ -1,4 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { FormProps } from 'antd';
|
2
3
|
import 'moment/locale/zh-cn';
|
3
4
|
import './index.less';
|
4
5
|
interface Option {
|
@@ -8,7 +9,7 @@ interface Option {
|
|
8
9
|
}
|
9
10
|
declare type FormRenderProps = {
|
10
11
|
shopList: any[];
|
11
|
-
shopId
|
12
|
+
shopId?: string;
|
12
13
|
record?: any;
|
13
14
|
look?: boolean;
|
14
15
|
templateId?: string[];
|
@@ -17,6 +18,7 @@ declare type FormRenderProps = {
|
|
17
18
|
buyerNick?: string;
|
18
19
|
platform?: string;
|
19
20
|
templateList?: Option[];
|
21
|
+
formProps?: FormProps;
|
20
22
|
onTemplateChange?: (p: string) => any;
|
21
23
|
onFormSubmitSuccess?: <T>(p: T) => void;
|
22
24
|
};
|
@@ -38,11 +38,47 @@ import zhCN from 'antd/es/locale/zh_CN';
|
|
38
38
|
import { get, find, some, set, last } from 'lodash';
|
39
39
|
import 'moment/locale/zh-cn';
|
40
40
|
import { calcWorkOrderList, submitDataTransOldFormat, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME } from "../common/utils/tools";
|
41
|
+
import express from "../common/utils/express";
|
42
|
+
import formatAddrData from "../common/utils/formatAddrData";
|
41
43
|
import { queryTemplateDetail, addWorkOrder, queryWorkOrderDetail, updateWorkOrder, replaceCheck } from "../model/servers/api";
|
44
|
+
import { getPlatList } from "../model/customizeWorkOrder/api";
|
42
45
|
import { factory } from "../WorkOrder/components/Widget";
|
46
|
+
import ShopList from "../ShopList";
|
43
47
|
import "./index.less";
|
44
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
45
48
|
import { jsx as _jsx } from "react/jsx-runtime";
|
49
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
50
|
+
|
51
|
+
var ShopName = function ShopName(_ref) {
|
52
|
+
var shopList = _ref.shopList,
|
53
|
+
platIconList = _ref.platIconList,
|
54
|
+
workOrderId = _ref.workOrderId,
|
55
|
+
look = _ref.look,
|
56
|
+
handleChangeShopId = _ref.handleChangeShopId;
|
57
|
+
return /*#__PURE__*/_jsx("div", {
|
58
|
+
className: "form-item--wrap",
|
59
|
+
style: {
|
60
|
+
position: 'relative'
|
61
|
+
},
|
62
|
+
children: /*#__PURE__*/_jsx(Form.Item, {
|
63
|
+
name: "shopId",
|
64
|
+
label: "\u5E97\u94FA\u540D\u79F0",
|
65
|
+
className: "form-item-label--index",
|
66
|
+
rules: [{
|
67
|
+
required: true,
|
68
|
+
message: '请选择店铺名称'
|
69
|
+
}],
|
70
|
+
children: /*#__PURE__*/_jsx(ShopList, {
|
71
|
+
shopList: shopList,
|
72
|
+
platIconList: platIconList,
|
73
|
+
disabled: !!workOrderId || look,
|
74
|
+
setShopId: handleChangeShopId,
|
75
|
+
placeholder: "\u8BF7\u9009\u62E9\u5E97\u94FA\u540D\u79F0",
|
76
|
+
showSearch: true,
|
77
|
+
optionFilterProp: "label"
|
78
|
+
})
|
79
|
+
})
|
80
|
+
}, 'shopId');
|
81
|
+
};
|
46
82
|
|
47
83
|
var FormRender = function FormRender(props, ref) {
|
48
84
|
var shopList = props.shopList,
|
@@ -56,7 +92,9 @@ var FormRender = function FormRender(props, ref) {
|
|
56
92
|
record = props.record,
|
57
93
|
templateList = props.templateList,
|
58
94
|
onFormSubmitSuccess = props.onFormSubmitSuccess,
|
59
|
-
onTemplateChange = props.onTemplateChange
|
95
|
+
onTemplateChange = props.onTemplateChange,
|
96
|
+
_props$formProps = props.formProps,
|
97
|
+
formProps = _props$formProps === void 0 ? {} : _props$formProps;
|
60
98
|
|
61
99
|
var _useState = useState(false),
|
62
100
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -86,6 +124,31 @@ var FormRender = function FormRender(props, ref) {
|
|
86
124
|
setReplaceValue = _useState10[1]; //字段重复校验
|
87
125
|
|
88
126
|
|
127
|
+
var _useState11 = useState(currentShopId),
|
128
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
129
|
+
shopId = _useState12[0],
|
130
|
+
setShopId = _useState12[1];
|
131
|
+
|
132
|
+
var _useState13 = useState([]),
|
133
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
134
|
+
platIcon = _useState14[0],
|
135
|
+
setPlatIcon = _useState14[1];
|
136
|
+
|
137
|
+
useEffect(function () {
|
138
|
+
express.initData();
|
139
|
+
formatAddrData.initData();
|
140
|
+
}, []);
|
141
|
+
useEffect(function () {
|
142
|
+
if (!currentShopId) {
|
143
|
+
getPlatList().then(function (list) {
|
144
|
+
return setPlatIcon(list);
|
145
|
+
});
|
146
|
+
}
|
147
|
+
}, [currentShopId]);
|
148
|
+
useEffect(function () {
|
149
|
+
setShopId(currentShopId);
|
150
|
+
}, [currentShopId]);
|
151
|
+
|
89
152
|
var _Form$useForm = Form.useForm(),
|
90
153
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
91
154
|
form = _Form$useForm2[0];
|
@@ -115,7 +178,7 @@ var FormRender = function FormRender(props, ref) {
|
|
115
178
|
};
|
116
179
|
|
117
180
|
var asyncDoSave = /*#__PURE__*/function () {
|
118
|
-
var
|
181
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(workOrderDetail, templateDetail) {
|
119
182
|
var data, res, params, submitData, _yield$updateWorkOrde, success, result, platformMap, _params, hasEnterPrisePayment, getEnterPrisePaymentData, uniqueKey, componentConfig, _yield$addWorkOrder, _success, _result;
|
120
183
|
|
121
184
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -149,10 +212,10 @@ var FormRender = function FormRender(props, ref) {
|
|
149
212
|
|
150
213
|
params = {
|
151
214
|
apiName: 'updateWorkOrder',
|
152
|
-
shopId:
|
215
|
+
shopId: shopId,
|
153
216
|
uniqueKey: last(templateIdState),
|
154
217
|
accessToken: get(find(shopList, function (s) {
|
155
|
-
return s.shopId ===
|
218
|
+
return s.shopId === shopId;
|
156
219
|
}), 'accessToken', ''),
|
157
220
|
workOrderUpdateKeyVos: {
|
158
221
|
workOrderId: workOrderId,
|
@@ -190,15 +253,16 @@ var FormRender = function FormRender(props, ref) {
|
|
190
253
|
ks: '快手',
|
191
254
|
pdd: '拼多多',
|
192
255
|
jd: '京东',
|
193
|
-
xiaozhi: '小智'
|
256
|
+
xiaozhi: '小智',
|
257
|
+
pc: 'PC'
|
194
258
|
};
|
195
259
|
_params = {
|
196
260
|
apiName: 'addWorkOrder',
|
197
|
-
shopId:
|
261
|
+
shopId: shopId,
|
198
262
|
uniqueKey: last(templateIdState),
|
199
263
|
workOrderComponentVos: [],
|
200
264
|
accessToken: get(find(shopList, function (s) {
|
201
|
-
return s.shopId ===
|
265
|
+
return s.shopId === shopId;
|
202
266
|
}), 'accessToken', ''),
|
203
267
|
source: get(platformMap, "".concat(platform), '工单通')
|
204
268
|
};
|
@@ -274,13 +338,13 @@ var FormRender = function FormRender(props, ref) {
|
|
274
338
|
}));
|
275
339
|
|
276
340
|
return function asyncDoSave(_x, _x2) {
|
277
|
-
return
|
341
|
+
return _ref2.apply(this, arguments);
|
278
342
|
};
|
279
343
|
}();
|
280
344
|
|
281
345
|
var handleSubmit = useCallback(function () {
|
282
346
|
return asyncDoSave(workOrderDetail, templateDetail);
|
283
|
-
}, [workOrderDetail, templateDetail]);
|
347
|
+
}, [workOrderDetail, templateDetail, shopId, workOrderId, templateIdState]);
|
284
348
|
useImperativeHandle(ref, function () {
|
285
349
|
return {
|
286
350
|
save: handleSubmit
|
@@ -304,7 +368,7 @@ var FormRender = function FormRender(props, ref) {
|
|
304
368
|
|
305
369
|
|
306
370
|
var queryReplaceCount = /*#__PURE__*/function () {
|
307
|
-
var
|
371
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(componentValue) {
|
308
372
|
var needCheckComponentList, params, _yield$replaceCheck, resultList, resultParams;
|
309
373
|
|
310
374
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
@@ -355,7 +419,7 @@ var FormRender = function FormRender(props, ref) {
|
|
355
419
|
}));
|
356
420
|
|
357
421
|
return function queryReplaceCount(_x3) {
|
358
|
-
return
|
422
|
+
return _ref3.apply(this, arguments);
|
359
423
|
};
|
360
424
|
}(); //自动返填重复校验
|
361
425
|
|
@@ -387,14 +451,14 @@ var FormRender = function FormRender(props, ref) {
|
|
387
451
|
};
|
388
452
|
|
389
453
|
var queryDetail = /*#__PURE__*/function () {
|
390
|
-
var
|
454
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) {
|
391
455
|
var templateId, workOrderId, shopId, shopList, record, orderNo, buyerId, buyerNick, _workOrderDetail2, _workOrderDetail2$dat, _workOrderDetail2$dat2, _workOrderDetail, _templateDetail, _workOrderDetail3, _templateDetail$data, transData, _templateDetail$data2, _templateDetail$data3, jsonMap, _transData, antFormEl;
|
392
456
|
|
393
457
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
394
458
|
while (1) {
|
395
459
|
switch (_context3.prev = _context3.next) {
|
396
460
|
case 0:
|
397
|
-
templateId =
|
461
|
+
templateId = _ref4.templateId, workOrderId = _ref4.workOrderId, shopId = _ref4.shopId, shopList = _ref4.shopList, record = _ref4.record, orderNo = _ref4.orderNo, buyerId = _ref4.buyerId, buyerNick = _ref4.buyerNick;
|
398
462
|
form.resetFields();
|
399
463
|
_context3.prev = 2;
|
400
464
|
setLoading(true);
|
@@ -494,7 +558,7 @@ var FormRender = function FormRender(props, ref) {
|
|
494
558
|
}));
|
495
559
|
|
496
560
|
return function queryDetail(_x4) {
|
497
|
-
return
|
561
|
+
return _ref5.apply(this, arguments);
|
498
562
|
};
|
499
563
|
}();
|
500
564
|
|
@@ -503,14 +567,14 @@ var FormRender = function FormRender(props, ref) {
|
|
503
567
|
queryDetail({
|
504
568
|
templateId: last(templateIdState),
|
505
569
|
workOrderId: workOrderId,
|
506
|
-
shopId:
|
570
|
+
shopId: shopId,
|
507
571
|
shopList: shopList,
|
508
572
|
record: record,
|
509
573
|
orderNo: orderNo,
|
510
574
|
buyerId: buyerId,
|
511
575
|
buyerNick: buyerNick
|
512
576
|
});
|
513
|
-
}, [templateIdState, workOrderId
|
577
|
+
}, [templateIdState, workOrderId]); //订单返填
|
514
578
|
|
515
579
|
var changeHandle = function changeHandle(order_no) {
|
516
580
|
if (!order_no) return;
|
@@ -523,7 +587,7 @@ var FormRender = function FormRender(props, ref) {
|
|
523
587
|
orderBack({
|
524
588
|
order_no: order_no,
|
525
589
|
form: form,
|
526
|
-
shopId:
|
590
|
+
shopId: shopId,
|
527
591
|
shopList: shopList,
|
528
592
|
templateDetail: templateDetail,
|
529
593
|
type: !!workOrderId ? 'edit' : 'add',
|
@@ -534,7 +598,7 @@ var FormRender = function FormRender(props, ref) {
|
|
534
598
|
|
535
599
|
|
536
600
|
var componentOnBlur = /*#__PURE__*/function () {
|
537
|
-
var
|
601
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(value, type) {
|
538
602
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
539
603
|
while (1) {
|
540
604
|
switch (_context4.prev = _context4.next) {
|
@@ -565,16 +629,13 @@ var FormRender = function FormRender(props, ref) {
|
|
565
629
|
}));
|
566
630
|
|
567
631
|
return function componentOnBlur(_x5, _x6) {
|
568
|
-
return
|
632
|
+
return _ref6.apply(this, arguments);
|
569
633
|
};
|
570
634
|
}(); // 切换店铺
|
571
635
|
|
572
636
|
|
573
637
|
var newRenderColumnItem = function newRenderColumnItem(effects) {
|
574
|
-
return function (item
|
575
|
-
// 录入工单表头的序号,默认算入了店铺名称的行,所以之后的序列+2
|
576
|
-
formItemIndex += 2;
|
577
|
-
|
638
|
+
return function (item) {
|
578
639
|
if (look) {
|
579
640
|
item.componentConfig = _objectSpread(_objectSpread({}, item.componentConfig), {}, {
|
580
641
|
disabled: true
|
@@ -585,11 +646,9 @@ var FormRender = function FormRender(props, ref) {
|
|
585
646
|
id: item.uniqueKey,
|
586
647
|
name: item.name,
|
587
648
|
componentConfig: item.componentConfig,
|
588
|
-
effects: effects
|
589
|
-
formItemIndex: formItemIndex
|
649
|
+
effects: effects
|
590
650
|
});
|
591
651
|
return instance.editRender({
|
592
|
-
formItemIndex: formItemIndex,
|
593
652
|
onBlur: componentOnBlur
|
594
653
|
});
|
595
654
|
};
|
@@ -599,13 +658,18 @@ var FormRender = function FormRender(props, ref) {
|
|
599
658
|
var otherItems = get(templateDetail, 'componentDtoList', []).map(newRenderColumnItem({
|
600
659
|
form: form,
|
601
660
|
shopList: shopList,
|
602
|
-
shopId:
|
661
|
+
shopId: shopId,
|
603
662
|
isEditing: !!workOrderId,
|
604
663
|
workOrderDetail: workOrderDetail,
|
605
664
|
templateDetail: templateDetail
|
606
665
|
}));
|
607
|
-
|
608
|
-
|
666
|
+
|
667
|
+
if (!currentShopId) {
|
668
|
+
return [ShopName].concat(_toConsumableArray(otherItems));
|
669
|
+
}
|
670
|
+
|
671
|
+
return otherItems;
|
672
|
+
}, [templateDetail, shopList, shopId, workOrderDetail, currentShopId]);
|
609
673
|
return /*#__PURE__*/_jsx(Spin, {
|
610
674
|
spinning: loading,
|
611
675
|
children: /*#__PURE__*/_jsxs(ConfigProvider, {
|
@@ -617,15 +681,9 @@ var FormRender = function FormRender(props, ref) {
|
|
617
681
|
children: ["\u63D0\u793A\uFF1A\u8BE5", COMPONENT_MAP_NAME[key], "\u9488\u5BF9\u6B64\u6A21\u677F\u5DF2\u521B\u5EFA\u8FC7", replaceValue[key], "\u6761\u5DE5\u5355\uFF01"]
|
618
682
|
});
|
619
683
|
})
|
620
|
-
}), /*#__PURE__*/_jsxs(Form, {
|
621
|
-
form: form
|
622
|
-
|
623
|
-
span: 6
|
624
|
-
},
|
625
|
-
wrapperCol: {
|
626
|
-
span: 18
|
627
|
-
},
|
628
|
-
className: "customizeFormModalClassName",
|
684
|
+
}), /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread({
|
685
|
+
form: form
|
686
|
+
}, formProps), {}, {
|
629
687
|
children: [!templateId && /*#__PURE__*/_jsx(Form.Item, {
|
630
688
|
label: "\u6A21\u677F\u540D\u79F0",
|
631
689
|
required: true,
|
@@ -637,8 +695,14 @@ var FormRender = function FormRender(props, ref) {
|
|
637
695
|
onChange: handleChangeTemplateId,
|
638
696
|
allowClear: false
|
639
697
|
})
|
698
|
+
}), !currentShopId && /*#__PURE__*/_jsx(ShopName, {
|
699
|
+
shopList: shopList,
|
700
|
+
platIconList: platIcon,
|
701
|
+
workOrderId: workOrderId,
|
702
|
+
look: look,
|
703
|
+
handleChangeShopId: setShopId
|
640
704
|
}), finalFormItems]
|
641
|
-
})]
|
705
|
+
}))]
|
642
706
|
})
|
643
707
|
});
|
644
708
|
};
|
@@ -34,6 +34,12 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
.customizeFormModalClassName {
|
37
|
+
:global(.ant-cascader-menu-item-content) {
|
38
|
+
max-width: 200px;
|
39
|
+
overflow: hidden;
|
40
|
+
white-space: nowrap;
|
41
|
+
text-overflow: ellipsis;
|
42
|
+
}
|
37
43
|
:global(.goods-uploaded-state) {
|
38
44
|
margin: 6px 0 5px 0;
|
39
45
|
padding-left: 7px;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare type Shop = {
|
3
|
+
auditStatus: number;
|
4
|
+
shopId: string;
|
5
|
+
shopName: string;
|
6
|
+
shopSource: string | number;
|
7
|
+
};
|
8
|
+
declare type ShopListProps = {
|
9
|
+
shopList: Shop[];
|
10
|
+
platIconList: {
|
11
|
+
alreadyJoin: boolean;
|
12
|
+
img: string;
|
13
|
+
platformType: number;
|
14
|
+
}[];
|
15
|
+
disabled?: boolean;
|
16
|
+
[prop: string]: any;
|
17
|
+
};
|
18
|
+
declare const ShopList: ({ shopList, platIconList, disabled, onChange, setShopId, ...prop }: ShopListProps) => JSX.Element;
|
19
|
+
export default ShopList;
|
@@ -0,0 +1,88 @@
|
|
1
|
+
var _excluded = ["platIcon", "shopId", "styles"],
|
2
|
+
_excluded2 = ["shopList", "platIconList", "disabled", "onChange", "setShopId"];
|
3
|
+
|
4
|
+
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; }
|
5
|
+
|
6
|
+
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; }
|
7
|
+
|
8
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
9
|
+
|
10
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
11
|
+
|
12
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
13
|
+
|
14
|
+
import { Select } from 'antd';
|
15
|
+
import React, { useMemo } from 'react';
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
18
|
+
|
19
|
+
var PlatformAvatar = function PlatformAvatar(props) {
|
20
|
+
var platIcon = props.platIcon,
|
21
|
+
shopId = props.shopId,
|
22
|
+
styles = props.styles,
|
23
|
+
other = _objectWithoutProperties(props, _excluded);
|
24
|
+
|
25
|
+
if (platIcon[shopId]) {
|
26
|
+
return /*#__PURE__*/_jsx("img", _objectSpread({
|
27
|
+
alt: "",
|
28
|
+
src: platIcon[shopId],
|
29
|
+
style: _objectSpread({
|
30
|
+
width: '20px',
|
31
|
+
height: '20px',
|
32
|
+
objectFit: 'contain'
|
33
|
+
}, styles)
|
34
|
+
}, other));
|
35
|
+
}
|
36
|
+
|
37
|
+
return null;
|
38
|
+
};
|
39
|
+
|
40
|
+
var ShopList = function ShopList(_ref) {
|
41
|
+
var shopList = _ref.shopList,
|
42
|
+
platIconList = _ref.platIconList,
|
43
|
+
disabled = _ref.disabled,
|
44
|
+
onChange = _ref.onChange,
|
45
|
+
setShopId = _ref.setShopId,
|
46
|
+
prop = _objectWithoutProperties(_ref, _excluded2);
|
47
|
+
|
48
|
+
var handleChange = function handleChange(val) {
|
49
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(val);
|
50
|
+
setShopId === null || setShopId === void 0 ? void 0 : setShopId(val);
|
51
|
+
};
|
52
|
+
|
53
|
+
var platIcon = useMemo(function () {
|
54
|
+
var iconParams = {};
|
55
|
+
(shopList || []).forEach(function (item) {
|
56
|
+
var plat = platIconList.find(function (t) {
|
57
|
+
return +t.platformType === +item.shopSource;
|
58
|
+
});
|
59
|
+
plat && (iconParams[item.shopId] = plat.img);
|
60
|
+
});
|
61
|
+
return iconParams;
|
62
|
+
}, [shopList, platIconList]);
|
63
|
+
return /*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({
|
64
|
+
disabled: disabled,
|
65
|
+
onChange: handleChange
|
66
|
+
}, prop), {}, {
|
67
|
+
children: shopList.filter(function (item) {
|
68
|
+
return (item === null || item === void 0 ? void 0 : item.auditStatus) === 1;
|
69
|
+
}).map(function (item) {
|
70
|
+
var shopId = item.shopId;
|
71
|
+
return /*#__PURE__*/_jsxs(Select.Option, {
|
72
|
+
value: item.shopId,
|
73
|
+
label: item.shopName,
|
74
|
+
children: [/*#__PURE__*/_jsx(PlatformAvatar, {
|
75
|
+
shopId: shopId,
|
76
|
+
styles: {
|
77
|
+
marginRight: 5
|
78
|
+
},
|
79
|
+
platIcon: platIcon
|
80
|
+
}), /*#__PURE__*/_jsx("span", {
|
81
|
+
children: item.shopName
|
82
|
+
})]
|
83
|
+
});
|
84
|
+
})
|
85
|
+
}));
|
86
|
+
};
|
87
|
+
|
88
|
+
export default ShopList;
|
@@ -176,8 +176,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref3) {
|
|
176
176
|
pagination = tableProps.pagination,
|
177
177
|
_onChange = tableProps.onChange;
|
178
178
|
useEffect(function () {
|
179
|
-
|
180
|
-
if (pagination.current === 1 && total === 0) {
|
179
|
+
if (pagination.current === 1) {
|
181
180
|
setTotal(pagination.total);
|
182
181
|
}
|
183
182
|
}, [pagination, total]);
|
@@ -357,7 +356,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref3) {
|
|
357
356
|
width: platform === PlatForm.XIAOZHI ? '100%' : '90%'
|
358
357
|
}), /*#__PURE__*/_jsx(Drawer, {
|
359
358
|
closeIcon: /*#__PURE__*/_jsx(LeftOutlined, {}),
|
360
|
-
title: title,
|
359
|
+
title: (record === null || record === void 0 ? void 0 : record.templateName) || title,
|
361
360
|
width: platform === PlatForm.XIAOZHI ? '100%' : '90%',
|
362
361
|
open: formRenderVisible,
|
363
362
|
onClose: handleCloseFormModal,
|
@@ -393,6 +392,15 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref3) {
|
|
393
392
|
onTemplateChange: function onTemplateChange(title) {
|
394
393
|
return setTitle(title);
|
395
394
|
},
|
395
|
+
formProps: {
|
396
|
+
labelCol: {
|
397
|
+
span: 6
|
398
|
+
},
|
399
|
+
wrapperCol: {
|
400
|
+
span: 18
|
401
|
+
},
|
402
|
+
className: 'customizeFormModalClassName'
|
403
|
+
},
|
396
404
|
onFormSubmitSuccess: function onFormSubmitSuccess(val) {
|
397
405
|
submit();
|
398
406
|
handleCloseFormModal();
|
@@ -178,3 +178,86 @@
|
|
178
178
|
text-overflow: ellipsis;
|
179
179
|
}
|
180
180
|
}
|
181
|
+
|
182
|
+
.customizeFormModalClassName {
|
183
|
+
:global(.goods-uploaded-state) {
|
184
|
+
margin: 6px 0 5px 0;
|
185
|
+
padding-left: 7px;
|
186
|
+
font-size: 12px;
|
187
|
+
}
|
188
|
+
|
189
|
+
:global(.ant-picker) {
|
190
|
+
width: 100%;
|
191
|
+
|
192
|
+
box-shadow: none;
|
193
|
+
// background: #f2f3f5;
|
194
|
+
// border: none;
|
195
|
+
|
196
|
+
input {
|
197
|
+
&::placeholder {
|
198
|
+
color: #86909c;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
&:hover {
|
203
|
+
border-color: #4583ff;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
:global(.ant-radio-inner) {
|
208
|
+
background-color: #fff;
|
209
|
+
}
|
210
|
+
|
211
|
+
:global(.ant-select) {
|
212
|
+
width: 100% !important;
|
213
|
+
|
214
|
+
.ant-select-selector {
|
215
|
+
background: #f2f3f5 !important;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
:global(.ant-form-item) {
|
220
|
+
margin-bottom: 8px;
|
221
|
+
}
|
222
|
+
|
223
|
+
:global(.ant-form-item .ant-form-item-label) {
|
224
|
+
padding: 0px;
|
225
|
+
}
|
226
|
+
|
227
|
+
:global(.ant-form-item-label) {
|
228
|
+
position: relative;
|
229
|
+
max-width: 100px;
|
230
|
+
overflow: initial;
|
231
|
+
color: rgba(0, 0, 0, 0.55);
|
232
|
+
font-size: 14px;
|
233
|
+
white-space: normal;
|
234
|
+
text-align: left;
|
235
|
+
}
|
236
|
+
|
237
|
+
:global(.form-item-label--index .ant-form-item-label label) {
|
238
|
+
text-align: left;
|
239
|
+
}
|
240
|
+
|
241
|
+
:global(.label-title--index) {
|
242
|
+
position: absolute;
|
243
|
+
color: #86909c;
|
244
|
+
font-family: 'PingFangSC-Semibold';
|
245
|
+
}
|
246
|
+
|
247
|
+
:global(.goods-title) {
|
248
|
+
color: #4e5969;
|
249
|
+
font-size: 12px;
|
250
|
+
}
|
251
|
+
|
252
|
+
:global(div.ant-form-item.invoice-title--basic label) {
|
253
|
+
padding-left: 0;
|
254
|
+
font-weight: normal;
|
255
|
+
font-family: 'PingFangSC-Regular';
|
256
|
+
}
|
257
|
+
|
258
|
+
:global(.payment-widgets--basic div.ant-form-item-label label) {
|
259
|
+
padding-left: 0;
|
260
|
+
font-weight: lighter;
|
261
|
+
font-family: 'PingFangSC-Regular';
|
262
|
+
}
|
263
|
+
}
|
@@ -5,9 +5,8 @@ declare type getFormItemProps = {
|
|
5
5
|
rules?: any[];
|
6
6
|
required: boolean;
|
7
7
|
component: JSX.Element | string | null;
|
8
|
-
formItemIndex?: number;
|
9
8
|
};
|
10
|
-
export declare const getFormItem: ({ name, title, rules, required, component
|
9
|
+
export declare const getFormItem: ({ name, title, rules, required, component }: getFormItemProps) => JSX.Element;
|
11
10
|
export declare const showImage: ({ item, type }: {
|
12
11
|
item: any;
|
13
12
|
type: string;
|
@@ -23,8 +23,7 @@ export var getFormItem = function getFormItem(_ref) {
|
|
23
23
|
_ref$rules = _ref.rules,
|
24
24
|
rules = _ref$rules === void 0 ? [] : _ref$rules,
|
25
25
|
required = _ref.required,
|
26
|
-
component = _ref.component
|
27
|
-
formItemIndex = _ref.formItemIndex;
|
26
|
+
component = _ref.component;
|
28
27
|
var newRules = rules;
|
29
28
|
|
30
29
|
if (required) {
|
@@ -34,19 +33,6 @@ export var getFormItem = function getFormItem(_ref) {
|
|
34
33
|
});
|
35
34
|
}
|
36
35
|
|
37
|
-
var formIndexClassName = '';
|
38
|
-
var indexLabel = '';
|
39
|
-
|
40
|
-
if (formItemIndex != undefined) {
|
41
|
-
formIndexClassName = 'form-item-label--index';
|
42
|
-
|
43
|
-
if (formItemIndex >= 10) {
|
44
|
-
indexLabel = formItemIndex + '';
|
45
|
-
} else {
|
46
|
-
indexLabel = '0' + formItemIndex;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
36
|
return /*#__PURE__*/_jsx("div", {
|
51
37
|
className: "form-item--wrap",
|
52
38
|
style: {
|
@@ -56,7 +42,7 @@ export var getFormItem = function getFormItem(_ref) {
|
|
56
42
|
name: name,
|
57
43
|
label: title,
|
58
44
|
rules: newRules,
|
59
|
-
className:
|
45
|
+
className: "form-item-label--index",
|
60
46
|
children: component
|
61
47
|
})
|
62
48
|
});
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
@@ -11,4 +11,5 @@
|
|
11
11
|
export { default as WorkOrder } from "./WorkOrder";
|
12
12
|
export { default as Login } from "./Login";
|
13
13
|
export { default as SingleShopWorkOrder } from "./SingleShopWorkOrder";
|
14
|
+
export { default as FormRender } from "./FormRender";
|
14
15
|
export * from "./WorkOrder/types";
|
@@ -1,6 +1,11 @@
|
|
1
1
|
import { serverProps } from '../servers/request';
|
2
|
-
import { ColumnsConfigI } from './types';
|
2
|
+
import { ColumnsConfigI, PlatIProp } from './types';
|
3
3
|
export declare const queryAllComponentList: (data: any) => Promise<serverProps<{
|
4
4
|
fixedColumns: ColumnsConfigI[];
|
5
5
|
nonFixedColumns: ColumnsConfigI[];
|
6
6
|
}>>;
|
7
|
+
export declare const getPlatList: (data: any) => Promise<serverProps<{
|
8
|
+
all: PlatIProp[];
|
9
|
+
alreadyJoinedList: PlatIProp[];
|
10
|
+
notJoinList: PlatIProp[];
|
11
|
+
}>>;
|