kmkf-work-order-service-component 0.3.5 → 0.3.6-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.
Files changed (36) hide show
  1. package/dist/esm/SingleShopWorkOrder/components/Card/index.d.ts +4 -0
  2. package/dist/esm/SingleShopWorkOrder/components/Card/index.js +157 -0
  3. package/dist/esm/SingleShopWorkOrder/components/Card/index.less +123 -0
  4. package/dist/esm/SingleShopWorkOrder/components/CustomizeFormModal/index.d.ts +17 -0
  5. package/dist/esm/SingleShopWorkOrder/components/CustomizeFormModal/index.js +676 -0
  6. package/dist/esm/SingleShopWorkOrder/components/CustomizeFormModal/index.less +134 -0
  7. package/dist/esm/SingleShopWorkOrder/components/DeleteCustomizeOrderModal/index.d.ts +5 -0
  8. package/dist/esm/SingleShopWorkOrder/components/DeleteCustomizeOrderModal/index.js +90 -0
  9. package/dist/esm/SingleShopWorkOrder/components/OrderList/index.d.ts +6 -0
  10. package/dist/esm/SingleShopWorkOrder/components/OrderList/index.js +16 -0
  11. package/dist/esm/SingleShopWorkOrder/index.d.ts +4 -0
  12. package/dist/esm/SingleShopWorkOrder/index.js +169 -0
  13. package/dist/esm/SingleShopWorkOrder/index.less +17 -0
  14. package/dist/esm/WorkOrder/components/Widget/basic/Rate/index.d.ts +13 -0
  15. package/dist/esm/WorkOrder/components/Widget/basic/Rate/index.js +144 -0
  16. package/dist/esm/WorkOrder/components/Widget/index.d.ts +2 -1
  17. package/dist/esm/WorkOrder/components/Widget/index.js +4 -0
  18. package/dist/esm/common/utils/tools.js +14 -6
  19. package/dist/esm/index.d.ts +1 -0
  20. package/dist/esm/index.js +1 -0
  21. package/dist/esm/model/servers/api.d.ts +10 -0
  22. package/dist/esm/model/servers/api.js +44 -0
  23. package/dist/esm/model/servers/request.d.ts +2 -2
  24. package/dist/esm/model/servers/request.js +1 -0
  25. package/dist/esm/model/singleShopWorkOrder/index.d.ts +12 -0
  26. package/dist/esm/model/singleShopWorkOrder/index.js +139 -0
  27. package/dist/esm/model/singleShopWorkOrder/selector.d.ts +58 -0
  28. package/dist/esm/model/singleShopWorkOrder/selector.js +22 -0
  29. package/dist/esm/model/singleShopWorkOrder/types.d.ts +11 -0
  30. package/dist/esm/model/singleShopWorkOrder/types.js +1 -0
  31. package/dist/esm/model/store.d.ts +3 -0
  32. package/dist/esm/model/store.js +3 -1
  33. package/dist/esm/model/types/singleWorkOrder.d.ts +10 -0
  34. package/dist/esm/model/types/singleWorkOrder.js +1 -0
  35. package/dist/esm/model/workOrder.js +1 -1
  36. package/package.json +3 -2
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare function CustomizeWorkOrderCard(props: any): JSX.Element;
4
+ export default CustomizeWorkOrderCard;
@@ -0,0 +1,157 @@
1
+ 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; }
2
+
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
+
5
+ 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; }
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ 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."); }
10
+
11
+ 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); }
12
+
13
+ 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; }
14
+
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ /*
20
+ * @Description:
21
+ * @Author: litian
22
+ * @Date: 2022-09-07 17:04:02
23
+ * @LastEditors: litian
24
+ * @LastEditTime: 2022-11-24 13:59:27
25
+ */
26
+ import React from 'react';
27
+ import { Divider } from 'antd';
28
+ import moment from 'moment';
29
+ import { useAppDispatch } from "../../../model/hooks";
30
+ import { factory } from "../../../WorkOrder/components/Widget";
31
+ import { calcWorkOrderList, isNull } from "../../../common/utils/tools";
32
+ import { setFormModalVisible, setTemplateId, setCurrentCustomizeRecord } from "../../../model/singleShopWorkOrder";
33
+ import "./index.less";
34
+ import { jsx as _jsx } from "react/jsx-runtime";
35
+ import { jsxs as _jsxs } from "react/jsx-runtime";
36
+
37
+ function CustomizeWorkOrderCard(props) {
38
+ var item = props.item;
39
+ var dispatch = useAppDispatch();
40
+ var componentDtoList = item.templateDetailDto.componentDtoList;
41
+
42
+ var _calcWorkOrderList = calcWorkOrderList([_objectSpread({}, item)], componentDtoList),
43
+ _calcWorkOrderList2 = _slicedToArray(_calcWorkOrderList, 1),
44
+ transData = _calcWorkOrderList2[0]; //列表头部
45
+
46
+
47
+ var ItemHeader = function ItemHeader() {
48
+ var templateDetailDto = item.templateDetailDto;
49
+ return /*#__PURE__*/_jsx("div", {
50
+ className: "orderItem",
51
+ children: /*#__PURE__*/_jsx("div", {
52
+ className: "orderItemLeft",
53
+ children: /*#__PURE__*/_jsxs("div", {
54
+ className: "orderItemType",
55
+ children: [/*#__PURE__*/_jsx("div", {
56
+ className: "orderItemLeftIcon"
57
+ }), /*#__PURE__*/_jsx("div", {
58
+ className: "orderItemLeftName",
59
+ children: templateDetailDto ? templateDetailDto.name : ''
60
+ })]
61
+ })
62
+ })
63
+ });
64
+ };
65
+
66
+ var ItemActions = function ItemActions() {
67
+ var deleteHandle = function deleteHandle(record) {
68
+ dispatch(setCurrentCustomizeRecord(record));
69
+ dispatch({
70
+ type: 'singleShopWorkOrder/setDeleteCustomizeWorkOrderModalVisible',
71
+ payload: true
72
+ });
73
+ };
74
+
75
+ var handleEdit = function handleEdit(record) {
76
+ dispatch(setCurrentCustomizeRecord(record));
77
+ dispatch(setFormModalVisible(true));
78
+ dispatch(setTemplateId(item.templateDetailDto.uniqueKey));
79
+ };
80
+
81
+ return /*#__PURE__*/_jsxs("div", {
82
+ className: "orderItemRight",
83
+ children: [/*#__PURE__*/_jsx("span", {
84
+ className: "orderItemOperate",
85
+ onClick: function onClick() {
86
+ return handleEdit(item);
87
+ },
88
+ children: "\u4FEE\u6539"
89
+ }), /*#__PURE__*/_jsx("span", {
90
+ className: "orderItemOperate",
91
+ onClick: function onClick() {
92
+ return deleteHandle(item);
93
+ },
94
+ children: "\u5220\u9664"
95
+ })]
96
+ });
97
+ };
98
+
99
+ var ItemView = function ItemView(_ref) {
100
+ var label = _ref.label,
101
+ value = _ref.value,
102
+ key = _ref.key;
103
+ return /*#__PURE__*/_jsxs("div", {
104
+ className: "orderItemView",
105
+ children: [/*#__PURE__*/_jsxs("div", {
106
+ className: "itemViewLeft",
107
+ children: [label, ":"]
108
+ }), /*#__PURE__*/_jsx("span", {
109
+ className: "itemViewRight",
110
+ children: value
111
+ })]
112
+ }, key);
113
+ };
114
+
115
+ return /*#__PURE__*/_jsxs("div", {
116
+ className: "listOrderItemBox",
117
+ children: [/*#__PURE__*/_jsx(ItemHeader, {}), /*#__PURE__*/_jsx(ItemView, {
118
+ label: "\u63D0\u4EA4\u65F6\u95F4",
119
+ value: moment(transData.created).format('YYYY-MM-DD HH:mm:ss')
120
+ }, "created"), /*#__PURE__*/_jsx(ItemView, {
121
+ label: "\u63D0\u4EA4\u5BA2\u670D",
122
+ value: transData.submitter
123
+ }, "submitter"), /*#__PURE__*/_jsx(Divider, {
124
+ dashed: true,
125
+ style: {
126
+ margin: '8px 0'
127
+ }
128
+ }), /*#__PURE__*/_jsx(ItemView, {
129
+ label: "\u5E97\u94FA\u540D\u79F0",
130
+ value: transData.shopName
131
+ }, "shopName"), componentDtoList.map(function (t) {
132
+ var instance = factory(t.workOrderComponentType, {
133
+ id: t.uniqueKey,
134
+ name: t.name,
135
+ componentConfig: t.componentConfig
136
+ });
137
+ var subColumns = instance.getColumns(); // 复合组件存在多个字段展示
138
+
139
+ return subColumns !== null && subColumns !== void 0 && subColumns.children ? subColumns.children.map(function (item) {
140
+ return !isNull(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
141
+ label: item.title,
142
+ value: item.render(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || ''], transData)
143
+ }, item.dataIndex) : null;
144
+ }) : !isNull(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
145
+ label: t.name,
146
+ value: instance.render(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || ''], transData)
147
+ }, t.uniqueKey) : null;
148
+ }), /*#__PURE__*/_jsx(Divider, {
149
+ dashed: true,
150
+ style: {
151
+ margin: '8px 0'
152
+ }
153
+ }), /*#__PURE__*/_jsx(ItemActions, {})]
154
+ });
155
+ }
156
+
157
+ export default CustomizeWorkOrderCard;
@@ -0,0 +1,123 @@
1
+ .listOrderItemBox {
2
+ margin-bottom: 8px;
3
+ padding: 14px 16px;
4
+ background-color: #fff;
5
+ border: 1px solid #f2f2f2;
6
+ }
7
+
8
+ .orderItem {
9
+ position: relative;
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: space-between;
13
+ margin-bottom: 2px;
14
+
15
+ .orderItemLeft {
16
+ display: flex;
17
+ align-items: center;
18
+
19
+ .orderItemType {
20
+ display: flex;
21
+ align-items: center;
22
+ // align-items: center;
23
+ color: rgba(0, 0, 0, 0.85);
24
+ font-weight: normal;
25
+ font-size: 14px;
26
+ font-family: 'PingFangSC-Medium';
27
+
28
+ .orderItemLeftIcon {
29
+ width: 2px;
30
+ height: 16px;
31
+ margin-right: 8px;
32
+ background: #1966ff;
33
+ }
34
+
35
+ .orderItemLeftName {
36
+ // width: 115px;
37
+ line-height: 16px;
38
+ }
39
+
40
+ .status {
41
+ margin-left: 8px;
42
+ padding: 2px 4px;
43
+ font-size: 12px;
44
+ line-height: 16px;
45
+ border-radius: 4px;
46
+ }
47
+ }
48
+
49
+ .orderItemStatus {
50
+ display: inline-block;
51
+ box-sizing: border-box;
52
+ height: 24px;
53
+ margin-left: 8px;
54
+ padding: 0px 4px;
55
+ line-height: 23px;
56
+ white-space: nowrap;
57
+ // align-items: center;
58
+ // justify-content: center;
59
+ text-align: center;
60
+ border-radius: 4px;
61
+ }
62
+
63
+ .undo {
64
+ color: #ff4050;
65
+ background: #fff6f5;
66
+ border: 1px solid #ffeceb;
67
+ }
68
+
69
+ .done {
70
+ color: #43bf0a;
71
+ background: #f6fff0;
72
+ border: 1px solid #dffacd;
73
+ }
74
+ }
75
+ }
76
+
77
+ .orderItemRight {
78
+ display: flex;
79
+ justify-content: flex-end;
80
+ }
81
+
82
+ .orderItemOperate {
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ box-sizing: border-box;
87
+ height: 24px;
88
+ margin: 0 4px;
89
+ // width: 48px;
90
+ padding: 0 8px;
91
+ color: #1966ff;
92
+ font-weight: normal;
93
+ white-space: nowrap;
94
+ border: 1px solid #1966ff;
95
+ border-radius: 4px;
96
+ cursor: pointer;
97
+ }
98
+
99
+ .orderLine {
100
+ display: block;
101
+ width: 100%;
102
+ border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
103
+ }
104
+
105
+ .orderItemView {
106
+ display: flex;
107
+ align-items: center;
108
+ margin: 6px 0;
109
+
110
+ .itemViewLeft {
111
+ min-width: 48px;
112
+ margin-right: 8px;
113
+ color: rgba(0, 0, 0, 0.4);
114
+ font-weight: normal;
115
+ font-size: 12px;
116
+ }
117
+
118
+ .itemViewRight {
119
+ flex-grow: 1;
120
+ color: rgba(0, 0, 0, 0.85);
121
+ word-break: break-all;
122
+ }
123
+ }
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import 'moment/locale/zh-cn';
3
+ import './index.less';
4
+ declare type CustomizeFormModal = {
5
+ width?: string;
6
+ shopList: any[];
7
+ look?: boolean;
8
+ templateId: string;
9
+ shopId: string;
10
+ orderNo: string;
11
+ buyerId: string;
12
+ buyerNick: string;
13
+ platform: string;
14
+ onSuccess?: (val: any) => void;
15
+ };
16
+ declare const CustomizeFormModal: (props: CustomizeFormModal) => JSX.Element;
17
+ export default CustomizeFormModal;