kmkf-work-order-service-component 0.3.6-alpha.7 → 0.3.6

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.
@@ -76,6 +76,7 @@ var SingleShopWorkOrder = function SingleShopWorkOrder() {
76
76
  var submit = search.submit;
77
77
  var dataSource = tableProps.dataSource,
78
78
  pagination = tableProps.pagination;
79
+ console.log('pagination', pagination);
79
80
  useEffect(function () {
80
81
  dispatch(fetchTemplateList);
81
82
  }, []);
@@ -92,6 +93,13 @@ var SingleShopWorkOrder = function SingleShopWorkOrder() {
92
93
  dispatch(setTemplateId(id));
93
94
  };
94
95
 
96
+ var handleChangePagination = function handleChangePagination(page, pageSize) {
97
+ tableProps === null || tableProps === void 0 ? void 0 : tableProps.onChange(_objectSpread(_objectSpread({}, pagination), {}, {
98
+ current: page,
99
+ pageSize: pageSize
100
+ }));
101
+ };
102
+
95
103
  return /*#__PURE__*/_jsxs(Spin, {
96
104
  spinning: loading,
97
105
  children: [(templateList === null || templateList === void 0 ? void 0 : templateList.length) === 0 ? /*#__PURE__*/_jsx(Empty, {}) : /*#__PURE__*/_jsx("div", {
@@ -119,6 +127,9 @@ var SingleShopWorkOrder = function SingleShopWorkOrder() {
119
127
  children: /*#__PURE__*/_jsx(RangePicker, {
120
128
  onChange: function onChange() {
121
129
  return submit();
130
+ },
131
+ style: {
132
+ width: '100%'
122
133
  }
123
134
  })
124
135
  }), /*#__PURE__*/_jsx(Form.Item, {
@@ -140,7 +151,9 @@ var SingleShopWorkOrder = function SingleShopWorkOrder() {
140
151
  })]
141
152
  }), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 ? /*#__PURE__*/_jsx(OrderList, {
142
153
  list: dataSource
143
- }) : /*#__PURE__*/_jsx(Empty, {}), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && /*#__PURE__*/_jsx(Pagination, _objectSpread({}, pagination)), /*#__PURE__*/_jsx(DeleteCustomizeOrderModal, {
154
+ }) : /*#__PURE__*/_jsx(Empty, {}), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && /*#__PURE__*/_jsx(Pagination, _objectSpread(_objectSpread({}, pagination), {}, {
155
+ onChange: handleChangePagination
156
+ })), /*#__PURE__*/_jsx(DeleteCustomizeOrderModal, {
144
157
  submit: submit
145
158
  }), /*#__PURE__*/_jsx(CustomizeFormModal, {
146
159
  shopList: [],
@@ -14,6 +14,7 @@
14
14
  }
15
15
  }
16
16
  .list-container {
17
- margin-top: 16px;
17
+ margin-top: 4px;
18
18
  padding: 8px 12px;
19
+ background: #fff;
19
20
  }
@@ -9,7 +9,6 @@ import BasicMultSelect from '../Widget/basic/MultSelect';
9
9
  import BasicCascader from '../Widget/basic/Cascader';
10
10
  import BasicAddress from '../Widget/basic/Address';
11
11
  import BasicGrade from '../Widget/basic/Grade';
12
- import BasicRate from '../Widget/basic/Rate';
13
12
  import EBuyerNick from '../Widget/electricity/EBuyerNick';
14
13
  import EReceiverAddress from '../Widget/electricity/EReceiverAddress';
15
14
  import ELogistics from '../Widget/electricity/ELogistics';
@@ -23,4 +22,4 @@ import Status from '../Widget/third/Status';
23
22
  import Ordinary from '../Widget/third/Ordinary';
24
23
  import ItemSelectThird from '../Widget/third/ItemSelect';
25
24
  import Payment from '../Widget/third/Payment';
26
- export declare const factory: (type: string, options: any) => BasicInput | BasicRadio | BasicTextArea | BasicCheckBox | BasicDateTime | BasicSelect | BasicPicture | BasicMultSelect | BasicCascader | BasicAddress | BasicGrade | BasicRate | EBuyerNick | EReceiverAddress | ELogistics | EReturnLogistics | ERemark | EItemSelect | EItemId | EItemEncode | EAlipay | Status | Ordinary | ItemSelectThird | Payment;
25
+ export declare const factory: (type: string, options: any) => BasicInput | BasicRadio | BasicTextArea | BasicCheckBox | BasicDateTime | BasicSelect | BasicPicture | BasicMultSelect | BasicCascader | BasicAddress | BasicGrade | EBuyerNick | EReceiverAddress | ELogistics | EReturnLogistics | ERemark | EItemSelect | EItemId | EItemEncode | EAlipay | Status | Ordinary | ItemSelectThird | Payment;
@@ -9,7 +9,6 @@ import BasicMultSelect from "../Widget/basic/MultSelect";
9
9
  import BasicCascader from "../Widget/basic/Cascader";
10
10
  import BasicAddress from "../Widget/basic/Address";
11
11
  import BasicGrade from "../Widget/basic/Grade";
12
- import BasicRate from "../Widget/basic/Rate";
13
12
  import EShopName from "../Widget/electricity/ShopName";
14
13
  import ETradeId from "../Widget/electricity/ETradeId";
15
14
  import EBuyerNick from "../Widget/electricity/EBuyerNick";
@@ -65,9 +64,6 @@ export var factory = function factory(type, options) {
65
64
  case 'BASIC_GRADE':
66
65
  return new BasicGrade(options);
67
66
 
68
- case 'RATE':
69
- return new BasicRate(options);
70
-
71
67
  case 'SHOP_NAME_INPUT':
72
68
  return new EShopName(options);
73
69
 
@@ -149,12 +149,6 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
149
149
  content: get(nowData, "".concat(item.uniqueKey), ''),
150
150
  name: item.name
151
151
  });
152
- } else if (item.workOrderComponentType === 'RATE') {
153
- contentVoList.push({
154
- uniqueKey: "".concat(item.uniqueKey, "_rate"),
155
- content: JSON.stringify(get(nowData, "".concat(item.uniqueKey), [])),
156
- name: item.name
157
- });
158
152
  } else if (item.workOrderComponentType === 'BUYER_NICK_INPUT') {
159
153
  contentVoList.push({
160
154
  uniqueKey: "".concat(item.uniqueKey, "_buyerNick"),
@@ -497,8 +491,6 @@ var transDataSource = function transDataSource(templateColumns) {
497
491
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_select")] || (config === null || config === void 0 ? void 0 : config.select)));
498
492
  } else if (nex.workOrderComponentType === 'BASIC_GRADE') {
499
493
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_basicGrade")]));
500
- } else if (nex.workOrderComponentType === 'RATE') {
501
- return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_rate")], [])));
502
494
  } else if (nex.workOrderComponentType === 'TRADE_ID_INPUT') {
503
495
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_tradeId")]));
504
496
  } else if (nex.workOrderComponentType === 'BUYER_NICK_INPUT') {
@@ -577,20 +569,20 @@ var transDataSource = function transDataSource(templateColumns) {
577
569
  remark: item.jsonMap["".concat(nex.uniqueKey, "_remark")] || (config === null || config === void 0 ? void 0 : config.remark) || ''
578
570
  }));
579
571
  } else if (nex.workOrderComponentType === 'STATUS') {
580
- var _objectSpread29;
572
+ var _objectSpread28;
581
573
 
582
- return _objectSpread(_objectSpread({}, cur), {}, (_objectSpread29 = {}, _defineProperty(_objectSpread29, "".concat(nex.uniqueKey), {
574
+ return _objectSpread(_objectSpread({}, cur), {}, (_objectSpread28 = {}, _defineProperty(_objectSpread28, "".concat(nex.uniqueKey), {
583
575
  status: item.jsonMap["".concat(nex.uniqueKey, "_status")] || config.status,
584
576
  customerService: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_customerService")], item.jsonMap["".concat(nex.uniqueKey, "_customerService")])
585
- }), _defineProperty(_objectSpread29, "".concat(nex.uniqueKey, "_processTime"), item.jsonMap['processTime']), _defineProperty(_objectSpread29, "".concat(nex.uniqueKey, "_lastProcessingTime"), item.jsonMap['lastProcessingTime']), _objectSpread29));
577
+ }), _defineProperty(_objectSpread28, "".concat(nex.uniqueKey, "_processTime"), item.jsonMap['processTime']), _defineProperty(_objectSpread28, "".concat(nex.uniqueKey, "_lastProcessingTime"), item.jsonMap['lastProcessingTime']), _objectSpread28));
586
578
  } else if (nex.workOrderComponentType === 'ORDINARY_INVOICE') {
587
- var _objectSpread30;
579
+ var _objectSpread29;
588
580
 
589
- return _objectSpread(_objectSpread({}, cur), {}, (_objectSpread30 = {}, _defineProperty(_objectSpread30, "".concat(nex.uniqueKey), {
581
+ return _objectSpread(_objectSpread({}, cur), {}, (_objectSpread29 = {}, _defineProperty(_objectSpread29, "".concat(nex.uniqueKey), {
590
582
  ordinaryMoney: item.jsonMap["".concat(nex.uniqueKey, "_ordinaryMoney")],
591
583
  ordinarySerial: item.jsonMap["".concat(nex.uniqueKey, "_ordinarySerial")],
592
584
  ordinaryTaitou: item.jsonMap["".concat(nex.uniqueKey, "_ordinaryTaitou")]
593
- }), _defineProperty(_objectSpread30, "".concat(nex.uniqueKey, "_ordinaryMoney"), item.jsonMap["".concat(nex.uniqueKey, "_ordinaryMoney")] ? Number(item.jsonMap["".concat(nex.uniqueKey, "_ordinaryMoney")]).toFixed(2) : null), _objectSpread30));
585
+ }), _defineProperty(_objectSpread29, "".concat(nex.uniqueKey, "_ordinaryMoney"), item.jsonMap["".concat(nex.uniqueKey, "_ordinaryMoney")] ? Number(item.jsonMap["".concat(nex.uniqueKey, "_ordinaryMoney")]).toFixed(2) : null), _objectSpread29));
594
586
  } else if (nex.workOrderComponentType === 'ITEM_SELECT') {
595
587
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_itemList")], [])));
596
588
  } else if (nex.workOrderComponentType === 'ITEM_ENCODE') {
@@ -27,7 +27,6 @@ var requestApi = function requestApi(_ref) {
27
27
  params.data = data;
28
28
  }
29
29
 
30
- debugger;
31
30
  request(url, params).then(function (res) {
32
31
  if (res.result === 100 || res.success) {
33
32
  resolve(res);
@@ -284,7 +284,7 @@ export var workOrderSlice = createSlice({
284
284
  tempList.push(t);
285
285
  }
286
286
 
287
- return t.enabled;
287
+ return !item.enabled;
288
288
  });
289
289
  prv.push({
290
290
  label: item.groupName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.3.6-alpha.7",
3
+ "version": "0.3.6",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import BasicComponent from '../../BasicComponent';
3
- declare class BasicRate extends BasicComponent {
4
- constructor(options: any);
5
- render: (value: any) => JSX.Element;
6
- customRules: () => {
7
- required: boolean;
8
- validator: (_: any, value: any) => Promise<void>;
9
- }[];
10
- renderExport: (value: any, record: any) => any;
11
- editRender: (value: any) => JSX.Element;
12
- }
13
- export default BasicRate;
@@ -1,144 +0,0 @@
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
-
3
- 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; }
4
-
5
- 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; }
6
-
7
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
8
-
9
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
-
11
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
-
13
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
-
15
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
-
17
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
18
-
19
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
20
-
21
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
-
23
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24
-
25
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
26
-
27
- 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; }
28
-
29
- import React from 'react';
30
- import BasicComponent from "../../BasicComponent";
31
- import { ApaasRate } from '@raycloud-apaas-fe-setup/apaas-react-basics-widgets';
32
- import { getFormItem } from "../../common/formItemWrap";
33
- import { Rate } from 'antd'; //状态文字映射
34
-
35
- import { jsx as _jsx } from "react/jsx-runtime";
36
- import { jsxs as _jsxs } from "react/jsx-runtime";
37
- var RATE_MAP = {
38
- 0: '',
39
- 0.5: '非常差',
40
- 1: '非常差',
41
- 1.5: '差',
42
- 2: '差',
43
- 2.5: '一般',
44
- 3: '一般',
45
- 3.5: '好',
46
- 4: '好',
47
- 4.5: '非常好',
48
- 5: '非常好'
49
- };
50
-
51
- var BasicRate = /*#__PURE__*/function (_BasicComponent) {
52
- _inherits(BasicRate, _BasicComponent);
53
-
54
- var _super = _createSuper(BasicRate);
55
-
56
- function BasicRate(options) {
57
- var _this;
58
-
59
- _classCallCheck(this, BasicRate);
60
-
61
- _this = _super.call(this, options);
62
-
63
- _defineProperty(_assertThisInitialized(_this), "render", function (value) {
64
- return /*#__PURE__*/_jsx("div", {
65
- children: value.map(function (item) {
66
- return /*#__PURE__*/_jsxs("div", {
67
- children: [/*#__PURE__*/_jsx("span", {
68
- style: {
69
- marginRight: '8px'
70
- },
71
- children: item.name
72
- }), /*#__PURE__*/_jsx(Rate, {
73
- value: item.value,
74
- style: {
75
- color: 'red',
76
- fontSize: '12px'
77
- },
78
- disabled: true
79
- }), /*#__PURE__*/_jsx("span", {
80
- style: {
81
- color: 'red',
82
- fontSize: '12px'
83
- },
84
- children: RATE_MAP[item.value]
85
- })]
86
- }, item.id);
87
- })
88
- });
89
- });
90
-
91
- _defineProperty(_assertThisInitialized(_this), "customRules", function () {
92
- return [{
93
- required: true,
94
- validator: function validator(_, value) {
95
- if (value && !value.length) {
96
- return Promise.reject(new Error("\u8BF7\u9009\u62E9".concat(_this.name)));
97
- }
98
-
99
- return Promise.resolve();
100
- }
101
- }];
102
- });
103
-
104
- _defineProperty(_assertThisInitialized(_this), "renderExport", function (value, record) {
105
- var textArr = value.reduce(function (prv, next) {
106
- if (next.value) {
107
- prv.push("".concat(next.name, ":").concat(next.value, "\u661F"));
108
- }
109
-
110
- return prv;
111
- }, []);
112
- return textArr.join(';');
113
- });
114
-
115
- _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
116
- return getFormItem(_objectSpread({
117
- title: _this.name,
118
- name: _this.id,
119
- rules: _this.componentConfig.required ? _this.customRules() : [],
120
- required: false,
121
- component: /*#__PURE__*/_jsx(ApaasRate, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
122
- allowClear: false,
123
- style: {
124
- color: '#FD5105'
125
- },
126
- textStyle: {
127
- color: '#FD5105'
128
- }
129
- }))
130
- }, value));
131
- });
132
-
133
- _this.canFilter = false;
134
- _this.canGroup = false;
135
- _this.canHidden = true;
136
- _this.editable = true;
137
- _this.dataType = 'array';
138
- return _this;
139
- }
140
-
141
- return _createClass(BasicRate);
142
- }(BasicComponent);
143
-
144
- export default BasicRate;