@kmkf-fe-packages/services-components 0.6.3-alpha.27 → 0.6.3-alpha.29

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/README.md CHANGED
@@ -1 +1,3 @@
1
1
  ### 企业工单组件库
2
+
3
+ 1
@@ -4,5 +4,5 @@ declare type OperationLogProps = {
4
4
  componentDtoList: any[];
5
5
  };
6
6
  export declare const unTransField: (key: string) => boolean;
7
- declare const OperationLog: ({ content, operation, componentDtoList }: OperationLogProps) => string | JSX.Element | null;
7
+ declare const OperationLog: ({ content, operation, componentDtoList, }: OperationLogProps) => JSX.Element | null;
8
8
  export default OperationLog;
@@ -4,11 +4,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  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; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React from 'react';
8
- import { factory } from '@kmkf-fe-packages/services-components';
9
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
7
+ import React from "react";
8
+ import { factory } from "@kmkf-fe-packages/services-components";
9
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
10
10
  export var unTransField = function unTransField(key) {
11
- return ['itemList', 'jstItemList', 'dateTime', 'basicMultSelect', 'checkbox', 'multSelect', 'rate', 'picture'].reduce(function (cur, nxt) {
11
+ return ["itemList", "jstItemList", "dateTime", "basicMultSelect", "checkbox", "multSelect", "rate", "picture"].reduce(function (cur, nxt) {
12
12
  return cur || (key === null || key === void 0 ? void 0 : key.includes(nxt));
13
13
  }, false);
14
14
  };
@@ -20,7 +20,7 @@ var OperationLog = function OperationLog(_ref) {
20
20
  try {
21
21
  if (/^TRANSFER/.test(operation)) {
22
22
  if (/^\[.*?\]-->>\[.*?\]$/.test(content)) {
23
- var _content$split = content.split('-->>'),
23
+ var _content$split = content.split("-->>"),
24
24
  _content$split2 = _slicedToArray(_content$split, 2),
25
25
  before = _content$split2[0],
26
26
  after = _content$split2[1];
@@ -36,34 +36,34 @@ var OperationLog = function OperationLog(_ref) {
36
36
  }
37
37
  return /*#__PURE__*/React.createElement("div", {
38
38
  className: "log-info-wrap"
39
- }, "".concat(beforeList.join(','), " => ").concat(afterList.join(',')));
39
+ }, "".concat(beforeList.join(","), " => ").concat(afterList.join(",")));
40
40
  }
41
41
  } else if (/^(UPDATE|ADD)/.test(operation)) {
42
42
  var record = JSON.parse(content);
43
43
  if (/^\[.+\]$/.test(content)) {
44
44
  var currentContent = record === null || record === void 0 ? void 0 : record.reduce(function (nxt, cur) {
45
- if (!unTransField(cur['uniqueKey'])) {
46
- nxt[cur['uniqueKey']] = cur['content'];
45
+ if (!unTransField(cur["uniqueKey"])) {
46
+ nxt[cur["uniqueKey"]] = cur["content"];
47
47
  return nxt;
48
48
  }
49
49
  try {
50
- nxt[cur['uniqueKey']] = JSON.parse(cur['content']);
50
+ nxt[cur["uniqueKey"]] = JSON.parse(cur["content"]);
51
51
  } catch (e) {
52
- nxt[cur['uniqueKey']] = cur['content'];
52
+ nxt[cur["uniqueKey"]] = cur["content"];
53
53
  } finally {
54
54
  // eslint-disable-next-line no-unsafe-finally
55
55
  return nxt;
56
56
  }
57
57
  }, {});
58
58
  var oldContent = record === null || record === void 0 ? void 0 : record.reduce(function (nxt, cur) {
59
- if (!unTransField(cur['uniqueKey'])) {
60
- nxt[cur['uniqueKey']] = cur['oldContent'];
59
+ if (!unTransField(cur["uniqueKey"])) {
60
+ nxt[cur["uniqueKey"]] = cur["oldContent"];
61
61
  return nxt;
62
62
  }
63
63
  try {
64
- nxt[cur['uniqueKey']] = JSON.parse(cur['oldContent']);
64
+ nxt[cur["uniqueKey"]] = JSON.parse(cur["oldContent"]);
65
65
  } catch (e) {
66
- nxt[cur['uniqueKey']] = cur['oldContent'];
66
+ nxt[cur["uniqueKey"]] = cur["oldContent"];
67
67
  } finally {
68
68
  // eslint-disable-next-line no-unsafe-finally
69
69
  return nxt;
@@ -82,29 +82,29 @@ var OperationLog = function OperationLog(_ref) {
82
82
  componentConfig: item.componentConfig,
83
83
  type: item.workOrderComponentType
84
84
  });
85
- if (operation !== null && operation !== void 0 && operation.startsWith('UPDATE')) {
85
+ if (operation !== null && operation !== void 0 && operation.startsWith("UPDATE")) {
86
86
  return /*#__PURE__*/React.createElement("span", {
87
87
  style: {
88
- display: 'flex'
88
+ display: "flex"
89
89
  }
90
90
  }, /*#__PURE__*/React.createElement("span", {
91
91
  style: {
92
- maxWidth: '66px',
93
- marginRight: '8px',
92
+ maxWidth: "66px",
93
+ marginRight: "8px",
94
94
  flexShrink: 1
95
95
  }
96
96
  }, item === null || item === void 0 ? void 0 : item.name, ":"), /*#__PURE__*/React.createElement("span", {
97
97
  className: "value"
98
- }, /*#__PURE__*/React.createElement("span", null, instance.renderLog(oldContent), /*#__PURE__*/React.createElement("span", null, '=>'), instance.renderLog(currentContent))));
99
- } else if (operation !== null && operation !== void 0 && operation.startsWith('ADD') && !isNull(instance.getComponentValue(currentContent))) {
98
+ }, /*#__PURE__*/React.createElement("span", null, instance.renderLog(oldContent), /*#__PURE__*/React.createElement("span", null, "=>"), instance.renderLog(currentContent))));
99
+ } else if (operation !== null && operation !== void 0 && operation.startsWith("ADD") && !isNull(instance.getComponentValue(currentContent))) {
100
100
  return /*#__PURE__*/React.createElement("span", {
101
101
  style: {
102
- display: 'flex'
102
+ display: "flex"
103
103
  }
104
104
  }, /*#__PURE__*/React.createElement("span", {
105
105
  style: {
106
- maxWidth: '66px',
107
- marginRight: '8px',
106
+ maxWidth: "66px",
107
+ marginRight: "8px",
108
108
  flexShrink: 1
109
109
  }
110
110
  }, item === null || item === void 0 ? void 0 : item.name, ":"), /*#__PURE__*/React.createElement("span", {
@@ -120,8 +120,8 @@ var OperationLog = function OperationLog(_ref) {
120
120
  }
121
121
  return /*#__PURE__*/React.createElement("div", null, content);
122
122
  } catch (e) {
123
- console.error('日志信息JSON转换异常', e);
124
- return content;
123
+ console.error("日志信息JSON转换异常", e);
124
+ return /*#__PURE__*/React.createElement("div", null, content);
125
125
  }
126
126
  };
127
127
  export default OperationLog;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.6.3-alpha.27",
3
+ "version": "0.6.3-alpha.29",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -26,8 +26,8 @@
26
26
  "father": "^4.1.7"
27
27
  },
28
28
  "dependencies": {
29
- "@kmkf-fe-packages/basic-components": "^0.6.3-alpha.27",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.6.3-alpha.27"
29
+ "@kmkf-fe-packages/basic-components": "^0.6.3-alpha.29",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.6.3-alpha.29"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@ant-design/icons": "^4.7.0",
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "6568517bf5c889bc02b548d5cf4a0c03dea307ae"
43
+ "gitHead": "020b26377a517873ce2ec5f4575996cef737cba8"
44
44
  }