kmkf-work-order-service-component 0.3.0-alpha.9 → 0.3.0

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.
@@ -0,0 +1,5 @@
1
+ declare const openCustomizeWorkOrder: (prefixParams: {
2
+ shopList?: [] | undefined;
3
+ onSuccess?: ((val?: any) => void) | undefined;
4
+ }) => (params: any) => void;
5
+ export default openCustomizeWorkOrder;
@@ -0,0 +1,53 @@
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
+ /*
8
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
9
+ * @Date: 2022-09-13 14:30:28
10
+ * @LastEditors: litian
11
+ * @LastEditTime: 2022-12-01 16:30:15
12
+ * @FilePath: /kmkf-work-order-service-component/src/WorkOrder/components/CustomizeFormModal/wrap.tsx
13
+ * @Description:
14
+ *
15
+ * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
16
+ */
17
+ import React, { createRef } from 'react';
18
+ import { render as reactRender, unmount as reactUnmount } from 'rc-util/lib/React/render';
19
+ import CustomizeFormModal from "./index";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+
22
+ var openCustomizeWorkOrder = function openCustomizeWorkOrder(prefixParams) {
23
+ return function (params) {
24
+ var container = document.createDocumentFragment();
25
+ var ref = /*#__PURE__*/createRef();
26
+
27
+ function destroy() {
28
+ reactUnmount(container);
29
+ }
30
+
31
+ function render() {
32
+ reactRender( /*#__PURE__*/_jsx(CustomizeFormModal, {
33
+ ref: ref,
34
+ width: "100%",
35
+ onSuccess: function onSuccess(val) {
36
+ if (typeof (prefixParams === null || prefixParams === void 0 ? void 0 : prefixParams.onSuccess) === 'function') {
37
+ return prefixParams === null || prefixParams === void 0 ? void 0 : prefixParams.onSuccess(val);
38
+ }
39
+
40
+ destroy();
41
+ },
42
+ shopList: prefixParams === null || prefixParams === void 0 ? void 0 : prefixParams.shopList
43
+ }), container);
44
+ setTimeout(function () {
45
+ ref.current.openModal(_objectSpread({}, params));
46
+ });
47
+ }
48
+
49
+ render();
50
+ };
51
+ };
52
+
53
+ export default openCustomizeWorkOrder;
@@ -10,7 +10,6 @@ declare type CustomizeFormModal = {
10
10
  orderNo: string;
11
11
  buyerId: string;
12
12
  buyerNick: string;
13
- platform: string;
14
13
  onSuccess?: (val: any) => void;
15
14
  };
16
15
  declare const CustomizeFormModal: (props: CustomizeFormModal) => JSX.Element;
@@ -60,8 +60,7 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
60
60
  currentShopId = props.shopId,
61
61
  orderNo = props.orderNo,
62
62
  buyerId = props.buyerId,
63
- buyerNick = props.buyerNick,
64
- platform = props.platform;
63
+ buyerNick = props.buyerNick;
65
64
 
66
65
  var _useState = useState(false),
67
66
  _useState2 = _slicedToArray(_useState, 2),
@@ -190,7 +189,7 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
190
189
  accessToken: get(find(shopList, function (s) {
191
190
  return s.shopId === currentShopId;
192
191
  }), 'accessToken', ''),
193
- source: platformMap[platform] || '工单通'
192
+ source: platformMap[platformInfo.platform] || '工单通'
194
193
  };
195
194
  _params.workOrderComponentVos = submitDataTransOldFormat(data, templateDetail, !!workOrderId, workOrderDetail, _params);
196
195
  hasEnterPrisePayment = some(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, function (item) {
@@ -262,7 +262,6 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref) {
262
262
  orderNo: orderNo,
263
263
  buyerId: buyerId,
264
264
  buyerNick: buyerNick,
265
- platform: platform,
266
265
  onSuccess: callBackFormOperation
267
266
  })]
268
267
  });
@@ -35,12 +35,13 @@ import express from "../common/utils/express";
35
35
  import formatAddrData from "../common/utils/formatAddrData";
36
36
  import store from "../model/store";
37
37
  import OrderList from "./components/CustomizeWorkOrderList";
38
- import PaymentWorkOrderList from "./components/PaymentWorkOrderList";
39
38
  import Reminder from "./components/Reminder";
39
+ import PaymentWorkOrderList from "./components/PaymentWorkOrderList";
40
40
  import { PlatForm } from "./types";
41
41
  import "./index.less";
42
42
  import { jsx as _jsx } from "react/jsx-runtime";
43
43
  import { jsxs as _jsxs } from "react/jsx-runtime";
44
+ import { Fragment as _Fragment } from "react/jsx-runtime";
44
45
 
45
46
  var WorkOrder = function WorkOrder(props) {
46
47
  var platform = props.platform,
@@ -119,37 +120,39 @@ var WorkOrder = function WorkOrder(props) {
119
120
  return item.shopId == shopId;
120
121
  });
121
122
  }, [shopList]);
122
- return /*#__PURE__*/_jsx(Spin, {
123
- spinning: loading,
124
- children: /*#__PURE__*/_jsxs("div", {
125
- id: "customize-work-order-component",
126
- className: "order_container ".concat(platform === PlatForm.FXG ? '' : 'order_container_padding_bottom'),
127
- children: [/*#__PURE__*/_jsx("header", {
128
- className: "order_header",
129
- children: /*#__PURE__*/_jsxs("div", {
130
- className: "order_header_tabs",
131
- children: [/*#__PURE__*/_jsx("div", {
132
- className: "order_header_tabs_button ".concat(tabActive === 'custom' ? 'active' : ''),
133
- onClick: function onClick() {
134
- return setTabActive('custom');
135
- },
136
- children: "\u81EA\u5B9A\u4E49\u5DE5\u5355"
137
- }), /*#__PURE__*/_jsx("div", {
138
- className: "order_header_tabs_button border_left ".concat(tabActive === 'payment' ? 'active' : ''),
139
- onClick: function onClick() {
140
- return setTabActive('payment');
141
- },
142
- children: "\u6253\u6B3E\u5DE5\u5355"
143
- })]
144
- })
145
- }), /*#__PURE__*/_jsx(OrderList, {
146
- tabActive: tabActive
147
- }), /*#__PURE__*/_jsx(PaymentWorkOrderList, {
148
- tabActive: tabActive
149
- }), !isEmpower && /*#__PURE__*/_jsx(Reminder, {
150
- callback: onEmpowerCallback
151
- })]
152
- })
123
+ return /*#__PURE__*/_jsxs(_Fragment, {
124
+ children: [/*#__PURE__*/_jsx(Spin, {
125
+ spinning: loading,
126
+ children: /*#__PURE__*/_jsxs("div", {
127
+ id: "customize-work-order-component",
128
+ className: "order_container ".concat(platform === PlatForm.FXG ? '' : 'order_container_padding_bottom'),
129
+ children: [/*#__PURE__*/_jsx("header", {
130
+ className: "order_header",
131
+ children: /*#__PURE__*/_jsxs("div", {
132
+ className: "order_header_tabs",
133
+ children: [/*#__PURE__*/_jsx("div", {
134
+ className: "order_header_tabs_button ".concat(tabActive === 'custom' ? 'active' : ''),
135
+ onClick: function onClick() {
136
+ return setTabActive('custom');
137
+ },
138
+ children: "\u81EA\u5B9A\u4E49\u5DE5\u5355"
139
+ }), /*#__PURE__*/_jsx("div", {
140
+ className: "order_header_tabs_button border_left ".concat(tabActive === 'payment' ? 'active' : ''),
141
+ onClick: function onClick() {
142
+ return setTabActive('payment');
143
+ },
144
+ children: "\u6253\u6B3E\u5DE5\u5355"
145
+ })]
146
+ })
147
+ }), /*#__PURE__*/_jsx(OrderList, {
148
+ tabActive: tabActive
149
+ }), /*#__PURE__*/_jsx(PaymentWorkOrderList, {
150
+ tabActive: tabActive
151
+ })]
152
+ })
153
+ }), !isEmpower && Reminder({
154
+ callback: onEmpowerCallback
155
+ })]
153
156
  });
154
157
  };
155
158
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.3.0-alpha.9",
3
+ "version": "0.3.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",